Skip to content

Add half-grid support for bins#115

Merged
jasonmadigan merged 1 commit into
mainfrom
101-half-grid-support
Jun 27, 2026
Merged

Add half-grid support for bins#115
jasonmadigan merged 1 commit into
mainfrom
101-half-grid-support

Conversation

@jasonmadigan

Copy link
Copy Markdown
Collaborator

Closes #101

What

Adds half-size grid support:

  • Fractional bin dimensions: grid_x/grid_y accept 0.5-unit increments (e.g. 3.5×2.5), validated at the schema level
  • Half-grid baseplate: half_grid_base toggle switches the bottom baseplate from 42mm to 21mm cells for finer positioning on baseplates
  • Frontend controls: grid sliders step by 0.5, half-grid base toggle in bin configurator, half-grid lines rendered in the editor canvas

How

Backend:

  • BinParams.grid_x/grid_y changed from int to float with 0.5-increment validator
  • _base_cell_layout() computes cell centres and widths for any cell size, handling partial trailing cells for fractional grids
  • Magnet holes placed per full 42mm cell only (fractional trailing cells skipped)
  • Split points use half-grid granularity when half_grid_base is enabled
  • Auto-sizing snaps to 0.5-unit increments
  • Project-level target_grid_x/target_grid_y also updated to float

Frontend:

  • Grid sliders accept 0.5 steps
  • Half-grid base toggle in BinConfigurator
  • BinEditorCanvas renders half-grid lines when enabled
  • Homepage preview grid lines handle fractional sizes

Test evidence

185/185 backend tests pass (16 new in test_half_grid.py). TypeScript type check clean.

New tests cover: validation (valid/invalid increments, boundaries), cell layout (full and half grid, integer and fractional), STL generation (fractional dimensions, half-grid base), magnet placement, stacking lip, and splitting with fractional grids.

@jasonmadigan
jasonmadigan force-pushed the 101-half-grid-support branch 3 times, most recently from 8e6298f to 6925736 Compare June 27, 2026 15:59
@jasonmadigan
jasonmadigan marked this pull request as ready for review June 27, 2026 16:21
@jasonmadigan
jasonmadigan force-pushed the 101-half-grid-support branch 2 times, most recently from 0b5d063 to dd7a034 Compare June 27, 2026 20:00
- grid_x/grid_y accept 0.5-unit increments (e.g. 3.5x2.5 bins)
- half_grid_base toggle: 21mm baseplate cells instead of 42mm
- magnets incompatible with half-grid (forced off at model layer,
  toggle disabled in UI)
- auto-size snaps to 0.5u when half-grid on, 1u when off
- fractional bin boundary lines visible in editor
- frontend: 0.5-step sliders, half-grid toggle, half-grid lines
- 20 new backend tests

Signed-off-by: Jason Madigan <[email protected]>
@jasonmadigan
jasonmadigan force-pushed the 101-half-grid-support branch from dd7a034 to a78049a Compare June 27, 2026 20:01
@jasonmadigan
jasonmadigan merged commit 4c63fdb into main Jun 27, 2026
3 checks passed
@jasonmadigan
jasonmadigan deleted the 101-half-grid-support branch June 27, 2026 21:59
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.

Feature Request: Half size grid support for bins

1 participant