Skip to content

Fix tessellation of punctured torus faces - #21

Merged
LK merged 1 commit into
masterfrom
fix/punctured-torus
Oct 2, 2026
Merged

LK merged 1 commit into
masterfrom
fix/punctured-torus

Conversation

@LK

@LK LK commented Oct 2, 2026 •

Copy link
Copy Markdown

Change

Torus faces with contractible holes have no exterior strip cut, so the existing chart selection rejects them. Add a full parameter-rectangle chart that retains the torus outside its oriented physical trims. Sample artificial seams within the geometric chord budget while preserving existing strip behavior.

Synthetic regression coverage checks small-patch versus punctured-domain area, both trim and face orientations, retraced seams, and seam chord accuracy. Only generic source code and synthetic tests are included; no customer files, model identifiers, screenshots, or diagnostic exports are included.

Verification

  • cargo test --release -p triangulate -p nurbs -p cdt: 136 tests passed.
  • cargo check --manifest-path wasm/Cargo.toml --target wasm32-unknown-unknown: passed.
  • git diff --check: passed.

WASM compilation does not verify a deployed worker. This change has not been deployed.

Amp thread: https://ampcode.com/threads/T-01a0fa35-f6b2-77bc-b55e-434ebf969e32


Note

Medium Risk
Changes torus chart selection and periodic cutting in core tessellation geometry; mistakes could mis-triangulate torus trims, though existing strip behavior is preserved and new tests cover the punctured case.

Overview
Fixes torus face tessellation when trims define contractible holes (no valid exterior strip cut). Chart selection now falls back to a new TorusPunctured face chart: full parameter rectangle with physical trims as holes, using paired torus_cut values on both axes instead of failing or picking the wrong complement.

cut_periodic for punctured charts adds a tolerance-sampled outer rectangle boundary (surface-faithful seams) so CDT keeps the torus exterior rather than filling holes. lower, raise, Steiner placement, and normals treat TorusPunctured like existing strip charts where appropriate.

Adds regression test torus_contractible_trim_selects_patch_or_punctured_domain for small-patch vs almost-full-torus area across trim/face orientations and retraced seams.

Reviewed by Cursor Bugbot for commit 0f0b101. Bugbot is set up for automated code reviews on this repo. Configure here.

Represent torus faces with local holes using a full parameter rectangle when no exterior strip cut exists. Preserve trim orientation and sample artificial seams within the chord budget.

Add synthetic coverage for complementary domains, reversed orientation, retraced seams, and seam chord accuracy.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0fa35-f6b2-77bc-b55e-434ebf969e32
Co-authored-by: Amp <amp@ampcode.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not approved: this is a functional tessellation change, not a small fixup, so human review is required. Cursor Bugbot and Cursor Security Agent completed successfully with no findings that need attention. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@LK
LK merged commit b816efd into master Oct 2, 2026
5 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