本文整理汇总了Python中BPyMesh.faceAngles方法的典型用法代码示例。如果您正苦于以下问题:Python BPyMesh.faceAngles方法的具体用法?Python BPyMesh.faceAngles怎么用?Python BPyMesh.faceAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BPyMesh
的用法示例。
在下文中一共展示了BPyMesh.faceAngles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: split
# 需要导入模块: import BPyMesh [as 别名]
# 或者: from BPyMesh import faceAngles [as 别名]
def split(mesh, splitHeight):
'''
Split the mesh into tetra-, pentahedra, one for every face.
Very close opposite faces (like a concave thin wall) will break visibility info.
'''
# we'll return a list of new meshes, together making the original one
ms = []
for f in mesh.faces:
vs = [v.co for v in f.verts]
# check if the face won't cause trouble
if len(vs) != 3:
warning('\t\tSkipping a face not being a triangle, with %d vertices.' % len(vs))
continue
if f.area < minFaceArea:
warning('\t\tSkipping a face with very small area: %.2f.' % f.area)
continue
as = filter(lambda a: a < minFaceAngle, BPyMesh.faceAngles(f)) # *** just till the first is found
if as:
warning('\t\tSkipping a face with a very small angle: %.2f.' % as[0])
continue
es = filter(lambda ei: mesh.edges[ei].length < minEdgeLength, mesh.findEdges(f.edge_keys)) # *** same
if es:
warning('\t\tSkipping a face with a very short edge: %.2f.' % mesh.edges[es[0]].length)
continue
# make a new tetrahedron, watch vertex order not to flip any normals
m = Mesh.New()
m.verts.extend(vs)
m.verts.extend(f.cent - f.no * splitHeight)
m.faces.extend(((0, 1, 2), (1, 0, 3), (2, 1, 3), (0, 2, 3)))
m.faces[0].image = f.image
m.faces[0].uv = f.uv
ms.append(m)
return ms
'''