Cut a mesh open into disk topology. (Note the cut may not be optimal.) This method assumes the input mesh is edge-manifold. Args: mesh (:class:`Mesh`): Input mesh. Returns: The same mesh as input but cutted so it is topologically equivalent to a disk.
(mesh)
| 2 | from .meshio import form_mesh |
| 3 | |
| 4 | def cut_to_disk(mesh): |
| 5 | """ Cut a mesh open into disk topology. (Note the cut may not be optimal.) |
| 6 | This method assumes the input mesh is edge-manifold. |
| 7 | |
| 8 | Args: |
| 9 | mesh (:class:`Mesh`): Input mesh. |
| 10 | |
| 11 | Returns: The same mesh as input but cutted so it is topologically equivalent |
| 12 | to a disk. |
| 13 | """ |
| 14 | cutter = PyMesh.DiskCutter.create(mesh.raw_mesh) |
| 15 | cutter.run() |
| 16 | return form_mesh(cutter.vertices, cutter.faces) |