本文整理汇总了Python中mesh.Mesh.condense_duplicate_vertices方法的典型用法代码示例。如果您正苦于以下问题:Python Mesh.condense_duplicate_vertices方法的具体用法?Python Mesh.condense_duplicate_vertices怎么用?Python Mesh.condense_duplicate_vertices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mesh.Mesh
的用法示例。
在下文中一共展示了Mesh.condense_duplicate_vertices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: combine_meshes
# 需要导入模块: from mesh import Mesh [as 别名]
# 或者: from mesh.Mesh import condense_duplicate_vertices [as 别名]
def combine_meshes(mesh1, mesh2, ensure_continuity = False):
"""
Combine two meshes into one disconnected mesh. This function
relies on the user to make sure that nothing weird is going on.
for example, the meshes probably should not intersect. I'm not
sure what would happen if they do! Also, I assume that all
the meshes are linear (linear mapping from real to reference space).
Also, this function does not apply any mappings -- it assumes they have
already been applied to the elements of the subordinate meshes.
"""
vertices = copy.copy(mesh1.vertices)
vertices.extend(mesh2.vertices)
elements = copy.copy(mesh1.elements)
elements.extend(mesh2.elements)
result = Mesh(vertices, elements)
if ensure_continuity:
result.condense_duplicate_vertices()
return result