Skip to content

Resample a sectioned part while the measure tool is active. - #125

Merged
BradEstey merged 5 commits into
mainfrom
brad/measure-tool
Sep 17, 2026
Merged

BradEstey merged 5 commits into
mainfrom
brad/measure-tool

Conversation

@BradEstey

Copy link
Copy Markdown
Member

Summary

  • While <MeasureTool> is mounted, a part cut by a section is measured as it is seen. The tool
    re-samples the part whenever a clipping plane moves: the half the cut removed is not offered
    for snapping, the part's edges stop at the plane, the outline where the plane passes through
    solid material is an edge with corners of its own, and the capped face is a surface a point
    can land on.
  • The plane is read off the part material's clipping planes, so it works for the viewer's own
    cut and for a controlled section prop alike. The sample is keyed on the plane and cached per
    mesh, so a handle drag or a depth change re-samples on the next pointer move and a still cut
    costs nothing.
  • sectionContour, clipSegments, pointInContour, capHit and sampleSection are the pure
    functions behind it, exported from the root.
  • The example gains a toy brick model, hollow with tubes underneath, for cutting open and
    measuring.

Public package release

  • This PR changes no public package source.
  • I ran pnpm changeset and committed the generated Changeset.
  • This source change intentionally needs no release; I applied the
    no-release-needed label and explained why below.

Validation

  • I ran the relevant checks and tests.

  • pnpm --filter @toolpath/viewer test — 305 passed

  • pnpm --filter @toolpath/example-react-viewer test — 15 passed (Playwright), including a new
    test that measures from the cap and again after the cut is deepened

  • pnpm check-types, pnpm exec eslint, pnpm knip — clean

@BradEstey
BradEstey merged commit 33f8c52 into main Sep 17, 2026
2 checks passed
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.

2 participants