Symmetric editing + adjustable node detail for the tool editor#75
Merged
Conversation
sliptonic
force-pushed
the
symmetric-modeling
branch
from
June 9, 2026 22:28
6113233 to
14606af
Compare
Collaborator
|
nice work @sliptonic and thanks for the addition. |
jasonmadigan
approved these changes
Jun 14, 2026
shanetinklenberg
pushed a commit
to shanetinklenberg/tracefinity
that referenced
this pull request
Jun 28, 2026
…efinity#75) * symmetric edit * fix test failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #61
This PR adds a couple tools to the tool editor toolbar.
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.
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.