Skip to content

Add a locked 3D printer and tool volume reference - #77

Open
VR-Architect wants to merge 3 commits into
BenchUp3D:mainfrom
VR-Architect:feat/69-printer-volume
Open

VR-Architect wants to merge 3 commits into
BenchUp3D:mainfrom
VR-Architect:feat/69-printer-volume

Conversation

@VR-Architect

@VR-Architect VR-Architect commented Nov 15, 2026 •

Copy link
Copy Markdown

Implements #69.

A dashed wireframe box for a 3D printer's build volume, or for a woodworking machine's working area (a planer's capacity, a CNC's cutting envelope). It is a reference only: it is never saved with the project, exported, copied or selected.

Viewport

  • The volume button sits next to Walk in the viewport options bar and toggles the box. It is icon-only and reads as selected while the box is visible.
  • The box uses the dashed overlay line style, so it reads as a guide rather than solid geometry.
  • As requested, the bottom face is centred on the world origin, and the box is locked: it cannot be picked, moved or transformed.
  • Toggling on frames the volume, so a 256 mm box is visible whatever the current zoom. Toggling off leaves the camera where it is.
  • Warning: while the box is visible, a persistent banner reads "The model is outside the printer or tool volume." when any geometry leaves the volume. This is the warning @dannycoulombe suggested in the issue.

Settings → Tools → Printer and tool volume

  • Show the toggle on the viewport toolbar — turn the button itself off if you never use it. Default on.
  • Width (X) / Depth (Y) / Height (Z) — entered in the workspace display units and converted when the units change, so 256 mm reads as 25.6 cm or about 0.84 ft. Default 256 mm on all three.
  • Shortcut — optional, unassigned by default, cleared with the ✕ button. Tool shortcuts win, so assigning a key a tool already uses does not break the tool.

Choices worth a look

  • A global preference, not document data. The volume lives in GeneralSettings, so it never reaches .bup, an export, copy, select-all or the selection. Opening a project on a machine without a printer does not inherit someone else's build volume.
  • Turning the button off hides the box. A stored shortcut cannot keep an invisible toggle's box on screen.
  • An overlay, not cached geometry. SceneKey does not include the volume, so the shape cache is bypassed while the box is shown; otherwise a stale box survives a toggle on large models. The box is painted in both the resident and non-resident render paths.

Testing

28 new tests (14 in printer_volume.rs, 10 in app_tests.rs, 4 in settings.rs). They cover framing on toggle-on with the camera staying put on toggle-off, warning gating, memo invalidation, the shortcut through real key events, the settings modal path, unit conversion, clamped preferences and isolation from save, export, copy and selection.

  • cargo test --locked -p benchup-app --lib — 1163 pass, 23 fail. Those 23 are exactly the set that fails on pristine main (5922466: 1135 pass, 23 fail), so they are pre-existing and unrelated (Chinese strings, the dimension input overlay render audit, move/copy arrays, tool rail separators, Follow Me). Nothing new fails; the 28 new tests all pass.
  • cargo test --locked -p benchup-core — 336 pass.
  • cargo check --locked -p benchup-app --target wasm32-unknown-unknown — clean.
  • Checked by hand in Chromium against a real WebGPU adapter: the box appears and disappears, the warning appears and clears, the camera does not move on toggle-off, and there are no console errors.
  • All new text is translated in every catalog (en_US, es_419, it_IT, pt_BR, vi_VN, zh_CN); a test asserts each label exists in all of them.

Open questions

  • The warning came from your comment in Feature Request: 3D Printer Dimensions #69. It is easy to split into its own PR if you would rather review the volume first.
  • Happy to attach viewport screenshots in a comment if that helps the review.

Draw a dashed wireframe box for a 3D printer's build volume or for a
woodworking machine's working area, toggled from the viewport toolbar.
The volume is a global preference rather than document geometry, so it
cannot be selected, moved, copied, saved or exported with the project.

- 256 mm default, entered in the workspace display units
- the volume's base centre sits at the origin
- toggling on frames the volume; toggling off leaves the camera alone
- a persistent warning appears when geometry leaves the volume
- an optional shortcut is available and unassigned by default
- hiding the toolbar toggle also hides the volume

Fixes BenchUp3D#69

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dannycoulombe

Copy link
Copy Markdown
Collaborator

Thanks @VR-Architect! I will check it out tonight. To answer your question, I use the gh command-line to check PRs and switch context. It's very quick and effective.

No need to split the warning part.

@dannycoulombe dannycoulombe changed the title Add a locked 3D printer and tool volume reference (#69) Add printer/tool volume reference and live agent editing Nov 16, 2026
@dannycoulombe dannycoulombe changed the title Add printer/tool volume reference and live agent editing Add a locked 3D printer and tool volume reference Nov 16, 2026
@dannycoulombe

Copy link
Copy Markdown
Collaborator

Somehow, my AI managed to change this PR's title and description. Sorry for any confusion this may have caused!

I am reviewing this PR as I am writting these lines.

@dannycoulombe
dannycoulombe self-requested a review November 16, 2026 12:21
@dannycoulombe

Copy link
Copy Markdown
Collaborator

Really nice functionality! So far made a few minor adjustments:

  • Renamed it to "Reference Volume" to make it more generic and less specific to 3D printing.
  • Moved the settings to the View menu, just below Sections to make it more accessible.
  • The shortcut is now managed through Shortcut Management in Settings.
  • Fixed an issue where zooming in and out of the viewport would cause the cube to progressively disappear.
image

As for the reference volume being part of the general settings, I think we can leave it as is for now. I'm considering adding an option to override settings on a per-project basis in the future.

I'm continuing to test this feature now.

@VR-Architect

Copy link
Copy Markdown
Author

I do not know if woodworkers have multiple equipments that have volume concerns or not. Some 3D printer folks have more than one printer. If desired a list of volumes with a description label could be added and the user could select the volume on the canvas. But to be honest, I am happy just to have one reference volume :) --- thanks for all the help. this was my first github collaboration so I hope I did everything correctly?

@dannycoulombe

dannycoulombe commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

We could definitely support multiple volumes, yes! And it's probably better to do it now so we won't have to maintain backward compatibility with a legacy single-object format instead of an array of values after release.

this was my first github collaboration so I hope I did everything correctly?

Yes, of course! And the beauty of the MIT license is that the code doesn't belong exclusively to its creator. Everyone is free to use, modify, and build upon it.

You don't need to ask for permission. Just submit your pull requests! If they align with the maintainer's vision for the parent project, they'll be merged. Otherwise, you'll still have the features you want in your own fork, and you can continue syncing it with the upstream repository to benefit from future updates.

Maybe you want to fork BenchUp and make it TrainsUp ;-).

@dannycoulombe

Copy link
Copy Markdown
Collaborator

I pushed my changes to the PR.

I also took the liberty of highlighting the parts that extend beyond the reference volume in red:

image

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants