Skip to content

Commit 1fb8c86

Browse files
committed
Add binding for is_vertex_manifold
1 parent 48699d6 commit 1fb8c86

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

src/is_vertex_manifold.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include "default_types.h"
2+
#include <igl/is_vertex_manifold.h>
3+
#include <nanobind/nanobind.h>
4+
#include <nanobind/ndarray.h>
5+
#include <nanobind/eigen/dense.h>
6+
#include <nanobind/stl/tuple.h>
7+
8+
namespace nb = nanobind;
9+
using namespace nb::literals;
10+
11+
namespace pyigl
12+
{
13+
// Wrapper for is_vertex_manifold with overload handling
14+
auto is_vertex_manifold(
15+
const nb::DRef<const Eigen::MatrixXI> &F)
16+
{
17+
Eigen::Matrix<bool, Eigen::Dynamic, 1> B;
18+
igl::is_vertex_manifold(F, B);
19+
return B;
20+
}
21+
}
22+
23+
// Bind the wrapper to the Python module
24+
void bind_is_vertex_manifold(nb::module_ &m)
25+
{
26+
m.def(
27+
"is_vertex_manifold",
28+
&pyigl::is_vertex_manifold,
29+
"F"_a,
30+
R"(Check if a mesh is vertex-manifold.
31+
32+
This only checks whether the faces incident on each vertex form exactly one
33+
connected component. Vertices incident on non-manifold edges are not consider
34+
non-manifold by this function (see is_edge_manifold). Unreferenced verties are
35+
considered non-manifold (zero components).
36+
37+
@param[in] F #F by 3 list of triangle indices
38+
@return B #V list indicate whether each vertex is locally manifold (the mesh is vertex manifold if all(B) == True)");
39+
}

tutorial/igl_docs.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,23 @@ IS_DELAUNAY Determine if each edge in the mesh (V,F) is Delaunay.
15051505
### is_edge_manifold
15061506
**`is_edge_manifold(f: array) -> bool`**
15071507

1508-
See is_edge_manifold for the documentation.
1508+
Check if the mesh is edge-manifold (every edge is incident one one face (boundary) or two oppositely oriented faces).
1509+
1510+
| | |
1511+
|-|-|
1512+
|Parameters| F: \#F by 3 list of triangle indices |
1513+
|Returns| True iff all edges are manifold |
1514+
1515+
### is_vertex_manifold
1516+
**`is_vertex_manifold(f: array) -> bool`**
1517+
1518+
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).
1519+
1520+
| | |
1521+
|-|-|
1522+
|Parameters| F \#F by 3 list of triangle indices |
1523+
|Returns| B \#V list indicate whether each vertex is locally manifold.<br>The mesh is vertex manifold if `all(B) == True`. |
1524+
15091525
### is_intrinsic_delaunay
15101526
**`is_intrinsic_delaunay(l: array, f: array)`**
15111527

0 commit comments

Comments
 (0)