Add narrow cylinder lowering and boundary PointOnFixedEdge recovery#2
Add narrow cylinder lowering and boundary PointOnFixedEdge recovery#2lucia3e8 wants to merge 1 commit intofix/degenerate-toroidal-surfacefrom
Conversation
…covery
- Detect cylinder faces with <30 degree angular span ("narrow") and use
theta-z lowering instead of scaled-XY, which degenerates for thin strips
- Add recovery for PointOnFixedEdge on boundary points: find and split the
offending edge at the boundary point, then retry CDT
- Clone edges into catch_unwind closure to allow mutation during retries
Does not yet fix FH12-22S (HalfEdgeInvariant + collinear boundary) or
CONN-SMD_2309413-1 (WedgeEscape on complex multi-contour geometry).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
| // projection degenerates (points become nearly collinear). | ||
| // Switch to theta-z lowering which works well for narrow strips. | ||
| let angular_span = angle_max - angle_min; | ||
| *narrow = angular_span < PI / 6.0; |
There was a problem hiding this comment.
Angular span calculation ignores atan2 wraparound at ±π
Medium Severity
The angular_span calculation uses angle_max - angle_min from raw atan2 values, which doesn't account for the discontinuity at ±π. atan2 returns values in (-π, π], so a narrow face positioned diametrically opposite the cylinder's ref_direction (near angle ±π) would have some vertices with angles just below π and others just above -π. This yields angular_span ≈ 2π instead of the true small span, causing narrow to be false when it needs to be true. The face then uses the degenerate scaled-XY projection — exactly the failure this PR aims to fix.


Summary
(θ, z)coordinates instead of the default XY projection. The default projection collapses narrow cylinders to near-zero width, causing CDT failures.PointOnFixedEdgerecovery: when the CDT reports a boundary point lying on a constrained edge, find that edge and split it at the point, then retry. Previously only Steiner points had recovery (reassign to pts[0]); boundary points caused immediate failure.These fixes address the
PointOnFixedEdgeandHalfEdgeInvarianterrors that appeared on component FH12-22S-0.5SH_55 after the previous CDT preprocessing changes.Batch test: 90/92 maintained (no regression, prepares for next fix)
Test plan
cargo testpasses🤖 Generated with Claude Code
Note
Medium Risk
Touches core surface lowering and CDT error-recovery logic; while changes are targeted, they can affect mesh topology/quality and retry behavior on tricky geometry.
Overview
Adds a narrow-cylinder path for
Surface::Cylinderthat detects small angular spans duringprepare()and lowers points using(theta, z)instead of the existing scaled-XY projection to avoid near-collinear 2D inputs.Extends CDT retry handling in
advanced_facesoPointOnFixedEdgeon boundary points triggers constrained-edge splitting (with a scale-relativesnap_epsand a relaxed fallback), rather than failing immediately; Steiner-point recovery remains as point deduping.Written by Cursor Bugbot for commit 4918813. This will update automatically on new commits. Configure here.