Skip to content

fix(viewer): pin a face whose plane is shared, or refuse to write it - #5

Merged
asbis merged 3 commits into
masterfrom
claude/jovial-swanson-c1acf6
Sep 23, 2026
Merged

asbis merged 3 commits into
masterfrom
claude/jovial-swanson-c1acf6

Conversation

@asbis

@asbis asbis commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Problem

If you fuse gussets onto a bracket's base, the base's top splits into three faces in the same plane. When you picked one and pressed Extrude, the viewer wrote extrudeFace(bracket, (f) => f.inPlane("XY", thickness), 3). That selector matched all three faces, so extrudeFace refused it ("the selector matched 3 faces, but it must match exactly one") and Apply did nothing.

Fix

  • Worker (packages/core/src/face-target.ts): on every face preview, the worker counts the faces the plane selector matches. If there is more than one, it tries a .containsPoint pin: first the face's centre, then a point inside its largest triangle. That second point covers faces whose centre falls outside them, such as an L-shape or a face with a hole. A pin is kept only if the kernel confirms it matches the picked face and nothing else. The preview runs with that same selector, so preview and file cannot disagree.
  • Viewer: Apply stays disabled until the worker has answered ("checking the selector…"). If no pin works, Apply stays disabled and the op bar says why. The pin the preview ran with is the one sent on Apply.
  • Shared: synthesizeFaceSelector writes the pin. The coordinate along the face's normal uses the same expression as inPlane, so it follows that parameter.
  • Serve host: parseFaceOp builds the target from a whitelist and was dropping pin, so the ambiguous line got written anyway. It now keeps pin and has tests.

Result on the repro bracket:

extrudeFace(bracket, (f) => f.inPlane("XY", thickness).containsPoint([0, -thickness / 2, thickness]), 3)

Testing

  • pnpm lint is clean. pnpm test passes (1192 tests).
  • New tests:
    • preview-op: match count, pin, preview volume matching the committed line, fallback to the interior point, refusal when the picked face can't be identified.
    • face-picking: each of the 3 real coplanar faces gets its own pin.
    • Unit tests for the shared selector, the VS Code host, the serve validator, and faceInteriorPoint.
  • Checked by hand in the browser viewer (pnpm serve) with an equivalent gusseted L-bracket. website/ isn't in the repo.

Notes

  • Pin coordinates are matched to parameters the same way edge points are. In the repro, −2.5 was read as -thickness / 2, and the existing "read as half a parameter" warning flags it.
  • Bumps extension, mcp-server and the plugin manifest to 1.29.2, because a v1.29.1 tag already exists on a merge that isn't in master.

🤖 Generated with Claude Code

Fusing gussets onto a bracket's base splits the base's top into three
coplanar faces. The viewer named the picked face by its plane alone:
`inPlane("XY", thickness)`. That matched all three, so `extrudeFace`
refused it, and Apply wrote a line that did nothing.

On every face preview the worker now counts what the plane matches. If
the plane is shared, it looks for a `.containsPoint` pin: the face's
centre first, then a point inside its largest triangle. It keeps a pin
only if the kernel confirms it matches the picked face and no other.
The preview runs with that same finder, and the host writes it. If no
pin isolates the face, Apply stays disabled and the op bar gives the
reason. Apply also stays disabled until the worker has answered.

The serve host's face-op validator rebuilt the target from a whitelist
and dropped the new field. It keeps `pin` now, and has tests.

Bumps extension and mcp-server to 1.29.2. v1.29.1 is already tagged on
a branch that was never merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
shapeitup-landing Ready Ready Preview Sep 23, 2026 11:13am UTC

Master released 1.29.2 (a docs-only change) while this branch was open,
and that collided with this branch's own 1.29.2. The coplanar-face fix
now ships as 1.29.3. The CHANGELOG keeps master's 1.29.2 and 1.29.1
entries unchanged, and the plugin description comes from master (it
lists 3MF).

The merge also brings in website/. The Vercel check failed because the
project's Root Directory "website" did not exist on this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
While this branch was open, master released 1.29.3 (#6, the stale skill
path). The coplanar-face fix now ships as 1.29.4. Master's 1.29.3 entry
is kept unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@asbis
asbis merged commit a05a88b into master Sep 23, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9868c675 Deployed Sep 23, 2026 by vercel[bot]
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