Repository navigation
Drawings: inspecting a dimension tells where its lines, arrows and text sit on the sheet (#4894) - #16202
Merged
bherbruck merged 2 commits intoNov 13, 2026
Conversation
…ines, arrows and text sit on its sheet (tangency-labs#4894) drawing.dimension.inspect (and so add and repair) answers layout: the dimension's extension lines, dimension lines, arrowheads and a box for each text, in paper mm from the sheet's lower-left corner. It is worked out by the function that draws the dimension, through its view's frame and moved by the view's centre as the sheet moves it, so the points are the sheet's own. A dimension with no layout says why in layout_why, in the sheet's words: its view draws its parts apart, isn't drawn, or has no place for what it measures. The lines are named by the layout itself: each kind lays out its extension lines first, and DimLayout now counts them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the inch number (tangency-labs#4894) drawing.dimension.add, its dry run, inspect and repair lay the dimension out on its sheet. Add and its dry run run on the window thread, so the layout now asks for a font to fall back to and doesn't wait for the search. While the search runs, the reply has no layout and layout_why says "its text waits for a font to fall back to; drawing.scene draws it when one is found". A short span's lines depend on its text's width, so there is no partial layout. Once the sheet has drawn the text, inspect has the layout. The ask also starts the search early, so the sheet gets its font sooner. The units test now expects the drawing's own units: 80 mm in inches reads "3.1496", as display_units gives an inch length. Two tests from tangency-labs#12778 assumed the window's read is the first to ask for a character. Add now asks first, so they give the dimension its text through drawing.dimension.edit, which lays nothing out. The test helper settled read the font flag from the extract before its last step, so it could stop while a step's own read had just left text waiting. It now reads the answer after each step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 13, 2026
This was referenced Nov 13, 2026
CamWight
added a commit
to CamWight/solidcraft
that referenced
this pull request
Nov 17, 2026
…sit on the sheet (tangency-labs#4894) `drawing.note.inspect` (and `drawing.note.add`, which answers the same way) gains `layout`: each leader as drawn, from its arrow's tip through its elbow to its end, its landing included; each arrowhead's tip and direction; and its text's box, in paper mm from the sheet's lower-left corner. A note with no layout says why in `layout_why`, in the sheet's words. It is the shape `drawing.dimension.inspect` got in tangency-labs#16202. - `note_group` records its layout as it draws: a leader's points are read back from its drawn line, so the landing is the drawn one. `LineRole::Leader` names them. - One rule in one place: `on_its_sheet` (W16-10) now measures on the caller's `ViewSessions`, and `ViewSessions::designed` makes the designed copy once, so the dimension's inspect, its drag and the note's inspect read and lay out on one copy of each view. `drawing_scene::on_sheet_layout` is the move to the sheet both layouts share (font pending, the alone paper check, plus the view's centre); `TEXT_WAITS` moves beside `NOT_DRAWN`. `note_tips` and `sheet_note_line_mm` are shared with the sheet's own notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
added a commit
to CamWight/solidcraft
that referenced
this pull request
Nov 21, 2026
…sit on the sheet (tangency-labs#4894) `drawing.note.inspect` (and `drawing.note.add`, which answers the same way) gains `layout`: each leader as drawn, from its arrow's tip through its elbow to its end, its landing included; each arrowhead's tip and direction; and its text's box, in paper mm from the sheet's lower-left corner. A note with no layout says why in `layout_why`, in the sheet's words. It is the shape `drawing.dimension.inspect` got in tangency-labs#16202. - `note_group` records its layout as it draws: a leader's points are read back from its drawn line, so the landing is the drawn one. `LineRole::Leader` names them. - The note lays out as the dimension's inspect does: its view through `on_its_sheet`, then the dimension's own alone check, now `alone_scene` (the font-pending check and the group alone on its sheet), which both share. `note_tips` and `sheet_note_line_mm` are shared with the sheet's own notes and revision tags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
added a commit
to CamWight/solidcraft
that referenced
this pull request
Nov 22, 2026
…sit on the sheet (tangency-labs#4894) `drawing.note.inspect` (and `drawing.note.add`, which answers the same way) gains `layout`: each leader as drawn, from its arrow's tip through its elbow to its end, its landing included; each arrowhead's tip and direction; and its text's box, in paper mm from the sheet's lower-left corner. A note with no layout says why in `layout_why`, in the sheet's words. It is the shape `drawing.dimension.inspect` got in tangency-labs#16202. - `note_group` records its layout as it draws: a leader's points are read back from its drawn line, so the landing is the drawn one. `LineRole::Leader` names them. - The note lays out as the dimension's inspect does: its view through `on_its_sheet`, then the dimension's own alone check, now `alone_scene` (the font-pending check and the group alone on its sheet), which both share. `note_tips` and `sheet_note_line_mm` are shared with the sheet's own notes and revision tags. - The text's box comes from `box_centre`, as the sheet's does, so the layout follows the note's alignment (tangency-labs#20128). The tests that expect a centred note now say `align: centre`, and `a_notes_layout_follows_its_alignment` checks left, centre and right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight
added a commit
to CamWight/solidcraft
that referenced
this pull request
Nov 23, 2026
…sit on the sheet (tangency-labs#4894) `drawing.note.inspect` (and `drawing.note.add`, which answers the same way) gains `layout`: each leader as drawn, from its arrow's tip through its elbow to its end, its landing included; each arrowhead's tip and direction; and its text's box, in paper mm from the sheet's lower-left corner. A note with no layout says why in `layout_why`, in the sheet's words. It is the shape `drawing.dimension.inspect` got in tangency-labs#16202. - `note_group` records its layout as it draws: a leader's points are read back from its drawn line, so the landing is the drawn one. `LineRole::Leader` names them. - The note lays out as the dimension's inspect does: its view through `on_its_sheet`, then the dimension's own alone check, now `alone_scene` (the font-pending check and the group alone on its sheet), which both share. `note_tips` and `sheet_note_line_mm` are shared with the sheet's own notes and revision tags. - The text's box comes from `box_centre`, as the sheet's does, so the layout follows the note's alignment (tangency-labs#20128). The tests that expect a centred note now say `align: centre`, and `a_notes_layout_follows_its_alignment` checks left, centre and right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Change
In a drawing, a dimension is the measurement drawn on the sheet: its extension lines, its dimension line with arrowheads, and its number. Before this PR, an agent or a script could add a dimension but couldn't ask where those parts end up on the sheet. Now
drawing.dimension.inspectanswers that, and so dodrawing.dimension.addanddrawing.dimension.repair, because they reply with the same answer. This is part of #4894, the drawings milestone. The dimension editor (#5349) and agent checks such as "does this number overlap that line" are the readers.This PR sets the shape of a new reply field,
layout. Later work for #4894 builds on it, so the shape is open for design review here.The new
layoutfield gives, in paper millimetres from the sheet's lower-left corner:The layout comes from the same function that draws the dimension on the sheet (
paper_group), through the same view frame, moved by the view's centre as the sheet moves it. So the points are the sheet's own numbers, not a second calculation. The sketch layout (DimLayout) now counts the extension lines each kind lays out first, so the lines are named by the layout itself.When a dimension has no layout,
layout_whysays why, in the sheet's own words:Add and its dry run work on the window thread. They now ask for a fallback font and don't wait for the search. While the search runs, the reply has no layout, and
layout_whysays so. Before this, add could wait on the window thread for the font search.Inch drawings show the drawing's own inch number: 80 mm reads "3.1496", as
display_unitsgives an inch length.Changes a default: no
Validation
Local, Windows,
--profile ci, ondrawings22b5ce8:cargo fmt --check: clean.cargo check --all-targetsof sketch, engine and ui-egui: clean.dims::: 17 passed, 0 failed.Before the rebase onto the newest
drawings(same code in WE7b's files):drawing_dimension drawing_note_paper drawing_scene schema:: hostile: 987 passed, 0 failed;-D warningsandcargo xtask wasm: clean.Ten planted faults, each caught by a failing test:
The tests sit in the area's existing files:
dims.rs,drawing_dimension_paper_tests.rs,cmd/drawing_dimension_tests.rsanddrawing_scene_tests.rs.What the tests can't reach:
Screenshots of the behavior (when observable)
Nothing changes on the sheet: the dimensions draw exactly as before. The change is in the command's reply, so there is no picture.
Integration status
drawings22b5ce8 (13 Nov). Drawings: a short dimension's number goes outside its extension lines (#13393) #13394, which this builds on, has merged intodrawings.git merge-treeshows conflicts in two files:cmd/drawing_dimension_tests.rsanddrawing_scene.rs. Whichever PR lands second rebases onto the other and runs a light check.Layoutinto its own drawn result when it lands second.