Repository navigation
Conversation
…gh the flat round trip (failing test) A cubic 7e-7 off its 0.89 mm chord (SolidCraft #11394), closed by three lines and extruded 10 up, gets a cylinder wall of radius 217 m. smlib_brep_import rebuilds it outside SMLib's check (SmSurfOfRevolution test tangency-labs#10, offset 5.2e-4).
…self, not as a cylinder CreateLinearSweep and CreateLinearSweepSimple made any curve that IsArc to ArcZero a cylinder wall, so a spline 7e-7 off its 0.89 mm chord became a cylinder of radius 217 m (sweep 4.1e-6 rad, over IsArc's 1e-6 floor). A cylinder that flat is not rebuilt from its NURB to its check's zero after the flat round trip. Both sweeps now ask IsSweptArc: an arc to ArcZero that is not straight to dTol. (SolidCraft #11394)
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.
🤖 on behalf of 👤; (not yet proofread)
The SMLib half of tangency-labs/solidcraft#11394: a spline 7e-7 mm off its 0.89 mm chord, extruded, got a cylinder wall of radius 216 985.56 mm, and every boolean with the body was refused.
Summary
IsArc's only flatness floor, 1e-6 rad (SmCurve.cpp:13580), so its wall became anSmCylinderof radius 216 985.56 mm. That body passes the check.smlib_brep_importrebuilds an analytic face from its NURB (smlib_flat.cpp:3210→AnalyticOfNurbs→SmCylinder::IsNurbSurfaceCylinder). It fits three-point circles to the bottom and top iso curves and takes the axis through their centres. For an arc this flat the centres are off by about eps·|p|·(r/chord)², so SmSurfOfRevolution test Fillet: rounds reaching past their faces — overlapping bands too large, rails past a side edge's end #10 fails by 5.19e-4 against 7.0e-9.The fix
SmPrimitiveCreation.cppnow askIsSweptArc: is the curve an arc toArcZero, and not straight to the body's tolerancedTol? A curve withindTolof its chord lies on a circle only through a bulge below the tolerance. Such a curve is now swept as itself, anSmSurfOfExtrusion, like any other spline. An arc that bulges more thandTolkeeps its cylinder.capi/tests/sweeps.cpp, "extrude a near-straight spline, round trip" extrudes the #11394 profile 10 up and requires no cylinder face. It then imports the flat arrays and checks the body: valid, manifold, volume. It is its own commit, failing on main.CHANGELOG.mdentry under[Unreleased]→ Fixed.Evidence
The build was capi CMake Release with
-DSMLIB_STRICT_WARNINGS=ON, on x86_64 Linux, GCC 14.2. GCC 14 also needs-Wno-template-id-cdtor, because it flags the existingSmHealProbArray.h:302, a warning CI's GCC 13 does not have.smlib_test_sweepsexits 1.The issue's scripts. These ran on SolidCraft
develop(f3b507c05), with SMLib built from source throughSOLIDCRAFT_SMLIB_DIR: base fffc8f1, fix 5b6a573.f2: the spline profile, extruded 10, joined to a boxsolid.combinerefused: test #10, offset 5.1897691e-4f2_round: a spline on a circle of radius 135 000f2_line: the chord instead of the splineFlat round trip in C++ alone (export, import, check, union with a box), on the same two builds:
SmCircle)SmCircle)SolidCraft's own suites, base and fix:
cargo xtask kernel-cases, 1017 cases) gives 981 pass, 22 fail and 14 unsupported on both. No case changed status or any measured value.cargo test -p solidcraft-kernel --features smlib: the lib tests give 787 passed and 16 failed on both, the same 16, all of them intests/KNOWN_FAILING_TESTS.boolean_props::edge_only_box_join_is_refused_in_both_ordersandboolean_props::translation_invariant(a sphere's control net). They are not in the list, nothing in them sweeps a near-straight curve, and they fail the same way on the base build. I have not looked into them.Merge Danger
Door: two-way
Revert the commit and these walls are cylinders again. No file format or API changes.
Blast Radius: narrow
IsArc, changes. Its wall goes from anSmCylinderto the curve's own extrusion. That includes an exact arc this flat, such as radius 233 366 over 0.89 mm, whose sagitta is 4e-7.Not changed here. An arc that bulges more than the tolerance but is still flat, such as radius 3 316 over 0.89 mm, keeps its cylinder. Such a cylinder still fails the check after a flat round trip, because the import rebuilds its frame from the NURB. The exact frame is already in the arrays: the export writes the face's origin, axis, reference direction and radius. Taking those on import, and only the parametrisation from the NURB, would close it. That reverses the import's choice to pass over the canonical entry, so it is left to you.