Align examples/demo.py with supported geometry semantics (convex, composed holes, convex-cell partitions) - #7
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix demo examples for mathematical consistency
Align Jul 16, 2026
examples/demo.py with supported geometry semantics (convex, composed holes, convex-cell partitions)
QL-UoHull
marked this pull request as ready for review
July 16, 2026 15:54
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the example/demo materials with the actual imp_spline_2d semantics (convex-first; concave/freeform shown via explicit composition; partitions shown as convex-cell aggregates) so the visuals don’t imply unsupported single-polygon concave behavior or partition-of-unity properties.
Changes:
- Restructures
examples/demo.pyto remove the single concave polygon section and replace it with composed fields (convex components, explicit holes composition, convex-cell partition grid + aggregate view). - Updates
partition_basis_surfaceswording/titles to explicitly describe aggregate unnormalized sums. - Updates
examples/README.mdto match the corrected semantics and terminology.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| python/implicit_spline/visualization.py | Updates partition_basis_surfaces doc/title to clarify “partition net” + “unnormalized sum” semantics. |
| examples/README.md | Updates example section descriptions to remove concave/single-polygon implications and clarify composed/partition semantics. |
| examples/demo.py | Reworks demo sections: composed freeform-like field from convex parts, explicit hole composition, and convex-cell partition + aggregate views. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ax7b = fig7.add_subplot(1, 2, 2, projection='3d') | ||
| cf7 = ax7a.contourf(X7, Y7, Z7, levels=20, cmap='viridis') | ||
| plt.colorbar(cf7, ax=ax7a) | ||
| ax7a.contour(X7, Y7, Z7, levels=[0.5, 1.0], colors=['white', 'black'], linewidths=[2.0, 1.0]) |
| ax13b = fig13.add_subplot(1, 2, 2, projection='3d') | ||
| cf13 = ax13a.contourf(Xc, Yc, Zc, levels=20, cmap='viridis') | ||
| plt.colorbar(cf13, ax=ax13a) | ||
| ax13a.contour(Xc, Yc, Zc, levels=[0.5, 1.0], colors=['white', 'black'], linewidths=[2.0, 1.0]) |
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.
The merged demo visuals were rich but semantically misleading in two places: single concave/freeform polygon support and the 2D partition implementation. This PR reshapes those sections so the examples match the current
imp_spline_2dcontract while preserving paper-style figures.Convex-first demo structure
deltasweeps, smoothness (n) comparisons, multi-panel contour evolution).Concave/freeform correction
Polygons with holes (explicit composition)
2D partition correction
Docs/helper wording updates
examples/README.mdandpartition_basis_surfaceswording/title to match the corrected semantics.