本文整理汇总了Python中mesh.Mesh.ensure_fresh_octrees方法的典型用法代码示例。如果您正苦于以下问题:Python Mesh.ensure_fresh_octrees方法的具体用法?Python Mesh.ensure_fresh_octrees怎么用?Python Mesh.ensure_fresh_octrees使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mesh.Mesh
的用法示例。
在下文中一共展示了Mesh.ensure_fresh_octrees方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Mesh
# 需要导入模块: from mesh import Mesh [as 别名]
# 或者: from mesh.Mesh import ensure_fresh_octrees [as 别名]
mb = Mesh()
add_cuboid(mb, corner = Vector(bx1, by1, bz1), lx = bx2 - bx1, ly = by2 - by1, lz = bz2 - bz1)
ma.ensure_fresh_octrees()
mb.ensure_fresh_octrees()
mi = intersect(ma, mb)
return mi
def union(self,
((ax1, ax2), (ay1, ay2), (az1, az2)),
((bx1, bx2), (by1, by2), (bz1, bz2))):
ma = Mesh()
add_cuboid(ma, corner = Vector(ax1, ay1, az1), lx = ax2 - ax1, ly = ay2 - ay1, lz = az2 - az1)
mb = Mesh()
add_cuboid(mb, corner = Vector(bx1, by1, bz1), lx = bx2 - bx1, ly = by2 - by1, lz = bz2 - bz1)
ma.ensure_fresh_octrees()
mb.ensure_fresh_octrees()
mi = union(ma, mb)
return mi
def check_intersection(self,
((ax1, ax2), (ay1, ay2), (az1, az2)),
((bx1, bx2), (by1, by2), (bz1, bz2)),
excepted_number_of_verticies):
mi = self.intersection(((ax1, ax2), (ay1, ay2), (az1, az2)),
((bx1, bx2), (by1, by2), (bz1, bz2)))
self.assertAlmostEqual(mi.volume(),
intersection_volume(((ax1, ax2), (ay1, ay2), (az1, az2)),
((bx1, bx2), (by1, by2), (bz1, bz2))))
self.assertEqual(len(mi.vertices), excepted_number_of_verticies)
self.check_areas_by_normal(mi,