Skip to content

fix(geom): a flat top pushes down along a round wall - #2341

Open
subydoo-ci[bot] wants to merge 1 commit into
mainfrom
fix/flat-top-push-round-wall
Open

subydoo-ci[bot] wants to merge 1 commit into
mainfrom
fix/flat-top-push-round-wall

Conversation

@subydoo-ci

@subydoo-ci subydoo-ci Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Pushing a flat top down along a round wall on the mesh was refused as "unsafe at mesh storage precision (intersecting faces)". It happened on the top of a cylinder, and on a slot with round ends once its walls had points between the rims.

For users (against main)

  • slicerx_geom_push_pull 1.5.1 pushes the top of a round post or of a slot with round ends down. Before, it was refused.
  • A push down also takes the wall's bulge past the top's outline with it, so no thin flap stands over the new top.
  • A box, a block and a bar pushed down 2 and 3 or pulled 2 give the same reply, byte for byte, as before.

What changed

  • The face's normal comes from one cap triangle, and a kernel's round top is a few ulps off flat, so the normal leaned about 1e-15 off the axis. The cutting prism stepped along it and its walls crossed the body's. The prism now steps along the body's own wall edge where one runs along the normal.
  • The prism's walls follow the chords between rim points, and a wall is often not exactly on them: the kernel leaves points between the rims a few ulps off those planes, or on a round wall's bulge. When all the body has above the new level is the face and its walls, those walls are not exactly on the prism's, and nothing stands more than 0.05 mm outside the outline, the cut is a slab over the whole body from that level up.
  • The 0.05 mm covers twice the kernel's default chord (0.01 mm) with room to spare. The largest gap measured was 5.06e-3 mm (the slot with round ends at a 2.17 and 4 mm side limit); the round post's was 1.0e-4 mm, and every other case was under 1e-14 mm.
  • Pulls, pushes whose walls lie exactly on the outline, and pushes with other parts of the body above the new level use the prism as before.

Testing

  • New tests in packages/geom/src/push.rs: a round post, a slot with round ends and a bar whose tops are a few ulps off flat, with 0, 1 and 3 rows of wall points between the rims, pushed down 2 and pulled 2; a round post pushed down beside a taller one; a plate pushed down around a post standing in its top; a block beside a post just inside and just past the 0.05 mm bound. The first four fail on main.
  • brep_parity gains "push a round top" (a 20 x 10 cylinder down 2), which fails on main. Its push cases also pass with a finer exact tessellation (a 0.5 to 4 mm side limit).
  • packages/mcp/test/array-pieces.test.ts pins slicerx_geom_array at 1.10.1, moved with its bump.
  • The sx-geom lib and every test binary pass with and without brep, and fmt and clippy are clean both ways. The mcp and app suites pass live and in replay against a fresh engine. Typecheck, the web build and the bundle size (shell JS within its 188 KB budget) pass.

Integrators: slicerx_geom_push_pull 1.5.1 answers a push down along a round wall with the pushed part instead of a refusal. slicerx_geom_mirror 1.7.1 and slicerx_geom_array 1.10.1 repeat a push step, and slicerx_design_edit_step 1.9.1 runs one again with a new distance, so they answer the same way. Nothing changes in a request. slicerx_design_undo and slicerx_design_redo are not bumped: they replay steps that were already accepted.

Pushing the top of a cylinder, or of a slot with round ends, down on the
mesh was refused as unsafe at mesh storage precision (intersecting faces).
Two things caused it.

The face's normal comes from one of its triangles, and a kernel's
tessellation leaves a round top a few ulps off flat, so the normal leans a
few 1e-15 off the axis. The cutting prism stepped along that normal from
each rim point, its walls crossed the body's walls at that tiny angle, and
the cut left long crossing needles. The prism now steps along the body's
own wall edge where one runs along the normal.

The prism's walls also follow the chords between the rim points, and a
wall is often not exactly on them: the kernel leaves points between the
rims a few ulps off those planes, or, on a round wall, on the bulge past the
chords. The cut then left crossing needles or flaps a few microns thick.
When all the body has above the new level is the face and its walls, the
walls are not exactly on the prism's, and nothing stands more than 0.05 mm
outside the face's outline, the cut is now a slab over the whole body from
that level up. Pulls, pushes whose walls lie exactly on the outline (a box,
a bar), and pushes with other parts of the body above the new level use the
prism as before. A box or a bar pushed down or pulled gives the same bytes
as before.

Signed-off-by: subydoo-ci[bot] <343861189+subydoo-ci[bot]@users.noreply.github.com>
@subydoo-ci subydoo-ci Bot added user-facing People using SlicerX will notice this; it goes in the release notes roadmap:cad Roadmap feature: cad integrators Changes what editions and integrations build against; the PR has an Integrators: line labels Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrators Changes what editions and integrations build against; the PR has an Integrators: line roadmap:cad Roadmap feature: cad user-facing People using SlicerX will notice this; it goes in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants