You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Drawings: ASME view, section, and detail labels render at 6 mm - #26771
View, section, and detail labels on ASME sheets (such as ANSI B and Letter) were drawn at a hardcoded 5.0 mm capital height, under the 6 mm (0.24 in) minimum required for section and view letters across all sheet sizes by ASME Y14.2-2014 Table 1 (Machinery's Handbook 32, p. 1396).
View labels, detail callout letters, and section cutting-plane letters now follow the drawing's active standard (Drawing::gdt_standard_in_use()): 6.0 mm for ASME drawings (Standard::AsmeY14_5_2018, inferred for non-ISO-A first sheets or chosen via drawing.gdt.standard) and 5.0 mm for ISO drawings (Standard::Iso1101_2017Iso5459_2024, ISO 3098-2, ≥ 3.5 mm). No new setting is added.
Changes a default: yes — view, section, and detail labels on ASME drawings now render at 6.0 mm instead of 5.0 mm per ASME Y14.2-2014 Table 1, old behaviour kept behind setting drawing.gdt.standard.
Validation
Regression test drawing_scene::tests::view_label_height_follows_the_drawings_drafting_standard failed on origin/main (0bbf8dfa38) on build host (ASME label 'VIEW A' expected 6.0 mm, got 5) and passed after the fix on 9d60743b6b.
cargo test --profile ci -p solidcraft-engine --lib -- drawing_note_paper:: drawing_scene::tests::a_views_label_sits_above_it_and_moves_with_it drawing_scene::tests::view_label_height_follows_the_drawings_drafting_standard drawing_scene::tests::centre_annotations_and_view_labels_follow_the_same_moved_view drawing_scene::tests::automatic_centre_marks_and_a_view_label_move_and_undo_together: 19 passed, 0 failed.
No actionable comments were generated in the recent review.
Walkthrough
View, detail, and section labels now use 5 mm capital height for ISO drawings and 6 mm for ASME drawings. Tests check the selected heights and rendered label metrics.
Changes: Drawing label sizing
Layer / File(s)
Summary
Select and apply label capital height crates/engine/src/drawing_note_paper.rs, crates/engine/src/drawing_note_paper_tests.rs
The label capital height is 5 mm for ISO and 6 mm for ASME. label_group uses the height supplied by its caller. A test checks the selected value against rendered label metrics.
Apply standard sizing in drawing scenes crates/engine/src/drawing_scene.rs, crates/engine/src/drawing_scene_tests.rs
Drawing scenes pass the height selected from the active GDT standard to view, detail, and section label construction. Tests cover ISO and ASME settings and compare settled provider scenes with directly built scenes.
View, detail and section labels now follow the drawing standard, using 6 mm for ASME and 5 mm for ISO. No actionable merge risk was found, and tests cover both standards.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Existing Defaults Unchanged
The PR changes a user-visible drawing default. The diff in crates/engine/src/drawing_note_paper.rs replaces the fixed LABEL_MM = 5.0 with label_cap_mm(standard), which returns `ASME_LABEL_MM = 6.0…
Changed default: ASME view, section, and detail label capital height on drawings with the ASME standard (the default for non-ISO-A first sheets). - Before: 5.0 mm capitals on ANSI B, Letter, and other non-ISO-A sheets. - After: 6.0 mm capit…
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title names the ASME label height change (6 mm) for view, section, and detail labels in drawings, which is the main change in the changeset. It is specific and matches the raw summary and objectiv…
Linked Issues check
[#26770] requires ASME view, section, and detail labels at 6.0 mm and ISO labels at 5.0 mm. At head, drawing_scene.rs::view_labels computes cap_mm = label_cap_mm(d.gdt_standard_in_use()) and passe…
Out of Scope Changes check
The whole-PR diff against the merge base changes only crates/engine/src/drawing_note_paper.rs and crates/engine/src/drawing_scene.rs in the inspected hunks. Those hunks change label cap-height sel…
Description check
The description explains the change: view, section, and detail label capital heights on ASME drawings move from a hardcoded 5.0 mm to 6.0 mm, with ISO kept at 5.0 mm, and it cites the standard basis a…
Full details: Title check
Explanation
The title names the ASME label height change (6 mm) for view, section, and detail labels in drawings, which is the main change in the changeset. It is specific and matches the raw summary and objectives. The title does not mention the ISO side (kept at 5 mm), but that is an expected omission.
Full details: Linked Issues check
Explanation
[#26770] requires ASME view, section, and detail labels at 6.0 mm and ISO labels at 5.0 mm. At head, drawing_scene.rs::view_labels computes cap_mm = label_cap_mm(d.gdt_standard_in_use()) and passes it to label_group, detail_mark, and section_cut. In drawing_note_paper.rs, label_cap_mm maps AsmeY14_5_2018 to ASME_LABEL_MM = 6.0 and Iso1101_2017Iso5459_2024 to ISO_LABEL_MM = 5.0. The hardcoded LABEL_MM is removed, and label_group uses the supplied cap_mm for both Text::set and placed. The change covers view labels, detail letters, and section cutting-plane letters. The PR adds regression coverage for ISO 5.0 mm and ASME 6.0 mm in drawing_note_paper_tests.rs and drawing_scene_tests.rs. I did not read those test bodies in full. The reported test results are not independently rerun.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against the merge base changes only crates/engine/src/drawing_note_paper.rs and crates/engine/src/drawing_scene.rs in the inspected hunks. Those hunks change label cap-height selection and thread the cap_mm parameter through label construction, which directly implements #26770. The label_group signature change is an internal API change needed to pass the height. No unrelated behaviour change appears in the inspected code. The added tests support the same objective. Other test-file hunks were not inspected in detail, but their stated content matches the objective.
Full details: Description check
Explanation
The description explains the change: view, section, and detail label capital heights on ASME drawings move from a hardcoded 5.0 mm to 6.0 mm, with ISO kept at 5.0 mm, and it cites the standard basis and the linked issue. It fills in the template's 'Changes a default' line as 'yes' with the old behaviour kept behind a setting. Validation lists a regression test, a targeted test run, clippy, and fmt results. Before/after screenshots are included. The integration status section is absent. The title is not a template-style title, and the description does not name the 'Test change' requirement, which applies only to kernel test edits and is not triggered here. The main gaps are the missing Integration status section and a few unclear points: the 'Changes a default' line says the old behaviour is kept behind 'setting drawing.gdt.standard', while the PR text says no new setting is added, and the commit hashes disagree between the description and the objectives.
Full details: Existing Defaults Unchanged
Explanation
The PR changes a user-visible drawing default. The diff in crates/engine/src/drawing_note_paper.rs replaces the fixed LABEL_MM = 5.0 with label_cap_mm(standard), which returns ASME_LABEL_MM = 6.0 for Standard::AsmeY14_5_2018. The diff in crates/engine/src/drawing_scene.rs passes this value into view_labels, detail_mark, and section_cut. Before the change, ASME drawings drew view, section, and detail labels at 5.0 mm capital height. After the change, the same labels draw at 6.0 mm under the default ASME standard. The PR description says "Changes a default: yes" and states that the old behaviour is kept only behind drawing.gdt.standard. The check fails on any UX default change that a user relies on. This is a drawing-rendering default, not a kernel or geometry result, so the solidcore exemption does not apply. The "Changes a default" flag is accurate, so the mismatch clause does not apply. The check does not require the change to be reverted. It requires the changed default to be named and its before/after behaviour to be stated, and this is done in the PR description and the diff.
Resolution
Changed default: ASME view, section, and detail label capital height on drawings with the ASME standard (the default for non-ISO-A first sheets). - Before: 5.0 mm capitals on ANSI B, Letter, and other non-ISO-A sheets. - After: 6.0 mm capitals on the same sheets, with no setting change. ISO drawings stay at 5.0 mm. To keep the change, the PR must state this default change explicitly in the release notes or user documentation. To avoid the change, the PR must keep 5.0 mm as the default for ASME and make 6.0 mm an explicit opt-in setting.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 4d3f89b and d014bd3.
Files selected for processing: 4
crates/engine/src/drawing_note_paper.rs
crates/engine/src/drawing_note_paper_tests.rs
crates/engine/src/drawing_scene.rs
crates/engine/src/drawing_scene_tests.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Thanks for this one. The view label, the detail letter and the section letters all get the same size from view_labels (drawing_scene.rs:1810), and label_box reads the same thing, so moving a label still lines up.
Two small things a maintainer might want to weigh in on:
The way back in the "Changes a default" line is drawing.gdt.standard. Switching that to iso does give 5 mm labels again, but it also switches the GD&T rules (concentricity and symmetry, crates/geom/src/gdt.rs:215), and with Drawings: ASME dimensions draw horizontal unidirectional text inside a broken dimension line #26780 the dimension text direction too. So it is "make the drawing ISO" rather than "ASME with the old label size". Might be worth saying in the body.
The help for drawing.gdt.standard (cmd/drawing_gdt.rs:77) and the module doc (crates/doc/src/drawing/gdt.rs:12-14) still describe it as GD&T only. With this PR it also sets label size, so a line there would help someone wondering why their labels changed.
A heads-up across the series: this PR and #26780 key on gdt_standard_in_use() only, while #26790's Drawing::drafting_profile() lets a saved profile win first. Nothing sets a profile yet, so it's fine today, but it may be worth agreeing which one drives the ASME choices before a profile picker arrives.
@nullifyr quick status: CI is green. What holds it is the Changes a default: yes line: it changes how every ASME drawing looks by default, so I'm deciding it myself, together with your other ASME text changes. It's on my list, and nothing is needed from you for now.
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
approved-for-ciReviewed: run the full PR CI (build, tests, goldens, Clippy)status:decisionWaiting on a maintainer group decision; don't merge or close
3 participants
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.
View, section, and detail labels on ASME sheets (such as ANSI B and Letter) were drawn at a hardcoded
5.0 mmcapital height, under the 6 mm (0.24 in) minimum required for section and view letters across all sheet sizes by ASME Y14.2-2014 Table 1 (Machinery's Handbook 32, p. 1396).View labels, detail callout letters, and section cutting-plane letters now follow the drawing's active standard (
Drawing::gdt_standard_in_use()): 6.0 mm for ASME drawings (Standard::AsmeY14_5_2018, inferred for non-ISO-A first sheets or chosen viadrawing.gdt.standard) and 5.0 mm for ISO drawings (Standard::Iso1101_2017Iso5459_2024, ISO 3098-2, ≥ 3.5 mm). No new setting is added.Targets
main(drawingsis merged and frozen).Fixes #26770
Changes a default: yes — view, section, and detail labels on ASME drawings now render at 6.0 mm instead of 5.0 mm per ASME Y14.2-2014 Table 1, old behaviour kept behind setting
drawing.gdt.standard.Validation
drawing_scene::tests::view_label_height_follows_the_drawings_drafting_standardfailed onorigin/main(0bbf8dfa38) on build host (ASME label 'VIEW A' expected 6.0 mm, got 5) and passed after the fix on9d60743b6b.cargo test --profile ci -p solidcraft-engine --lib -- drawing_note_paper:: drawing_scene::tests::a_views_label_sits_above_it_and_moves_with_it drawing_scene::tests::view_label_height_follows_the_drawings_drafting_standard drawing_scene::tests::centre_annotations_and_view_labels_follow_the_same_moved_view drawing_scene::tests::automatic_centre_marks_and_a_view_label_move_and_undo_together: 19 passed, 0 failed.cargo clippy --profile ci -p solidcraft-engine --tests -- -D warnings: 0 warnings.cargo fmt --check: clean.Before and after
Rendered headlessly with
solidcraft-cli snapshotat 1280×720 from the same public example script.Before (main at
958ef82992).After (this branch at
d014bd3fba).Summary by CodeRabbit