diff --git a/src/is_vertex_manifold.cpp b/src/is_vertex_manifold.cpp new file mode 100644 index 00000000..a80873b8 --- /dev/null +++ b/src/is_vertex_manifold.cpp @@ -0,0 +1,38 @@ +#include "default_types.h" +#include +#include +#include +#include + +namespace nb = nanobind; +using namespace nb::literals; + +namespace pyigl +{ + // Wrapper for is_vertex_manifold with overload handling + auto is_vertex_manifold( + const nb::DRef &F) + { + Eigen::Matrix B; + igl::is_vertex_manifold(F, B); + return B; + } +} + +// Bind the wrapper to the Python module +void bind_is_vertex_manifold(nb::module_ &m) +{ + m.def( + "is_vertex_manifold", + &pyigl::is_vertex_manifold, + "F"_a, +R"(Check if a mesh is vertex-manifold. + +This only checks whether the faces incident on each vertex form exactly one +connected component. Vertices incident on non-manifold edges are not consider +non-manifold by this function (see is_edge_manifold). Unreferenced verties are +considered non-manifold (zero components). + +@param[in] F #F by 3 list of triangle indices +@return B #V list indicate whether each vertex is locally manifold (the mesh is vertex manifold if all(B) == True)"); +} diff --git a/tutorial/igl_docs.md b/tutorial/igl_docs.md index 78168209..221e2b54 100644 --- a/tutorial/igl_docs.md +++ b/tutorial/igl_docs.md @@ -1505,7 +1505,23 @@ IS_DELAUNAY Determine if each edge in the mesh (V,F) is Delaunay. ### is_edge_manifold **`is_edge_manifold(f: array) -> bool`** -See is_edge_manifold for the documentation. +Check if the mesh is edge-manifold (every edge is incident one one face (boundary) or two oppositely oriented faces). + +| | | +|-|-| +|Parameters| F: \#F by 3 list of triangle indices | +|Returns| True iff all edges are manifold | + +### is_vertex_manifold +**`is_vertex_manifold(f: array) -> bool`** + +Check if a mesh is vertex-manifold. This only checks whether the faces incident on each vertex form exactly one connected component. Vertices incident on non-manifold edges are not consider non-manifold by this function (see is_edge_manifold). Unreferenced verties are considered non-manifold (zero components). + +| | | +|-|-| +|Parameters| F \#F by 3 list of triangle indices | +|Returns| B \#V list indicate whether each vertex is locally manifold.
The mesh is vertex manifold if `all(B) == True`. | + ### is_intrinsic_delaunay **`is_intrinsic_delaunay(l: array, f: array)`**