def convex_hull(self):
"""Return a 3D mesh that represents the convex hull of the mesh.
"""
hull = ss.ConvexHull(self.vertices_)
hull_tris = hull.simplices
if self.normals_ is None:
cvh_mesh = Mesh3D(self.vertices_.copy(), hull_tris.copy(), center_of_mass=self.center_of_mass_)
else:
cvh_mesh = Mesh3D(self.vertices_.copy(), hull_tris.copy(), normals=self.normals_.copy(), center_of_mass=self.center_of_mass_)
cvh_mesh.remove_unreferenced_vertices()
return cvh_mesh
评论列表
文章目录