Skip to content

Commit c3a8ce4

Browse files
authoredMar 12, 2025
Merge pull request #256 from zfergus/main
Add binding for is_vertex_manifold
2 parents 48699d6 + e4bcbb8 commit c3a8ce4

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed
 

‎src/is_vertex_manifold.cpp

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

‎tutorial/igl_docs.md

+17-1
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)