本文整理匯總了Python中OpenSCADUtils.meshoptempfile方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenSCADUtils.meshoptempfile方法的具體用法?Python OpenSCADUtils.meshoptempfile怎麽用?Python OpenSCADUtils.meshoptempfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenSCADUtils
的用法示例。
在下文中一共展示了OpenSCADUtils.meshoptempfile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: fuse
# 需要導入模塊: import OpenSCADUtils [as 別名]
# 或者: from OpenSCADUtils import meshoptempfile [as 別名]
def fuse(meshes):
meshes1 = []
meshes2 = []
for mesh in meshes:
o = orientation(mesh)
if o == "Forward":
meshes1.append(mesh)
elif o == "Reversed":
meshes2.append(complement(mesh))
else:
raise TypeError
# # broken
# mesh1 = None
# if len(meshes1) > 0:
# mesh1 = reduce(Mesh.Mesh.unite, meshes1)
# mesh2 = None
# if len(meshes2) > 0:
# mesh2 = reduce(Mesh.Mesh.intersect, meshes2)
# if mesh1 is None and mesh2 is None:
# return None
# elif mesh1 is None:
# return complement(mesh2)
# elif mesh2 is None:
# return mesh1
# else:
# return complement(mesh2.difference(mesh1))
mesh1 = None
if len(meshes1) > 1:
mesh1 = OpenSCADUtils.meshoptempfile('union', meshes1)
elif len(meshes1) == 1:
mesh1 = meshes1[0]
mesh2 = None
if len(meshes2) > 1:
mesh2 = OpenSCADUtils.meshoptempfile('intersection', meshes2)
elif len(meshes2) == 1:
mesh2 = meshes2[0]
if mesh1 is None and mesh2 is None:
return None
elif mesh1 is None:
return complement(mesh2)
elif mesh2 is None:
return mesh1
else:
return complement(OpenSCADUtils.meshoptempfile('difference', [mesh2, mesh1]))