Skip to content

Add swept_volume binding, bump libigl to f378129 - #311

Merged
alecjacobson merged 4 commits into
mainfrom
swept-volume-binding
Aug 23, 2026
Merged

Add swept_volume binding, bump libigl to f378129#311
alecjacobson merged 4 commits into
mainfrom
swept-volume-binding

Conversation

@alecjacobson

Copy link
Copy Markdown
Contributor

Summary

  • Bumps the pinned libigl to f378129b334f374116242537701ffe379a53d50d.
  • Adds a Python binding for igl::swept_volume (src/swept_volume.cpp).
  • Bumps the dev version to 2.6.3.dev5.

Note on the API

Upstream's swept_volume signature changed at this commit. It no longer takes a transform(t) callback plus a steps count; it now takes a list of rigid transforms and a SignedDistanceType:

igl::swept_volume(V, F, transforms, sign_type, grid_res, isolevel, SV, SF);

The binding follows the new signature:

SV, SF = igl.swept_volume(V, F, transforms,
                          sign_type=igl.SIGNED_DISTANCE_TYPE_FAST_WINDING_NUMBER,
                          grid_res=50, isolevel=0.0)
  • transforms accepts either an (n,4,4) float64 array or a list of 4x4 / 3x4 matrices (a 3x4 is padded with 0,0,0,1).
  • Raises RuntimeError on an empty list or a wrongly-shaped transform.
  • Returns (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 left dual_contouring commented out (#194).

Testing

  • test_swept_volume added to tests/test_all.py: covers shapes/dtypes, that the result spans the motion, (n,4,4) vs. list-of-3x4 equivalence, isolevel dilation, and both error paths.
  • Full suite passes against the bumped libigl: 99 passed.

🤖 Generated with Claude Code

alecjacobson and others added 4 commits August 21, 2026 21:19
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>
@alecjacobson
alecjacobson merged commit 37971f3 into main Aug 23, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant