Skip to content

Support custom bin sizes in mm - #10

Merged
1Richter merged 3 commits into
mainfrom
feat/custom-bin-size-mm
Aug 4, 2026
Merged

Support custom bin sizes in mm#10
1Richter merged 3 commits into
mainfrom
feat/custom-bin-size-mm

Conversation

@1Richter

@1Richter 1Richter commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Draft PR opened for review. Branch: feat/custom-bin-size-mm.

Leon Richter and others added 3 commits August 3, 2026 15:19
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
1Richter force-pushed the feat/custom-bin-size-mm branch from bc4db3b to 1a6e7a8 Compare August 4, 2026 12:09
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.
@1Richter
1Richter merged commit 21679cc into main Aug 4, 2026
4 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.

1 participant