feat(bsc-cad): sketch->extrude/revolve, shell/pattern/fillet ops - #4003
Open
kevinthelago wants to merge 1 commit into
Open
feat(bsc-cad): sketch->extrude/revolve, shell/pattern/fillet ops#4003kevinthelago wants to merge 1 commit into
kevinthelago wants to merge 1 commit into
Conversation
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
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.
Summary
sketch.rs(2D closed-polygon signed distance),Node::Extrude{profile,height},Node::Revolve{profile}(full 360° about Z, with a dedicatedrevolve_profile_sdfthat 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).Node::Shell{thickness,node}(hollow, outer surface fixed),Node::LinearPattern/Node::RadialPattern(finite array/circular repetition),Node::Fillet{r,node}(iq'sopRound— dilates a single solid's own convex edges byr; documented as distinct fromsmooth_union, which blends the seam between separate solids).GRID_JITTERinmesh.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.rsmeshes everyexamples/*.jsonspec as a schema/sanity regression; 5 new example specs added (bushing, l-plate, shelled-box, bolt-pattern, rounded-block).Test plan
cargo test -p bsc-cad— 71 unit tests + 1 integration test, all greencargo clippy -p bsc-cad --all-targets -- -D warnings— cleansharp_features_survive_on_non_grid_aligned_geometry/a_rounded_corner_shrinks_the_part_and_dual_contouring_does_notprecision tests still pass after the grid-jitter changeCloses #3425
Closes #3426
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01EsUdGgNX7QTqyF1xDW6Du9