Skip to content

Add core ambient_occlusion binding (#282); fix tutorial exact_geodesic call (#284) - #306

Open
alecjacobson wants to merge 1 commit into
mainfrom
fix-282-ambient-occlusion-and-284-geodesic-doc
Open

Add core ambient_occlusion binding (#282); fix tutorial exact_geodesic call (#284)#306
alecjacobson wants to merge 1 commit into
mainfrom
fix-282-ambient-occlusion-and-284-geodesic-doc

Conversation

@alecjacobson

Copy link
Copy Markdown
Contributor

Resolves two issues from the triage.

#282igl.ambient_occlusion missing

ambient_occlusion was only bound in the embree submodule
(igl.embree.ambient_occlusion), so igl.ambient_occlusion(...) raised
AttributeError — and pip wheels built without embree had it nowhere.

libigl ships an embree-free overload in core
(igl::ambient_occlusion(V, F, P, N, num_samples, S), which builds an AABB and
shoots rays with libigl's own intersector). This PR binds it as the core
igl.ambient_occlusion, so it's available in every wheel. The
embree-accelerated variant stays at igl.embree.ambient_occlusion.

Matches the exact call the reporter tried: igl.ambient_occlusion(V, F, P, N, num_samples).
Adds test_ambient_occlusion (convex mesh → outward normals occlude ~nothing;
inward normals become substantially occluded; deterministic).

#284exact_geodesic returns an empty array

The binding was fine; the chapter-1 tutorial was calling the old signature:

d = igl.exact_geodesic(v, f, vs, vt)   # old 4-arg form

The current signature is (V, F, VS, FS, VT, FT), so vt bound to FS and
VT/FT stayed empty → output length #VT + #FT == 0 → empty array. Fixed the
notebook cell to name the arguments:

d = igl.exact_geodesic(v, f, VS=vs, VT=vt)

Testing

Built and ran the full suite locally: 92 passed.

🤖 Generated with Claude Code

…c call (#284)

#282: The ambient_occlusion binding only existed in the embree submodule, so
`igl.ambient_occlusion(...)` raised AttributeError on wheels built without
embree. libigl has an embree-free overload in core (igl::ambient_occlusion(
V, F, P, N, num_samples, S)), so bind it as igl.ambient_occlusion. Now available
in every wheel; the embree-accelerated variant remains at
igl.embree.ambient_occlusion. Adds a test.

#284: The chapter 1 tutorial called `igl.exact_geodesic(v, f, vs, vt)`, but the
current signature is (V, F, VS, FS, VT, FT). The 4th positional arg bound the
target vertices to FS, leaving VT/FT empty, so the result was an empty array.
Fixed the notebook cell to `igl.exact_geodesic(v, f, VS=vs, VT=vt)`. The binding
itself was already correct.

Full suite: 92 passed.

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