Overview
Gridfinity bins are generated using CSG (Constructive Solid Geometry) operations with the Manifold WASM engine. Each bin is built through a series of boolean operations to create the final printable mesh.Base Profile
The base profile is the foundation of every Gridfinity bin, providing interlocking with baseplates.Z-Profile Structure
The base consists of a 5-layer stepped profile from Z=0 to Z=4.75mm:- Layer 5 is a full-width slab (no shrink) from Z=2.95 to Z=4.75mm
- Layers 1-4 create the stepped chamfer profile for baseplate interlocking
- Each layer uses a tapered extrusion where top and bottom widths differ
Per-Cell Base Generation
For multi-cell bins:- Each cell gets its own complete Z-profile base
- Cells are positioned at 42mm spacing
- A full-width slab bridges the inter-cell gaps at Z=2.95→4.75mm
- This ensures proper interlocking across the entire bin footprint
src/gridfinity/binGeometry.ts:427-493
Body Geometry
The bin body sits on top of the base profile, starting at Z=4.75mm.Dimensions
Corner Radius
- Default: 3.75mm (official Gridfinity specification)
- Range: 0mm (sharp) to 3.75mm (standard)
- Inner radius:
max(0, cornerRadius - wallThickness) - Corner radius is clamped to prevent exceeding bin dimensions
Wall & Bottom Thickness
These values provide structural strength while keeping bins lightweight and print-friendly.
Implementation reference:
src/gridfinity/binGeometry.ts:250-279
Features
Stacking Lip
The stacking lip allows bins to stack vertically with alignment:- Height: 4.4mm (constant
GF.STACKING_LIP_HEIGHT) - Profile: Mirrors the baseplate socket profile
- Location: Added to the top rim of the bin
- Prevents bins from sliding when stacked
Label Shelf
A 45-degree angled cutout on the front wall for labels:- Angle: 45 degrees (constant
GF.LABEL_ANGLE) - Default width: 12mm (constant
GF.LABEL_DEFAULT_WIDTH) - Configurable: Can be adjusted per bin
- Geometry: Wedge-shaped cutout that tapers from full depth at rim to outer face
- Full cut at the rim (bodyTopZ)
- Tapers to outer wall face at
bodyTopZ - shelfHeight - Extends across the full bin width
src/gridfinity/binGeometry.ts:151-210
Magnet Holes
- Diameter: 6mm + 0.5mm clearance = 6.5mm actual
- Depth: 2mm + 0.4mm clearance = 2.4mm actual
- Position: 4 holes per cell at each corner
- Inset: Calculated to clear corner radius:
max(8.0, cornerRadius + holeRadius + 1.0) - Deduplication: Internal corners in multi-cell bins share holes (no duplicates)
src/gridfinity/binGeometry.ts:115-131
Screw Holes
- Diameter: 3.2mm (M3 clearance)
- Depth: Through base (4.75mm)
- Position: 4 holes per cell at each corner
- Inset: Same calculation as magnet holes
- Purpose: Alternative attachment method for non-magnetic baseplates
src/gridfinity/binGeometry.ts:133-148
Interior Dividers
Dividers create compartments within a bin:Configuration
- dividersX: Number of vertical walls parallel to Y-axis (divide X span)
- dividersY: Number of vertical walls parallel to X-axis (divide Y span)
- Range: 0 to 9 per axis
- Thickness: Same as wall thickness (1.2mm default)
- Height: Full cavity height
Spacing
Dividers are evenly spaced across the inner cavity:src/gridfinity/binGeometry.ts:213-246
Multi-Cell Bins
Bins spanning multiple grid cells follow these rules:Cell Spacing
- Cells are positioned at 42mm intervals along X and Y axes
- Each cell is centered relative to the bin center
- Offset calculation:
(cellIndex - (cellCount - 1) / 2) × 42mm
Base Profile Generation
- Generate individual Z-profile bases for each cell
- Position each base at its cell offset
- Union all cell bases together
- Add a full-width slab to bridge inter-cell gaps (Z=2.95→4.75mm)
Hole Deduplication
Internal corners between cells in multi-cell bins:- Have only one set of holes (not duplicated)
- Use position rounding (0.01mm precision) to detect overlaps
- Prevents interference and unnecessary geometry
- 4 corner holes at outer corners
- 1 shared hole at the center
- Total: 5 hole positions (not 16)
src/gridfinity/binGeometry.ts:87-113
Geometry Pipeline
CSG Algorithm
Each bin is built through boolean operations:- Base — Per-cell Z-profile bases + full-width slab
- Outer shell — Rounded box for body dimensions
- Inner cavity — Subtracted to create hollow interior
- Union — Base + hollow body
- Subtract — Magnet holes, screw holes, label shelf
- Add — Interior dividers, stacking lip
Preview vs Export
Preview geometry (for 3D viewport):- Simplified flat base (single slab, Z=0→4.75mm)
- Faster generation for real-time interaction
- Includes all features for visual accuracy
- Full 5-layer Z-profile base per cell
- Exact dimensions for printing
- Manifold watertight meshes
src/gridfinity/binGeometry.ts:388-538
All geometry is generated using the Manifold WASM CSG engine, ensuring watertight, printable meshes for 3D printing.
