Skip to content

37 R11: knife polylines, live symmetry, Smart unwrap core half (1.28) - #340

Merged
AlexZ005 merged 5 commits into
feat/1.28from
feat/37-mesh
Oct 7, 2026
Merged

AlexZ005 merged 5 commits into
feat/1.28from
feat/37-mesh

Conversation

@AlexZ005

@AlexZ005 AlexZ005 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Roadmap 37 R11 (release 1.28): knife polyline cuts, live symmetry, and the core half of the xatlas Smart unwrap module (the module itself is in theprototype-app/modules on branch feat/37-mesh).

What

  • Knife polylines: Shift/Ctrl+click (or the touch Multi-select toggle) places a corner. A plain click ends the cut, Enter ends it at the last corner, Backspace takes a corner back, and Esc drops the cut. While a cut is pending, Tool options shows the point count with Back/Cut buttons for touch.
    • Corners that land on the mesh become real vertices. Each one is first snapped to the corner (6 px) or edge (3 px) of the face under it.
    • The whole polyline is one undo entry and one broadcast.
    • Behaviour change: a two-click cut that ends inside the mesh now ends at the clicked point instead of fanning to the triangle's far corner.
  • Live symmetry (toolbox Symmetry › "live symmetry"; local, not saved): every edit is mirrored across the axis, from the side the edit changed. Vertex drags move each vertex's mirror twin live, and a vertex on the plane stays on the plane.
    • It hooks the operator boundary, not the commit path. One-shot ops record through recordOp, which mirrors on a microtask and rewrites that same entry, so the op and its mirror are one undo step. The adjust engine mirrors its pure result. Vertex-mode ops pass op=true to commitMeshGeoTriple/Snapshot.
    • Undo, redo, Cancel and peers' edits are applied exactly as made. mirrorTrisCore is the pure half it shares with one-shot Symmetrize.
  • UV editor: the Unwrap menus re-read the backend registry each time they open, so a module installed while the editor is open (Smart unwrap) shows up without reopening it.

Proof

  • Unit tests:

    • meshKnife: 11/11. Without corner insertion, 4 fail.
    • meshSymmetryLive: 8/8. With a fixed side instead of the edited side, the edit is discarded.
    • Full vitest: 1561/1561.
  • svelte-check: 318/47, the same as the baseline. Build passes.

  • New and changed e2e suites:

    Suite Result What it covers
    mesh-symmetry-live 34/0, two peers one-shot ops, adjust-engine scrub and settle, knife, vertex twins and plane pinning, one undo entry, undo/redo and peer edits not mirrored
    mesh-knife 41/0, two peers real Shift+clicks, Backspace, Enter, the Cut button, corners land as vertices, watertight, one undo
    uv-smart-unwrap 19/0, two peers installs the real zip; on a box and a sphere, UVs stay in 0..1 with no degenerate triangles and no overlapping islands, one undo step, and the peer gets the same mapping
  • Standing mesh battery: all 19 suites green, plus mesh-symmetrize 16/0 and uv-unwrap-module 12/0.

    • mesh-advanced-ops failed 9 checks once, all in its separate-to-object section. It was 85/0 on 1.25.0 and 85/0 twice in a row on this branch. This lane doesn't touch separate-to-object.
  • Bug found by the run: Backspace never reached a pending cut. The shortcut registry's viewport Backspace row calls preventDefault before its no-op action, so the knife key handler no longer defers to defaultPrevented.

  • Screenshots: /home/deck/.code/lanes-30/after-37/37-mesh/05-08*.png.

Owed on a device

  • Knife polyline feel, including the snap radii.
  • Live symmetry from VR (there is no VR toggle).
  • Smart unwrap speed on a Quest: about 1–1.5 s for 10k triangles on the main thread.

Decided forks: QUESTIONS-37-mesh.md. Docs fragment: lanes-30/after-37/37-mesh/docs-fragment.md.

🤖 Generated with Claude Code

AlexZ005 and others added 5 commits October 7, 2026 04:14
- knifeCutCore (pure): corners on the mesh are inserted as vertices first (per
  welded edge when on one, snapped to the face corner/edge under them), then each
  segment is a straight cut on the previous result; a cut ending at an inserted
  vertex fans onto that vertex, so 3+ crossings per triangle resolve segment by
  segment and stay watertight
- Shift/Ctrl+click (or touch multi-select) adds a corner, plain click ends the cut,
  Enter ends at the last corner, Backspace drops one, Esc cancels; Back/Cut
  buttons in Tool options while pending; the overlay draws the placed polyline
- one undo entry and one broadcast per polyline; knifeCut(from,to) unchanged API
- unit meshKnife 11/11 (counterfactual: no corner insertion -> 4 red);
  e2e mesh-knife gains a real-input polyline section

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- toolbox Symmetry > "live symmetry" (local, not persisted): every edit is
  mirrored across symAxis from the side the edit CHANGED (editSide); symKeep
  only breaks a tie
- hooks the OPERATOR boundary, never the restore paths: one-shot ops record via
  recordOp (mirror on a microtask, entry.after rewritten = ONE undo entry), the
  adjust engine mirrors the pure result (mirrorAdjustResult), vertex-mode ops
  pass op=true to commitMeshGeoTriple/Snapshot; undo/redo/cancel/peer edits are
  applied as sent
- vertex drags move each vertex's mirror twin live; plane vertices stay on it
- mirrorTrisCore = the pure half shared with one-shot Symmetrize
- unit meshSymmetryLive 8/8 (counterfactual: a fixed side discards the edit);
  e2e mesh-symmetry-live (two peers) - first run still queued

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… e2e (37 R11)

- a module installed while the UV editor is mounted (smart-unwrap) now appears
  in the Unwrap menus without reopening the editor
- e2e uv-smart-unwrap installs the modules repo's smart-unwrap.zip
  (MODULES_REPO) and checks range/degenerate/overlap/undo/peer on box + sphere

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e suite premises (37 R11)

- knifeKeyConsumed no longer defers to defaultPrevented: the shortcut registry's
  viewport Backspace row (objects.delete-backspace) preventDefaults before its
  action stands down in a mesh session, so Backspace never dropped a corner
  (found by e2e r1: 3 points stayed 3)
- mesh-symmetry-live: picking cycles selectHandle (each a 'selection' undo
  entry), so the drag undo check now walks to a mark and counts geometry
  entries (2 = one per drag) instead of "two undos"
- mesh-knife: polyline points projected from the box face, with an
  elementFromPoint check (fixed pixel offsets landed under the toolbox)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- the right-hand point landed on the toolbox (elementFromPoint said <P>); both
  points now sit on the left half of the face, a pending cut is cleared before
  the peer section, and an unclickable Cut button reports its rect
- mesh-knife 41/0 (two peers)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AlexZ005
AlexZ005 merged commit 8b8c579 into feat/1.28 Oct 7, 2026
6 checks passed
@AlexZ005
AlexZ005 deleted the feat/37-mesh branch October 7, 2026 19:50
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