Repository navigation
Fillet: classify collapsed torus offsets in ball_zone_state so equal-radius corner balls build - #26026
Fillet: classify collapsed torus offsets in ball_zone_state so equal-radius corner balls build#26026nullifyr wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…-labs#17379) When a constant-radius round runs along a tangent chain over an earlier torus round's end curves of the same radius (such as tangency-labs#17379: a 40 mm sphere cut flat at z = 10 and x = -17.08, R1 fillet on the side flat's circular edge, then R1 fillet on the z = 10 tangent chain), the torus's inward offset collapses onto its tube's centre circle (QuadricKind::Circle). offset_collapses_by_definition already recognised QuadricKind::Circle and flagged the edge BallCheck::Collapsed, and classify_ball_on_collapsed_offset plus calc_ball_triangle_fillet_geom (tangency-labs#2403) already built the corner ball triangle for QuadricKind::Circle. However, ball_zone_state and fixed_centre in solidcore-blend/src/blend/fillet_exact.rs only handled QuadricKind::Line and QuadricKind::Point, so ball_zone_state returned Unclassified and refuse_irregular_balls rejected the edge with unsized NoRoom before tangency-labs#2403 could run. Handle QuadricKind::Circle in ball_zone_state (using face.tube as the collapsed torus radius and checking circle-vs-end-plane closure at open ends) and in fixed_centre (closed-form circle-plane crossing, delegating other quadrics to solidcore_kernel::blend::fillet_exact::class::curve_crosses_quadric). Regression tests: - fixed_centre_handles_collapsed_torus_circle in solidcore-blend fillet_exact - sphere_cut_flats_chain_over_torus_end_curves_builds_corner_balls in solidcore tests/issue_2403_chain_over_end_curve.rs Fixes tangency-labs#17379 Co-Authored-By: Gemini 4 Neon <noreply@google.com>
…tate so equal-radius corner balls build
Fixes #17379
Changes a default: no
What failed
On a 40 mm sphere cut flat at
z = 10andx = -17.08, applying an R1 fillet to the side flat's circular rim (Fillet1) creates an R1 torus whose end curves run tangentially into the short straight edge (x = -17.08, z = 10) and thez = 10sphere rim. Applying a second R1 fillet to thatz = 10closed tangent chain failed onmainwith unsizedNoRoom:(Meanwhile R0.9 on the same chain built cleanly in 577 ms.)
Why
At R1, the earlier R1 torus's inward offset collapses onto its tube's centre circle (
QuadricKind::Circle).offset_collapses_by_definition(solidcore-blend/src/blend/fillet_exact.rs:978) already recognisedQuadricKind::Line | Point | Circle, soball_regular.rsflagged the torus end curves asBallCheck::Collapsed.classify_ball_on_collapsed_offsetandcalc_ball_triangle_fillet_geom(#2403) already supportQuadricKind::Circleto build the exact corner ball triangle.ball_zone_state(fillet_exact.rs:680) andfixed_centre(fillet_exact.rs:794) only handledQuadricKind::LineandQuadricKind::Point, omittingQuadricKind::Circle. As a result,ball_zone_statereturnedCollapsedBallZone::Unclassified, andrefuse_irregular_ballsrefused the edge with unsizedNoRoombefore#2403could build the corner balls.The fix
curve_crosses_quadricfromsolidcore_kernel::blend::fillet_exact::class(single implementation, no duplicate solver).ball_zone_stateinsolidcore-blend/src/blend/fillet_exact.rsto handleQuadricKind::Circle:face.tube(the torus's tube radius, not major radius) asface_radius;v);CollapsedBallZone::ClosedPointBallwhen both ends close onto a fixed centre.fixed_centreto handleQuadricKind::Circle(exact closed-form circle-plane crossing, delegating non-planar quadrics tocurve_crosses_quadric).fixed_centre_handles_collapsed_torus_circleinsolidcore-blend/src/blend/fillet_exact.rssphere_cut_flats_chain_over_torus_end_curves_builds_corner_ballsinsolidcore/crates/solidcore/tests/issue_2403_chain_over_end_curve.rsExpected vs measured
C = (-16.08, ±sqrt(19² − 16.08² − 9²), 9), 1 cylinder, 4 tori/revolved faces), symmetric (center_of_mass.y = 0).#17379repro,--validation each_feature):volume = 27756.897289 mm³, matches all-at-once within< 1e-8relative;faces = 10(plane: 2,sphere: 3,cylinder: 1,other: 4),closed = true,center_of_mass.y = 1.36e-15;<= 1e-9(1.85e-13measured on-y), contact vertices within2e-5(twice the 40 mm body's~1e-5curve tolerance), G1 normal agreement2.41e-5 rad(<= 1e-4),check_brep(Level2)0 failures.Tests run
cargo fmt --manifest-path solidcore/Cargo.toml --all --check: passcargo clippy --manifest-path solidcore/Cargo.toml -p solidcore-kernel -p solidcore-blend -p solidcore --tests -- -D warnings: passcargo check --manifest-path solidcore/Cargo.toml -p solidcore --target wasm32-unknown-unknown: passcargo test --manifest-path solidcore/Cargo.toml --profile goldens -p solidcore-blend --lib -- fillet_exact: 20 passed, 0 failedcargo test --manifest-path solidcore/Cargo.toml --profile goldens -p solidcore --test blend -- issue_2403_chain_over_end_curve: 14 passed, 0 failedcargo test --manifest-path solidcore/Cargo.toml --profile goldens -p solidcore --test blend -- issue_2364_round_ending_in_an_earlier_round: 2 passed, 0 failedcargo test --profile ci -p solidcraft-kernel --lib -- blend::corner_tests::rounds_meeting: 2 passed, 0 failedpython3 solidcore/scripts/ci/check_panic_sites.py: passsolidcraft-cli run 17379.json --results --validation each_feature: pass (0 errors, 0 warnings)Before and after
Rendered headlessly with
solidcraft-cli snapshotat 1280×720 from the same public example script.Before (main at
f5e1bfc58c): the model failed with:error: step 5 (solid.fillet): not supported yet: the fillet is larger than the faces beside its edges allow (tangent propagation blended the picked edges' tangent chain with them; with it off, tangent_chain: false, only the picked edges are blended)After (this branch at
8eb6429f0f).Summary by CodeRabbit