Overview
The Auto-Fill feature analyzes your grid to find all available empty space and fills it with bins of a specified size. Combined with the Optimize Layout tool, you can efficiently pack bins and minimize wasted baseplate area.Auto-Fill Empty Space
Fill all unoccupied grid cells with identical bins:How It Works
- Select bin size (W × D × H) using quick presets or custom dimensions
- Click “Auto-Fill Grid” button in sidebar
- Algorithm scans grid for empty cells (left-to-right, top-to-bottom)
- Places bins at valid positions (collision-checked)
- Grid updates with newly added bins
- 3D preview renders all new geometry
Fill Algorithm
- Greedy approach: Fills top-left first
- Collision detection: Skips occupied cells
- Partial fills: Places as many as fit (may leave gaps)
Auto-fill does not remove existing bins. It only fills empty space around your current layout.
Bin Size Presets
Quick-select common bin sizes:1×1×3u
Small parts bins
- Screws, resistors
- 41.5 × 41.5 × 25.75mm
1×2×3u
Cable/tool bins
- USB cables, drivers
- 41.5 × 83.5 × 25.75mm
2×2×3u
Medium storage
- Socket sets, modules
- 83.5 × 83.5 × 25.75mm
Custom Dimensions
Specify any valid bin size:- Width: 1-10 cells
- Depth: 1-10 cells
- Height: 1-12 units
- Number inputs with validation
Optimize Layout
Find the smallest baseplate that fits all your bins:Bin-Packing Heuristic
The optimizer uses a greedy bin-packing algorithm:- Sort bins by area (largest first)
- Try grid sizes from smallest to largest:
- Start at minimum bounding box
- Increment by 1 cell
- Test up to 12×12 max
- For each grid size, attempt to pack all bins:
- Place each bin at first valid position
- Scan left-to-right, top-to-bottom
- Backtrack if placement fails
- Return first valid configuration
Algorithm Details
Use Cases
1. Uniform Bin Grids
Goal: Fill entire baseplate with identical bins Steps:- Start with empty grid
- Select bin size (e.g., 1×1×3u)
- Click “Auto-Fill Grid”
- Result: Fully packed baseplate
2. Mixed Layouts
Goal: Add filler bins around custom designs Steps:- Manually place large bins (2×3, 3×4, etc.)
- Select small filler size (1×1 or 1×2)
- Auto-fill remaining space
- Result: No wasted cells
3. Baseplate Optimization
Goal: Minimize baseplate size for a bin collection Steps:- Add all required bins (any size)
- Click “Optimize Layout”
- Grid resizes to smallest fit
- Bins rearrange automatically
- Export optimized layout
Grid Size Presets
Quickly resize grid to common printer sizes:| Preset | Grid | Real Size |
|---|---|---|
| Bambu Lab A1 | 6×6 | 252×252mm |
| Bambu Lab A1 Mini | 4×4 | 168×168mm |
| Bambu Lab P1S | 6×6 | 252×252mm |
| Bambu Lab X1C | 6×6 | 252×252mm |
| 19” Server Rack | 10×8 | 420×336mm |
| Custom | Any | Any |
Grid presets clear the current layout. Save your design first if needed.
Fill Strategy Options
Future enhancements (not yet implemented):- Fill mode: Dense vs. sparse
- Color alternation: Checkerboard patterns
- Height variation: Random or gradient heights
- Feature randomization: Random dividers, magnets
Bill of Materials (BOM)
After auto-filling, view the generated BOM:Bin Count by Type
Grouped summary:Material Estimate
- Total volume: Sum of all bin volumes (cm³)
- PLA weight: Volume × 1.24 g/cm³ density
- Cost estimate: Weight × price per kg
- Default: €20/kg
- Configurable in settings
Example BOM Calculation
Example BOM Calculation
Layout: 10× (2×2×4u bins)Geometry:
- Outer volume: ~120cm³ per bin
- Hollowed (walls/bottom): ~40cm³ per bin
- Material: 10 × 40cm³ = 400cm³
- Weight: 400cm³ × 1.24 g/cm³ = 496g
- Cost: 496g × €20/kg = €9.92
Print Labels
Generate a printable reference sheet:- One row per bin
- Columns: Name, Dimensions, Grid Position, Features
- Printer-friendly layout
- Useful for organizing physical bins
Performance Considerations
Auto-Fill Speed
- Small bins (1×1): Fast (~0.1s per bin)
- Large bins (3×3): Slower (~0.5s per bin)
- Web Worker: Geometry generation offloaded
- Batch updates: UI updates every 5 bins
Optimize Layout Speed
- 10 bins: <1 second
- 50 bins: 2-5 seconds
- 100+ bins: May timeout (not recommended)
Undo/Redo Support
All auto-fill and optimize operations are undoable:- Ctrl+Z: Undo last operation
- Ctrl+Shift+Z: Redo
- Full history stack preserved
Tips & Best Practices
Auto-fill uses the current bin defaults from the configurator (wall thickness, corner radius, etc.).
Keyboard Shortcuts
No dedicated shortcuts yet, but you can:- Ctrl+Z after auto-fill to undo
- Ctrl+A to select all bins (useful after auto-fill)
- Delete to remove all selected bins
Technical Implementation
- Collision detection: AABB (Axis-Aligned Bounding Box)
- Bin packing: Greedy first-fit decreasing heuristic
- Grid scanning: Row-major order (top-left to bottom-right)
- State management: Zustand store with history tracking
- Geometry generation: Web Worker (async)
Collision Detection Algorithm
Related Features
2D Grid Canvas
View and edit auto-filled bins
Bin Configurator
Configure bin parameters for auto-fill
