def smoothed(mesh, angle):
'''
Return a non- watertight version of the mesh which will
render nicely with smooth shading.
Arguments
---------
mesh: Trimesh object
angle: float, angle in radians, adjacent faces which have normals
below this angle will be smoothed.
Returns
---------
smooth: Trimesh object
'''
adjacency = adjacency_angle(mesh, angle)
graph = nx.from_edgelist(adjacency)
graph.add_nodes_from(np.arange(len(mesh.faces)))
smooth = mesh.submesh(nx.connected_components(graph),
only_watertight = False,
append = True)
return smooth
评论列表
文章目录