fast_winding_number: point-cloud and pre-built tree support (#292) - #307
Open
alecjacobson wants to merge 1 commit into
Open
fast_winding_number: point-cloud and pre-built tree support (#292)#307alecjacobson wants to merge 1 commit into
alecjacobson wants to merge 1 commit into
Conversation
The binding previously only supported the (V,F,Q) triangle-soup one-shot. This adds the rest of libigl's fast_winding_number API so point clouds and reusable acceleration structures are available: - Point-cloud one-shot: fast_winding_number(P, N, A, Q, expansion_order=2, beta=2.0). - Reusable triangle-soup BVH: FastWindingNumberBVH class with init(V, F, order) and winding_number(Q, accuracy_scale) so many query sets reuse one build. - Point-cloud octree precompute: fast_winding_number_precompute(P, N, A, point_indices, CH, order) -> (CM, R, EC), plus a cached-evaluation overload fast_winding_number(P, N, A, point_indices, CH, CM, R, EC, Q, beta). Build the octree with the existing igl.octree(P). Adds test_fast_winding_number covering all four paths on a unit-sphere point set / mesh (inside ~1, outside ~0; cached paths match the one-shots). Full suite: 92 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #292.
The binding only exposed the
(V, F, Q)triangle-soup one-shot. This adds therest of libigl's
fast_winding_numberAPI so point clouds and reusableacceleration structures are supported (enabling full signed-distance workflows
and multiple query sets against one build).
New API
Point-cloud one-shot
Reusable triangle-soup BVH — build once, query many times:
Point-cloud octree precompute — reuse the Taylor expansion across query sets
(builds on the already-bound
igl.octree):The original
igl.fast_winding_number(V, F, Q)is unchanged.Testing
test_fast_winding_numberexercises all four paths on a unit-sphere pointset/mesh: interior queries → ~1, exterior → ~0, and the BVH and cached-octree
results match their one-shot equivalents. Full suite: 92 passed locally.
🤖 Generated with Claude Code