Support custom bin sizes in mm - #10
Merged
Merged
Conversation
Bins could only be sized in gridfinity units (1-10u, 0.5 steps), so a
drawer or shelf that is not a multiple of 21mm either wasted space or did
not fit.
BinParams gains size_mode ("units" | "custom") plus custom_width_mm /
custom_depth_mm (42-1000mm). In custom mode the mm size is authoritative
and grid_x/grid_y are derived from it, so base cells, magnets, the
partial-bin mask, label cells and bed splitting keep working in the
fractional units they already supported. _outer_dims() is now the single
place resolving the footprint: unit bins keep the 0.5mm gridfinity
clearance, custom bins are built to exactly the requested outer size.
Two related fixes fall out of arbitrary sizes:
- _base_cell_layout folds a trailing remainder thinner than 14mm into the
previous cell; below that a base unit's tapered profile inverts and the
whole shell came out empty.
- _compute_split_points rounds the half-unit count up, so the trailing
remainder is accounted for and the last piece cannot overflow the bed.
Bins written before this change have no size_mode key and load as "units",
so no migration is needed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Self-review follow-ups on custom mm bins: - The UI derived the mm size back from the grid, and mm / 42 * 42 is not exact for 122 of the sizes in range, so a 46mm bin displayed as 46.00000000000001. binSizeMm() reports the stored value instead. - split_bin measured a custom bin by its rounded-up cell count, up to 42mm larger than the bin, which could force a split on a bin that fits the bed diagonally. The 2D canvas also mis-renders the partial-bin mask on a fractional grid, but that predates custom sizes and is fixed on fix/half-grid-cell-placement, so it is left to that branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
drawer_service.py is orphaned: nothing imports it and it cannot even be imported, because DrawerBin was removed from schemas when drawer_store was deleted. Teaching its bin rotation about custom mm sizes only made dead code look live. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1Richter
force-pushed
the
feat/custom-bin-size-mm
branch
from
August 4, 2026 12:09
bc4db3b to
1a6e7a8
Compare
1Richter
added a commit
that referenced
this pull request
Aug 4, 2026
Brings together every open self-host PR (#2-#16) on top of upstream 0.8.0+7: #2 fix/half-grid-cell-placement #10 feat/custom-bin-size-mm #3 feat/split-multi-part #11 feat/cutout-line #4 feat/preview-bed-size-grid #12 feat/dashboard-hide-project-bins #5 fix/split-parts-3mf-export #13 feat/persist-tracer-selection #6 feat/always-export-3mf #14 feat/tool-quantity-duplicates #7 ci/run-frontend-tests #15 feat/unload-idle-models #8 feat/bin-editor-cutout-depth-cap #16 fix/clamp-autosize-grid #9 feat/bin-editor-cutout-editing Verified: 401 backend tests, 189 frontend tests, ruff and tsc clean.
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.
Draft PR opened for review. Branch:
feat/custom-bin-size-mm.