8000 Add outline scaling to the tool editor by jasonmadigan · Pull Request #258 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Add outline scaling to the tool editor - #258

Merged
jasonmadigan merged 4 commits into
mainfrom
feat/105-outline-scale
Nov 14, 2026
Merged

jasonmadigan merged 4 commits into
mainfrom
feat/105-outline-scale

Conversation

@jasonmadigan
Copy link
Copy Markdown
Collaborator

The tool editor could only change an outline's size one vertex at a time. A Size group in the toolbar now shows the outline's width and height and scales the whole outline when a measured width or height is typed, or by a percentage.

  • Type a value and press Enter. The other dimension follows, so proportions are kept. The percentage applies once and the field returns to 100.
  • Interior rings, cutout positions, the photo underlay and the Detail slider's base scale about the same centre in one undo step. Cutouts keep their own size.
  • Scaling is about the vertex-mean centre, the centre rotation uses, so a tool placed in a bin keeps its position when the bin re-syncs it.
  • No backend, API or schema change.

The fields scale on Enter only and discard typed text on blur. A drag snapshots the outline on mousedown, before the blur that mousedown causes, so a scale committed on blur would be overwritten by the drag while the photo matrix and Detail base stayed scaled.

Behaviour change outside the Size fields

NumericInput blurred itself on Escape and the blur committed the typed text, so Escape applied the value it was meant to discard. Enter also called onChange twice. Enter now commits once and Escape discards, in every numeric field.

Docs

  • Tool editor page: the Size fields.
  • Photo guide: a section on tall or thick objects, with the oversize by edge height and camera distance, and the three steps that correct it. The earlier line said a thick tool from 60cm traces about 2% too large, which holds only near 15mm.

Verification

  • make lint: 0 errors, the same 9 warnings as main.
  • cd frontend && pnpm test: 331 passed.
  • make test-e2e-accuracy: 8 passed, including a new test that types a width in the browser and measures the exported STL pocket.
  • cd backend && venv/bin/python -m pytest: 873 passed before the rebase on main; backend untouched.

Closes #105

The tool editor could only change an outline's size one vertex at a
time. A Size group in the toolbar now shows the outline's width and
height and scales the whole outline to a typed width or height, or by
a percentage that applies once and returns to 100.

Scaling is about the vertex-mean centre, the same centre rotation
uses, so a placed tool keeps its position when a bin re-syncs it.
Interior rings scale with the outline. Cutouts move with it but keep
their own size. The photo underlay matrix and the Detail slider's base
are scaled about the same centre in one history entry, as rotate and
flip do.

NumericInput calls onChange on Enter and again on the blur that
follows, and on any blur. The Size fields apply one scale per render
and ignore an unchanged reading, so neither rescales the outline.

Relates to #105

Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
The guide said a thick tool shot from 60cm traces around 2% too large.
That holds only for an outline about 15mm above the paper. State the
rule, H/(H-t), with figures for 15mm and 75mm, say that distance
cannot remove the error for tall objects, and point to the tool
editor's Size fields.

Relates to #105

Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
Give the oversize rule as a table of edge heights and camera distances, and the three steps that correct it: lay the object flat, shoot from further away with zoom, and set the outline to a measured dimension with the Size fields.

Relates to #105

Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
A drag snapshots the outline on mousedown, before the blur that mousedown
causes. A Size field that committed on blur could scale the outline after
the snapshot, and the drag then wrote back the unscaled outline while the
photo matrix and Detail base stayed scaled. The Size fields now scale on
Enter only and discard typed text when they lose focus.

NumericInput blurred itself on Escape, and the blur committed the typed
text, so Escape applied the value it was meant to discard. Enter also
committed twice. Enter and Escape now settle the field, and the blur
they cause does nothing more.

Scaling stops at the sizes the fields accept, so a repeated percentage
cannot run the outline past 2000 mm or under 1 mm, and a factor within
float noise of 1 adds no history entry.

Relates to #105

Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
@jasonmadigan
jasonmadigan marked this pull request as ready for review November 14, 2026 20:56
@jasonmadigan
jasonmadigan merged commit a73e0e6 into main Nov 14, 2026
6 checks passed
@jasonmadigan
jasonmadigan deleted the feat/105-outline-scale branch November 14, 2026 20:57
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: Post-trace scaling to adjust cutout tolerances

1 participant

0