Repository navigation
Fix slow RedPitaya model and failed faces in corpus STEP models (ENG-3756) - #23
Merged
akhilles merged 5 commits intoOct 10, 2026
Conversation
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>
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.


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.