Skip to content

Fix slow RedPitaya model and failed faces in corpus STEP models (ENG-3756) - #23

Merged
akhilles merged 5 commits into
masterfrom
akhil/eng-3756-foxtrot-slow-and-partially-tessellated-corpus-step-models
Oct 10, 2026
Merged

akhilles merged 5 commits into
masterfrom
akhil/eng-3756-foxtrot-slow-and-partially-tessellated-corpus-step-models

Conversation

@akhilles

Copy link
Copy Markdown

This change fixes four root causes of slow or partial tessellation in DiodeHub corpus STEP models. Foxtrot now uses unit, orthogonal placement axes, follows the edge sense across the ends of an open curve that closes, takes the periodic coordinate of a spline pole from its boundary, and joins edge vertices that project to one curve point. It also rejects cylinder faces that extend to infinity before refinement, so RedPitaya tessellates in 0.4 s instead of more than 300 s and PAG7936 in 0.7 s instead of 30 s.

Fixes ENG-3756.

akhilles and others added 5 commits October 10, 2026 01:15
RedPitaya_3Dmodel.stp took more than 300 s. Its circle placements have
reference directions of length 0.1 to 1000. STEP directions are only
ratios, but circles used the raw ref_direction as their radius vector, so
a circle of radius 0.1 was sampled at radius 0.01, far off its cylinder,
and refinement towards those edges created up to 230,000 triangles per
face. Build the placement axes as build_axes does when the stored axes
are not unit and orthogonal to print precision, and keep them as written
otherwise.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1232c-6493-777f-b5ab-495ad15f1cfb
Co-authored-by: Amp <amp@ampcode.com>
Two RedPitaya faces use edges on B-splines that are flagged open but whose
ends meet. The edges start at the curve start and run against the curve's
sense, which an open curve cannot do, so they were sampled along the rest
of the curve: 278 degrees instead of 82, and each face boundary wound once
around its cylinder. When the ends meet within the chord budget, let the
sense select the arc across them, as for a closed curve.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1232c-6493-777f-b5ab-495ad15f1cfb
Co-authored-by: Amp <amp@ampcode.com>
PAG7936 spent 30 of its 33 s on face #11363. The exporter split one thread
band into two faces on identical cylinders: #11363 holds only the helix
loop and #11516 only the circle loop, so each face winds once around its
cylinder and is unbounded along the axis. The cylinder chart maps infinite
height to its origin, and refinement chased it to the one million point
limit. Reject a cylinder boundary that winds around the origin an odd
number of times before the CDT.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1232c-6493-777f-b5ab-495ad15f1cfb
Co-authored-by: Amp <amp@ampcode.com>
BSS138BKT-TP face #148 is a spherical triangle with a corner at the pole
of a closed rational B-spline sphere. Every periodic coordinate is valid
at a pole, and the projection put it half a period from the rest of the
face, so cut_periodic unwrapped the two pole edges onto opposite branches
and failed with an unpaired periodic trim. Place a pole between its
contour neighbours before cutting the periodic chart.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1232c-6493-777f-b5ab-495ad15f1cfb
Co-authored-by: Amp <amp@ampcode.com>
ASP-184330-01 has corrupt hub vertices shared by edges whose curves end up
to 3 mm away from them. Edge #1051488's end vertex lies behind the start
of its curve, so both vertices projected to the curve start, the sampled
range was empty and two faces failed. Join the vertices with a chord, as
attach_endpoints already does for every other vertex offset. Its four
remaining failed faces are bounded only by a zero-length line loop at a
hub vertex and carry no recoverable boundary.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1232c-6493-777f-b5ab-495ad15f1cfb
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/kernel change rather than a small fixup, so human review is needed and no reviewers were assigned. Cursor Security Agent passed with no findings; Cursor Bugbot was not present.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles merged commit 9a80a2f into master Oct 10, 2026
4 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