Repository navigation
Fix tessellation of punctured torus faces - #21
Merged
Merged
Conversation
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>
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.


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
TorusPuncturedface chart: full parameter rectangle with physical trims as holes, using pairedtorus_cutvalues on both axes instead of failing or picking the wrong complement.cut_periodicfor 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 treatTorusPuncturedlike existing strip charts where appropriate.Adds regression test
torus_contractible_trim_selects_patch_or_punctured_domainfor 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.