Repository navigation
Conversation
cfbf88c to
34b8642
Compare
|
Thanks, keeping faces whose edge vertices sit slightly off their curves, instead of dropping them, is a good fix for imports, and the tests in |
34b8642 to
652db5e
Compare
|
Rebased onto current main. Also checked against the public generated model step/vertices-off-curves: this branch reads 1 surface body with all 16 faces (bbox 0–200 × 0–200 × 0–8); 0.18.1 imports nothing ('face #100: edge vertices are 1.900e-1 mm off their curve'). |
…rves Some exporters write an edge's vertex beside the end of its curve, further off than the accuracy the file declares (a surface export declares 0.01 mm and puts a vertex 0.19 mm off two spline ends). The reader refused such edges and left the face, and with single-face bodies the body, out. A vertex may now sit up to the file's tolerance or 1/1000 of the model's size (the diagonal around its VERTEX_POINTs), whichever is larger, never more than the existing 1 mm ceiling. Spline and open-conic edges have the end control point moved onto the vertex, so every such edge meets its vertices exactly. The file's declared accuracy still governs closed-curve, seam and circle checks.
652db5e to
d0b471d
Compare
|
Thank you, @raykholo, this is a great catch, and the write-up made the problem obvious at a glance. I'm closing this one only because the same fix (snapping an edge's spline ends onto vertices that sit beside its curve, instead of dropping the face) is already in the display and STEP-import work for #2814, which reworks this part of the importer anyway. Your Since you clearly know this area well: we'd love your help in solidcore, the kernel we're evaluating. Porting cases like this one over as tests would be a perfect start. |
|
A correction to my note above: rather than our own version, your commit itself now goes in with the #2814 work, cherry-picked onto current |

Change
Fixes #3351.
Some exporters write an edge's vertex a little beside the end of its curve. A surface export, for example, declares an accuracy of 0.01 mm. It then joins two spline edges whose ends are 0.38 mm apart at a vertex halfway between them, so the vertex is 0.19 mm off each curve. The STEP reader refused such an edge ("edge vertices are 1.903e-1 mm off their curve") and left out the whole face. Where the face was the body's only face, the body was lost too.
mainUNCERTAINTY_MEASURE_WITH_UNIT, at least 1e-3 mm (0.1 mm for the file above)VERTEX_POINTs. It is worked out once per file, inExchange::vertex_extent.Body::size() * 1e-3). Moving a vertex that far changes the shape by less than those meshes already do.docs/step-import.mddescribes the rule.Validation
Two new tests in
crates/kernel/src/step_in/tests.rs:a_vertex_off_its_curve_by_a_small_share_of_the_model_is_moved_onto_it: a 1 m sheet whose spline edge ends 0.19 mm beside its corner. It imports as 1 face of 1e6 mm², and every edge's curve meets its vertices within 1e-9 mm. It fails onmain: the face is left out.a_vertex_further_off_its_curve_than_the_model_allows_leaves_the_face_out: 0.19 mm on a 10 mm sheet is still refused. So is a 2 mm gap on a 1 m sheet whose stray vertex 1 km away makes the model look huge.The kernel's whole suite passes (
--release): 785 unit tests plus the integration tests. After the rebase, the 77 STEP and IGES tests pass again.cargo clippy -p solidcraft-kernel --lib --tests -- -D warningsandcargo fmtare clean.Real files: two STEP exports of a downloaded surface model of a standing figure. They are not attached, because their licence is unknown.
mainImport time is unchanged within noise (13 s to 20 s and 15 s to 16 s on a loaded machine).
Screenshots of the behavior
Reproduction: four 500 mm square sheets in a 2 × 2 grid. The top-right sheet's right edge is a straight spline that ends 0.19 mm beside its corner vertex. The file declares an accuracy of 0.01 mm.
main — the top-right sheet is missing; warning "face #211: edge vertices are 1.900e-1 mm off their curve"
this branch — all four sheets import
Not in this PR
On the same files, one face's mesh reaches 630 mm across a part about 350 mm wide. The model's box then grows from 351 mm to 816 mm in X. That face's boundary curves and all its surface control points lie between x = 161 and 227 mm. The stray triangles are therefore produced by meshing, not by the STEP reader, and this PR does not change them. They look like the far-out boundary parameter in #1400.
Integration status
Rebased onto origin/main: main moved
Reader::item_solidintoparallel.rs, so the snap tolerance is now passed at its new call sites (parallel.rsandconic_tests.rs). The kernel STEP tests pass (74), including both tests from this PR. This PR and #3289 both touchstep_in/mod.rsand its tests, so whichever merges second needs one more rebase.