Skip to content

Units preference; Measure shows mm or inches (#234) - #244

Merged
crisprintsstuff merged 2 commits into
mainfrom
measure-units
Nov 14, 2026
Merged

crisprintsstuff merged 2 commits into
mainfrom
measure-units

Conversation

@crisprintsstuff

Copy link
Copy Markdown
Owner

Fixes #234: the Measure plugin now shows units.

What changes

  • Preferences > General > Units (next to Orbit around):
    • Metric (mm) or Imperial (in).
    • 1 scene unit = N mm. This is the 3D print window's existing scale (default 10), now saved between sessions, so the two always agree.
  • Plugin API 5:
    • units() -> i32: 0 metric, 1 imperial.
    • unit_scale() -> f32: millimetres per scene unit, never 0.
    • Older plugins are unaffected. The API reference and manifest docs are updated.
  • Measure 1.1 (now API 5):
    • Metric: "Size 20.000 × 10.000 × 5.000 mm, volume 1.000 cm³".
    • Imperial: "… in, volume … in³".
    • Its number formatting now uses 64-bit integers, so a metre-sized model in millimetres doesn't overflow (before, values above about 4.29 million thousandths saturated).

Verified

  • cargo fmt --check, clippy -D warnings, cargo test --workspace, check_corpus_ip.py.
  • New and updated tests:
    • Measure output in metric, imperial, and for a large model.
    • Any plugin can read units(), and unit_scale() falls back to 1 for a zero scale.
    • The settings round trip carries the units and the scale.
    • The manifest test now refuses API 6.
  • A headless screenshot opened Preferences without errors. The Units row sits further down the General page, below the part captured, so I didn't see it rendered.

Not done

  • The 3D print window still shows millimetres whatever the Units choice, since slicers work in mm. The scale itself is shared.
  • Not run on Windows or macOS.

Generated by Claude Code

The Measure plugin printed sizes and volume in bare scene units, which
meant nothing to someone preparing a print. Add a Units preference
(metric or imperial) and the size of a scene unit in millimetres, the
same scale the 3D print window already used, now saved with the
settings. Plugin API 5 exposes both (units(), unit_scale()), and Measure
uses them: mm and cm³, or inches and in³. Its number formatting now uses
64-bit integers, so large models in small units don't overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GEttLK8THCkZ7KHELbSp7g
Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>

# Conflicts:
#	docs/ROADMAP.md
@crisprintsstuff
crisprintsstuff merged commit d68e7ea into main Nov 14, 2026
5 checks passed
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.

Measure Plugin Doesn't Show Units

2 participants