Skip to content

feat(bsc-cad): sketch->extrude/revolve, shell/pattern/fillet ops - #4003

Open
kevinthelago wants to merge 1 commit into
developfrom
cad
Open

feat(bsc-cad): sketch->extrude/revolve, shell/pattern/fillet ops#4003
kevinthelago wants to merge 1 commit into
developfrom
cad

Conversation

@kevinthelago

Copy link
Copy Markdown
Owner

Summary

  • bsc-cad: sketch → extrude / revolve — the parametric authoring path #3425 — the sketch parametric authoring path: sketch.rs (2D closed-polygon signed distance), Node::Extrude{profile,height}, Node::Revolve{profile} (full 360° about Z, with a dedicated revolve_profile_sdf that excludes axis-lying profile edges from the nearest-edge distance — a profile edge sitting exactly on the axis sweeps no real surface, so treating it as a boundary reads the axis itself as "on the surface" instead of deep interior).
  • bsc-cad: shell / pattern / fillet ops #3426Node::Shell{thickness,node} (hollow, outer surface fixed), Node::LinearPattern/Node::RadialPattern (finite array/circular repetition), Node::Fillet{r,node} (iq's opRound — dilates a single solid's own convex edges by r; documented as distinct from smooth_union, which blends the seam between separate solids).
  • A general dual-contouring robustness fix (GRID_JITTER in mesh.rs), surfaced while testing revolve with round mm dimensions at a round --res: a grid corner landing exactly on a solid's own flat face gets an ambiguous near-zero sign, which neighboring cells resolved inconsistently and broke watertightness. Verified this does not regress the existing tight sharp-corner precision test.
  • crates/bsc-cad/tests/examples.rs meshes every examples/*.json spec as a schema/sanity regression; 5 new example specs added (bushing, l-plate, shelled-box, bolt-pattern, rounded-block).
  • README + CLI help text updated with the new op-tree vocabulary.

Test plan

  • cargo test -p bsc-cad — 71 unit tests + 1 integration test, all green
  • cargo clippy -p bsc-cad --all-targets -- -D warnings — clean
  • Verified the existing sharp_features_survive_on_non_grid_aligned_geometry / a_rounded_corner_shrinks_the_part_and_dual_contouring_does_not precision tests still pass after the grid-jitter change

Closes #3425
Closes #3426

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01EsUdGgNX7QTqyF1xDW6Du9

Closes #3425, closes #3426.

#3425 - the parametric authoring path: a closed 2D polygon `profile`
(sketch.rs, ray-cast inside test + true nearest-edge distance), plus
Node::Extrude (profile x height, Cylinder's own combinator generalized
to any polygon) and Node::Revolve (full 360 deg about Z). Revolve needs
its own revolve_profile_sdf: a profile edge lying exactly on the axis
(u=0) sweeps out no real surface when revolved, so it's excluded from
the nearest-edge distance while the ordinary crossing test still uses
the full boundary for the sign - otherwise the axis itself reads as
"on the boundary" instead of deep interior.

#3426 - shell (hollow to a wall thickness, outer surface fixed),
linear_pattern/radial_pattern (finite array/circular repetition, plain
unions under the hood), and fillet (iq's opRound: dilate a single
node's own convex edges by r - documented as a distinct operation from
smooth_union, which blends the seam between separate solids instead).

Also fixes a general dual-contouring robustness gap surfaced while
testing revolve with round mm dimensions at a round --res: a grid
corner landing exactly on a solid's own flat face gets an ambiguous
zero-ish sign, which neighboring cells can resolve inconsistently and
break watertightness. GRID_JITTER nudges the sampling grid by a
sub-cell fraction so round-number CAD specs (the common case) don't
hit this - verified not to regress the existing tight sharp-corner
precision test.

New crates/bsc-cad/tests/examples.rs meshes every examples/*.json spec
as a schema/sanity regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsUdGgNX7QTqyF1xDW6Du9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant