Skip to content

Drawings: ASME view, section, and detail labels render at 6 mm - #26771

Open
nullifyr wants to merge 1 commit into
tangency-labs:mainfrom
nullifyr:fix/drawing-view-label-height
Open

nullifyr wants to merge 1 commit into
tangency-labs:mainfrom
nullifyr:fix/drawing-view-label-height

Conversation

@nullifyr

@nullifyr nullifyr commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

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.

Targets main (drawings is 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

  • 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.
  • cargo clippy --profile ci -p solidcraft-engine --tests -- -D warnings: 0 warnings.
  • cargo fmt --check: clean.

Before and after

Rendered headlessly with solidcraft-cli snapshot at 1280×720 from the same public example script.

Before: main at 958ef82992

Before (main at 958ef82992).

After: this branch at d014bd3fba

After (this branch at d014bd3fba).

Summary by CodeRabbit

  • Improvements
    • View, detail, and section labels now use capital heights that match the selected drafting standard: 5 mm for ISO and 6 mm for ASME.
    • Label sizing updates when the sheet size changes, while an explicitly selected standard takes precedence over the sheet-size default.

nullifyr added a commit to nullifyr/solidcraft that referenced this pull request Dec 5, 2026
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Merge Risk: Minimal · up to d014b

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Existing Defaults Unchanged Warning 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 Passed checks: 4 passed

Check name Status Explanation
Title check Passed 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 Passed [#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 Passed 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 Passed 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.

Share

Recent review info

Run configuration

Commits

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.

@bherbruck bherbruck added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Dec 5, 2026
@CamWight

CamWight commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

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.

@bherbruck

Copy link
Copy Markdown
Collaborator

@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.

@bherbruck bherbruck added the status:decision Waiting on a maintainer group decision; don't merge or close label Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) status:decision Waiting on a maintainer group decision; don't merge or close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawings: ASME view, section, and detail labels render at 5 mm instead of 6 mm

3 participants