当前位置: 首页>>代码示例>>Python>>正文


Python BPyMesh.faceAngles方法代码示例

本文整理汇总了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
	'''
开发者ID:ArkyRomania,项目名称:ufoai,代码行数:38,代码来源:export_ufoai.py


注:本文中的BPyMesh.faceAngles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。