Skip to content

kernel: analytic INTERSECTION silently wrong for cone∩cylinder (16.8 vs ~502 mm³) and torus∩cylinder (returns the whole torus) #895

Description

@ecto

Both come from cells of the vcad-torture fidelity matrix (32 segments) and both report Analytic:

case result truth
Solid::cone(9,3,20) ∩ Solid::cylinder(5,30).translate(7,0,−5) 16.8 mm³ ≈ 502 (z-integral of the two-circle lens)
Solid::torus(10,3) ∩ Solid::cylinder(2,40).rotate(0,90,0).translate(−20,0,0) 1753.8 = the whole torus ≈ 140

The UNIONS of the same pairs were wrong the same way (cone ∪ cylinder read 4788.8 against 4304) and are now caught by the union volume bound / referee added in #890, which is why generic-overlap/cone-cylinder/union and through-cut-breakout/torus-cylinder/union were re-blessed analytic → triangle-soup. Intersections have an equally sound bound that is not enforced yet: vol(A ∩ B) ≤ min(A, B), and vol(A) + vol(B) − vol(A ∪ B) when the union is trusted. The fidelity matrix reports representation only — "0 wrong-geometry" does not check volume; it should.

Found while getting the rana-60-cnc stator to solve (#890). Helpers ring(), post(), fillet_block(side) live in crates/vcad-kernel-booleans/tests/coplanar_cap_union.rs; assert volume against a closed form in any new test — every failure in this family was a plausible mesh of the wrong solid.

🤖 Filed by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkernelRust kernel cratesrobustnessEdge cases / numerical robustness

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions