Perform Minkowski sum of a mesh with a poly-line. Args: mesh (:class:`Mesh`): Input mesh. path (:class:`numpy.ndarray`): a :math:`n \times 3` matrix. Each row represents a node in the poly-line. Returns: A mesh representing the Minkowski sum of the inputs.
(mesh, path)
| 4 | from .meshutils import remove_isolated_vertices |
| 5 | |
| 6 | def minkowski_sum(mesh, path): |
| 7 | """ Perform Minkowski sum of a mesh with a poly-line. |
| 8 | |
| 9 | Args: |
| 10 | mesh (:class:`Mesh`): Input mesh. |
| 11 | path (:class:`numpy.ndarray`): a :math:`n \times 3` matrix. Each row |
| 12 | represents a node in the poly-line. |
| 13 | |
| 14 | Returns: A mesh representing the Minkowski sum of the inputs. |
| 15 | """ |
| 16 | min_sum = PyMesh.MinkowskiSum.create_raw(mesh.vertices, mesh.faces) |
| 17 | min_sum.run(path) |
| 18 | |
| 19 | result = form_mesh(min_sum.get_vertices(), min_sum.get_faces()) |
| 20 | |
| 21 | return result |