Add swept_volume binding, bump libigl to f378129 - #311
Merged
Conversation
Bump the pinned libigl to f378129b334f374116242537701ffe379a53d50d and add a Python binding for igl::swept_volume. Upstream's API changed: swept_volume now takes a list of rigid transforms and a SignedDistanceType rather than a transform(t) callback and a step count. The binding follows the new signature, accepting either an (n,4,4) array or a list of 4x4 / 3x4 matrices (3x4 is padded with 0,0,0,1). This sidesteps the callback-binding issue that left dual_contouring commented out (#194). Bump the dev version to 2.6.3.dev5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both take the same list-of-transforms argument as swept_volume, so factor that parsing out into pyigl::parse_transforms in include/parse_transforms.h. swept_volume_bounding_box returns the box as a (min_corner, max_corner) pair of 3-vectors. swept_volume_signed_distance exposes both overloads: S0 defaults to empty, in which case the no-S0 overload is used. isolevel defaults to infinity, matching the header's note that this gives good values everywhere. Add an include guard to default_types.h, which previously could not be included twice in one translation unit. Tests check that chaining swept_volume_bounding_box -> voxel_grid -> swept_volume_signed_distance -> marching_cubes reproduces swept_volume exactly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Exposed as a second voxel_grid overload taking min_corner and max_corner
3-vectors, which is exactly what swept_volume_bounding_box returns:
GV,res = igl.voxel_grid(*igl.swept_volume_bounding_box(V,T),s=s,pad_count=pad)
The swept_volume_signed_distance test now uses it instead of round-tripping the
two corners through the point-based overload.
Co-Authored-By: Claude Opus 5 <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.
Summary
f378129b334f374116242537701ffe379a53d50d.igl::swept_volume(src/swept_volume.cpp).2.6.3.dev5.Note on the API
Upstream's
swept_volumesignature changed at this commit. It no longer takes atransform(t)callback plus astepscount; it now takes a list of rigid transforms and aSignedDistanceType:The binding follows the new signature:
transformsaccepts either an(n,4,4)float64 array or a list of4x4/3x4matrices (a3x4is padded with0,0,0,1).RuntimeErroron an empty list or a wrongly-shaped transform.(SV: float64 #SV by 3, SF: int64 #SF by 3).Exposing the list-of-transforms API rather than wrapping a Python
transform(t)callback also sidesteps the callback-binding problem that leftdual_contouringcommented out (#194).Testing
test_swept_volumeadded totests/test_all.py: covers shapes/dtypes, that the result spans the motion,(n,4,4)vs. list-of-3x4equivalence, isolevel dilation, and both error paths.🤖 Generated with Claude Code