Add DegenerateToroidalSurface support and CDT edge preprocessing#1
Draft
Add DegenerateToroidalSurface support and CDT edge preprocessing#1
Conversation
- Handle DegenerateToroidalSurface (minor_radius >= major_radius) by treating it as a regular torus surface for tessellation - Add point deduplication pass to snap nearly-coincident 2D points before CDT, preventing phantom edge crossings from numerical noise - Add T-intersection detection: split constrained edges when a boundary vertex lies very close to (but not at the endpoint of) another edge - Increase crossing resolution iteration limit from 100 to 200 - Use tighter denom threshold (1e-15) in segment intersection test Fixes 5 additional components: XT30PW-F, SRP5030CA-4R7M, SRP6050CA-4R3M, KEY-SMD_4P, 693072010801 (partially). Test suite: 85/92 → 90/92. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| } | ||
|
|
||
| // Remove degenerate edges (where src == dst after remapping) | ||
| edges.retain(|e| e.0 != e.1); |
There was a problem hiding this comment.
Dedup can collapse into duplicate constraints
High Severity
After remapping close points, edges only removes self-loops. Distinct edges can collapse to the same undirected pair (including reversed order), leaving duplicate constrained edges that change CDT boundary parity and can misclassify interior/exterior regions.
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.


Summary
DegenerateToroidalSurfaceas a torus variant inget_surface()— this STEP entity was unhandled, causingUnknownSurfaceTypeerrors on component 693072010801resolve_crossing_edges():dedup_close_points): snap nearly-coincident 2D boundary points to prevent phantom crossings from surface lowering numerical noisepoint_near_segment): split constrained edges when a boundary vertex lies within ε of a non-adjacent edge, preventingCrossingFixedEdgefrom CDT exact predicatesThese fixes address
CrossingFixedEdgeerrors on 4 components (XT30PW-F, SRP5030CA-4R7M, SRP6050CA-4R3M, KEY-SMD_4P) and theUnknownSurfaceTypeerror on 693072010801.Batch test improvement: 85/92 → 90/92 (92.4% → 97.8%)
Test plan
cargo testpasses🤖 Generated with Claude Code
Note
Medium Risk
Medium risk: changes affect geometric preprocessing and constrained triangulation inputs, which can alter tessellation output and performance or introduce edge-case failures on complex faces.
Overview
Adds support for STEP
DegenerateToroidalSurfaceby treating it as a torus inget_surface(), avoidingUnknownSurfaceTypeerrors.Hardens CDT input generation in
resolve_crossing_edges()by deduplicating nearly-coincident boundary points, tightening/adjusting intersection tolerances, and adding a second pass to split edges on near vertex-on-edge (T) intersections, in addition to existing edge-edge crossing splits.Written by Cursor Bugbot for commit 1b131cb. This will update automatically on new commits. Configure here.