Skip to content

Add bindings for igl::lazy_cage and core igl::progressive_hulls - #318

Open
alecjacobson wants to merge 2 commits into
mainfrom
add-lazy-cage-progressive-hulls
Open

Add bindings for igl::lazy_cage and core igl::progressive_hulls#318
alecjacobson wants to merge 2 commits into
mainfrom
add-lazy-cage-progressive-hulls

Conversation

@alecjacobson

@alecjacobson alecjacobson commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Adds Python bindings for two libigl functions.

libigl bump

Bumps libigl to main (c07f8586), which has igl::lazy_cage and — via now-merged libigl PR #2558 — core igl::progressive_hulls (moved out of copyleft, dropping igl::copyleft::quadprog for igl::project_to_halfspace_intersection). Both are pure-core (no CGAL).

New bindings

  • progressive_hulls(V, F, max_m, block_intersections=False)(success, U, G, J) — nested, enclosing coarsening of a closed manifold mesh ("progressive hulls", Sander et al. 2000), with the intersection-blocking variant behind a flag.
  • lazy_cage(V, F, num_faces, grid_size=0)(success, CV, CF, sigma) — offset-and-decimate a closed mesh into an enclosing, self-intersection-free cage with exactly num_faces faces. Plus:
    • a full overload exposing max_sigma, num_iters, use_qslim, metric, grid_mode, distance;
    • the LazyCageMetric / LazyCageGridMode / LazyCageDistance enums;
    • the lazy_cage_default_grid_size(num_faces) helper.

Both functions use concrete Eigen::MatrixXi (int32) in/out, which the wrappers cast to/from the int64 binding types.

Tests

test_progressive_hulls (coarsen an upsampled icosahedron to 40 faces; check enclosure + index validity) and test_lazy_cage (simple + full overloads on an icosahedron, num_faces=50, grid_size=32, checks success, exact face count, enclosure; smoke-tests the helper + enums). Rebuilt against merged libigl main; both pass.

🤖 Generated with Claude Code

Bump libigl to main (c07f8586), which now has igl::lazy_cage and — via libigl
PR #2558 — core igl::progressive_hulls (moved out of copyleft, dropping the
quadprog dependency). Both are pure-core (no CGAL).

New bindings:
- progressive_hulls(V, F, max_m, block_intersections=False) -> (success, U, G, J):
  nested enclosing coarsening of a closed manifold via "progressive hulls".
- lazy_cage(V, F, num_faces, grid_size=0) -> (success, CV, CF, sigma): offset +
  decimate a closed mesh to an enclosing, self-intersection-free cage. Plus a
  full overload exposing max_sigma / num_iters / use_qslim / metric / grid_mode /
  distance, the LazyCageMetric / LazyCageGridMode / LazyCageDistance enums, and
  the lazy_cage_default_grid_size helper.

Concrete Eigen::MatrixXi (int32) in/out are cast to/from the int64 binding types.
Adds call tests for both. Full suite passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alecjacobson
alecjacobson force-pushed the add-lazy-cage-progressive-hulls branch from d4c405f to 9fbc387 Compare September 1, 2026 17:52
@alecjacobson
alecjacobson changed the base branch from fix-wheels-arch-matrix to main September 1, 2026 17:52
libigl PR #2558 moved progressive_hulls from igl::copyleft to core, deleting
igl/copyleft/progressive_hulls.h. The pre-existing src/copyleft/progressive_hulls.cpp
binding still included that header, so the copyleft module failed to compile on
every platform in CI (the core-only local build missed it). Remove that stale
binding — the new core src/progressive_hulls.cpp replaces it as igl.progressive_hulls
— and drop the igl.copyleft.progressive_hulls call from test_copyleft (covered by
test_progressive_hulls).

Bump version 2.6.4.dev0 -> 2.6.4.dev1 so merging publishes these bindings to PyPI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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