Add wrapper for vertex_components using adjacency matrix - #285
Conversation
|
Looks good. Would you mind adding a test call? |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Rebased onto current (Written by Claude Code on behalf of @alecjacobson.) |
There was a problem hiding this comment.
Pull request overview
This PR restores the previously removed vertex_components_from_adjacency_matrix Python binding (referenced in the docs) by adding a nanobind wrapper around libigl’s adjacency-matrix overload and adding a regression test to validate the returned component labels and component-size counts.
Changes:
- Add
vertex_components_from_adjacency_matrix(adjacency)binding that returns(c, counts)for a sparse adjacency matrix. - Add a new test that builds a sparse adjacency matrix with two disconnected components and validates
candcounts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/vertex_components.cpp |
Adds the adjacency-matrix wrapper and binds it into the Python module. |
tests/test_all.py |
Adds a regression test for vertex_components_from_adjacency_matrix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| @param[in] F #F by 3 matrix of triangle (face) indices | ||
| @return Vector C of per-vertex connected-component ids)"); | ||
| } | ||
| @param[in] F Matrix of triangle indices | ||
| @return Vector C of component IDs per vertex)"); |
Oops, forgot about this message. Thanks for adding the test for me. |
Restore the
vertex_components_from_adjacency_matrixpreviously removed. This is still referenced in the docs. I have a use for this function, so it would be nice to restore.