Repository navigation
Add outline scaling to the tool editor - #258
Merged
Merged
Conversation
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>
6F18
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.
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.
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
NumericInputblurred itself on Escape and the blur committed the typed text, so Escape applied the value it was meant to discard. Enter also calledonChangetwice. Enter now commits once and Escape discards, in every numeric field.Docs
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