19 py::class_<TetraMesh, PyGeometry<TetraMesh>, std::shared_ptr<TetraMesh>,
21 trianglemesh(m,
"TetraMesh",
22 "TetraMesh class. Tetra mesh contains vertices "
23 "and Tetrahedra represented by the indices to the "
25 py::detail::bind_default_constructor<TetraMesh>(trianglemesh);
26 py::detail::bind_copy_functions<TetraMesh>(trianglemesh);
28 .def(py::init<
const std::vector<Eigen::Vector3d> &,
32 "Create a tetrahedra mesh from vertices and tetra indices",
33 "vertices"_a,
"tetras"_a)
36 return std::string(
"TetraMesh with ") +
42 .def(py::self + py::self)
43 .def(py::self += py::self)
44 .def(
"remove_duplicated_vertices",
46 "Function that removes duplicated vertices, i.e., vertices "
47 "that have identical coordinates.")
49 "Function that removes duplicated tetras, i.e., removes "
50 "tetras that reference the same four vertices, "
51 "independent of their order.")
52 .def(
"remove_unreferenced_vertices",
54 "This function removes vertices from the tetra mesh that "
55 "are not referenced in any tetra of the mesh.")
57 "Function that removes degenerate tetras, i.e., tetras "
58 "that references a single vertex multiple times in a single "
59 "tetra. They are usually the product of removing "
60 "duplicated vertices.")
62 "Returns ``True`` if the mesh contains vertices.")
64 "Returns ``True`` if the mesh contains tetras.")
66 "Function that generates a triangle mesh of the specified "
68 "values"_a,
"level"_a)
71 "Function to create a tetrahedral mesh from a point cloud.",
74 "``float64`` array of shape ``(num_vertices, 3)``, "
75 "use ``numpy.asarray()`` to access data: Vertex "
78 "``int64`` array of shape ``(num_tetras, 4)``, use "
79 "``numpy.asarray()`` to access data: List of "
80 "tetras denoted by the index of points forming "
85 "remove_duplicated_vertices");
88 "remove_unreferenced_vertices");
91 m,
"TetraMesh",
"extract_triangle_mesh",
93 "Vector with a scalar value for each vertex in the tetra mesh"},
94 {
"level",
"A scalar which defines the level-set to extract"}});
96 {{
"point_cloud",
"A PointCloud."}});
Tetra mesh contains vertices and tetrahedra represented by the indices to the vertices.
std::vector< Eigen::Vector4i, cloudViewer::utility::Vector4i_allocator > tetras_
List of tetras denoted by the index of points forming the tetra.
std::shared_ptr< ccMesh > ExtractTriangleMesh(const std::vector< double > &values, double level)
Function to extract a triangle mesh of the specified iso-surface at a level This method applies prima...
TetraMesh & RemoveDuplicatedTetras()
Function that removes duplicated tetrahedra, i.e., removes tetrahedra that reference the same four ve...
TetraMesh & RemoveUnreferencedVertices()
This function removes vertices from the tetra mesh that are not referenced in any tetrahedron of the ...
TetraMesh & RemoveDegenerateTetras()
Function that removes degenerate tetrahedra, i.e., tetrahedra that reference a single vertex multiple...
TetraMesh & RemoveDuplicatedVertices()
Function that removes duplicated verties, i.e., vertices that have identical coordinates.
bool HasTetras() const
Returns true if the mesh contains tetras.
static std::tuple< std::shared_ptr< TetraMesh >, std::vector< size_t > > CreateFromPointCloud(const ccPointCloud &point_cloud)
Function that creates a tetrahedral mesh (TetraMeshFactory.cpp). from a point cloud.
bool HasVertices() const
Returns True if the mesh contains vertices.
std::vector< Eigen::Vector3d > vertices_
Vertex coordinates.
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void pybind_tetramesh(py::module &m)
void pybind_tetramesh_methods(py::module &m)
Eigen::aligned_allocator< Eigen::Vector4i > Vector4i_allocator
Generic file read and write utility for python interface.
Eigen::Matrix< Index, 4, 1 > Vector4i
std::string to_string(const T &n)