Skip to content

Symmetric editing + adjustable node detail for the tool editor#75

Merged
jasonmadigan merged 2 commits into
tracefinity:mainfrom
sliptonic:symmetric-modeling
Jun 14, 2026
Merged

Symmetric editing + adjustable node detail for the tool editor#75
jasonmadigan merged 2 commits into
tracefinity:mainfrom
sliptonic:symmetric-modeling

Conversation

@sliptonic

Copy link
Copy Markdown
Contributor

Fixes #61

This PR adds a couple tools to the tool editor toolbar.

image

A) is a slider that will remove node detail.

Drag toward Accurate for the full traced detail (default), toward Simple for fewer nodes. Each move re-derives from the originally-loaded outline via Ramer–Douglas–Peucker (simplifyEpsilon in frontend/src/lib/svg.ts), so it's lossless within a session — you can dial back and forth freely. Live preview during the drag; a single undo entry on release.

B) Toggles the symmetric editing mode.

image

When symmetric editing is enabled (1) A symmetry line (2) is placed in the vertical axis. This can be toggled horizontal with (3) or dragged to fine tune the placement.

In symmetric mode, nodes are paired across the symmetry line. Dragging on one side duplicates the action on the other side.

Both changes are frontend-only — the editor still emits plain points / finger_holes / interior_rings, so nothing downstream (STL pipeline, storage, API) changes.


Everything routes through the existing undo/redo history.

How it works (frontend/src/lib/symmetry.ts): the outline is clipped to the kept half-plane (Sutherland–Hodgman), the longest off-axis arc is taken as the real body — which makes it robust to jagged traces that re-cross the axis many times — then stitched with its reflection into a canonical vertex order where each vertex's mirror partner is a pure index function. Live edits use that pairing.

Limitations: vertical/horizontal axes only (no arbitrary angle); a shape pinched into separate lobes across the axis keeps the largest lobe; a warning appears if the axis genuinely doesn't pass through the outline.

@sliptonic
sliptonic force-pushed the symmetric-modeling branch from 6113233 to 14606af Compare June 9, 2026 22:28
@jasonmadigan

Copy link
Copy Markdown
Collaborator

nice work @sliptonic and thanks for the addition.

@jasonmadigan
jasonmadigan merged commit 1201fdb into tracefinity:main Jun 14, 2026
1 check passed
shanetinklenberg pushed a commit to shanetinklenberg/tracefinity that referenced this pull request Jun 28, 2026
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.

Feature Request: Symmetric modeling

2 participants