Skip to content

Align examples/demo.py with supported geometry semantics (convex, composed holes, convex-cell partitions) - #7

Merged
QL-UoHull merged 2 commits into
mainfrom
copilot/fix-demo-changes
Jul 16, 2026
Merged

QL-UoHull merged 2 commits into
mainfrom
copilot/fix-demo-changes

Conversation

Copilot AI commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

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_2d contract while preserving paper-style figures.

  • Convex-first demo structure

    • Keeps strong convex examples (single polygons, delta sweeps, smoothness (n) comparisons, multi-panel contour evolution).
    • Retains paper-style presentation while making convex behavior the explicit baseline.
  • Concave/freeform correction

    • Removes the misleading single-concave-polygon section.
    • Replaces it with a clearly labeled composed field built from multiple convex components.
  • Polygons with holes (explicit composition)

    • Keeps hole examples but labels them as composed implicit fields.
    • Uses convex outer/inner loops and consistent terminology to avoid implying unsupported single-polygon concave handling.
  • 2D partition correction

    • Replaces loose multi-polygon composition with a valid convex-cell partition (grid cells).
    • Shows both per-cell field behavior and an aggregate view, explicitly labeled as an unnormalized sum (no partition-of-unity claim).
  • Docs/helper wording updates

    • Updates examples/README.md and partition_basis_surfaces wording/title to match the corrected semantics.
# Hole example now shown as explicit composition:
Z = imp_spline_2d(X, Y, outer_loop, delta=d, n=2)
for hole in holes:
    Z *= (1.0 - imp_spline_2d(X, Y, hole, delta=d, n=2))
Z = np.clip(Z, 0.0, 1.0)

Copilot AI changed the title [WIP] Fix demo examples for mathematical consistency Align examples/demo.py with supported geometry semantics (convex, composed holes, convex-cell partitions) Jul 16, 2026
Copilot AI requested a review from QL-UoHull July 16, 2026 15:51
@QL-UoHull
QL-UoHull marked this pull request as ready for review July 16, 2026 15:54
Copilot AI review requested due to automatic review settings July 16, 2026 15:54
@QL-UoHull
QL-UoHull merged commit b7bd340 into main Jul 16, 2026
1 check passed
@QL-UoHull
QL-UoHull deleted the copilot/fix-demo-changes branch July 16, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to 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_surfaces wording/titles to explicitly describe aggregate unnormalized sums.
  • Updates examples/README.md to 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.

Comment thread examples/demo.py
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])
Comment thread examples/demo.py
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])
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.

3 participants