MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / init_MeshUtils

Function init_MeshUtils

python/PyMeshUtils.cpp:32–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30using namespace pybind11::literals;
31
32void init_MeshUtils(py::module& m) {
33 m.def("convert_to_vertex_attribute",
34 &AttributeUtils::convert_to_vertex_attribute);
35 m.def("convert_to_vertex_attribute_from_name",
36 &AttributeUtils::convert_to_vertex_attribute_from_name);
37 m.def("convert_to_face_attribute",
38 &AttributeUtils::convert_to_face_attribute);
39 m.def("convert_to_face_attribute_from_name",
40 &AttributeUtils::convert_to_face_attribute_from_name);
41 m.def("convert_to_voxel_attribute",
42 &AttributeUtils::convert_to_voxel_attribute);
43 m.def("convert_to_voxel_attribute_from_name",
44 &AttributeUtils::convert_to_voxel_attribute_from_name);
45 m.def("extract_exterior_faces",
46 &MeshUtils::extract_exterior_faces);
47 m.def("is_colinear_2D", &FaceUtils::is_colinear_2D);
48 m.def("is_colinear_3D", &FaceUtils::is_colinear_3D);
49 m.def("get_degenerated_faces", &FaceUtils::get_degenerated_faces);
50 m.def("get_triangle_orientations", &FaceUtils::get_triangle_orientations);
51 m.def("get_tet_orientations", &VoxelUtils::get_tet_orientations);
52 m.def("is_delaunay", &VoxelUtils::is_delaunay);
53 m.def("is_vertex_manifold", &ManifoldCheck::is_vertex_manifold);
54 m.def("is_edge_manifold", &ManifoldCheck::is_edge_manifold);
55 m.def("cut_to_manifold", &ManifoldCheck::cut_to_manifold);
56 m.def("chain_edges", &EdgeUtils::chain_edges);
57
58 py::class_<ObtuseTriangleRemoval>(m, "ObtuseTriangleRemoval")
59 .def(py::init<MatrixFr&, MatrixIr&>())
60 .def("run", &ObtuseTriangleRemoval::run)
61 .def("get_vertices", &ObtuseTriangleRemoval::get_vertices)
62 .def("get_faces", &ObtuseTriangleRemoval::get_faces);
63
64 py::class_<ShortEdgeRemoval>(m, "ShortEdgeRemoval")
65 .def(py::init<const MatrixFr&, const MatrixIr&>())
66 .def("set_importance", &ShortEdgeRemoval::set_importance)
67 .def("run", &ShortEdgeRemoval::run)
68 .def("get_vertices", &ShortEdgeRemoval::get_vertices)
69 .def("get_faces", &ShortEdgeRemoval::get_faces)
70 .def("get_face_indices", &ShortEdgeRemoval::get_face_indices);
71
72 py::class_<MeshSeparator> separator(m, "MeshSeparator");
73 separator.def(py::init<const MatrixI&>())
74 .def("set_connectivity_type", &MeshSeparator::set_connectivity_type)
75 .def("separate", &MeshSeparator::separate)
76 .def("get_component", &MeshSeparator::get_component)
77 .def("get_sources", &MeshSeparator::get_sources)
78 .def("clear", &MeshSeparator::clear);
79
80 py::enum_<MeshSeparator::ConnectivityType>(separator, "ConnectivityType")
81 .value("VERTEX", MeshSeparator::ConnectivityType::VERTEX)
82 .value("FACE", MeshSeparator::ConnectivityType::FACE)
83 .value("VOXEL", MeshSeparator::ConnectivityType::VOXEL)
84 .export_values();
85
86 py::class_<MeshChecker>(m, "MeshChecker")
87 .def(py::init<const MatrixFr&, const MatrixIr&, const MatrixIr&>())
88 .def("is_vertex_manifold", &MeshChecker::is_vertex_manifold)
89 .def("is_edge_manifold", &MeshChecker::is_edge_manifold)

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected