How it works, and how it's tested
Bolt & Grain is a static web page. All calculations and file generation happen in your browser.
Formulas
- Usable width = bolt width × (1 − width shrinkage %) − 2 × selvage.
- Cut size = entered size + 2 × seam allowance on both dimensions, unless the piece is marked "allowance already included".
- Fabric on hand after washing = length × (1 − length shrinkage %).
- Used length = the far edge of the last piece along the fabric, which is the orange dashed line in the diagram.
- Waste % = 1 − (total cut-piece area ÷ (usable width × used length)). Fabric beyond the used length isn't counted as waste.
- Buy = used length ÷ (1 − length shrinkage %), plus one repeat when aligning to the repeat. Rounded up to the next ⅛ yd or 10 cm.
- Repeat alignment: each piece's length plus gap is rounded up to a whole number of repeats, so every piece starts on a repeat line (y = 0, R, 2R…).
Orientation rules
Every piece's grainline runs along its length. Lengthwise pieces are placed at 0° or 180°, crosswise at 90° or 270°, and "no grain needed" pieces at any quarter turn. With nap or a one-way print, 180° and 270° aren't allowed and no-grain pieces stay at 0°. "Allow rotation" off keeps a piece in its first orientation.
Packing
Auto-arrange uses the MaxRects rectangle-packing heuristic on a strip of usable width. It tries 12 combinations of sort order (length, area, longest side, width) and placement rule (bottom-left, best short-side fit, best area fit), and keeps the one that places the most pieces in the shortest length. It is not optimal and does not do garment nesting: pieces are rectangles, and curved pattern pieces would need their real outlines. See the limits of automatic layout.
Manual moves are checked by an independent conflict checker, which tests every pair of pieces for overlap and gap and checks bounds, orientation and repeat alignment. Conflicts are outlined in red and listed. If a piece is too wide for the usable width in every allowed orientation, or the layout is longer than the fabric you have, you get a warning with the numbers.
Exports
- PDF overview + cutting list on A4 or Letter, at a stated ratio (1:5, 1:10, 1:20 …) with a scale bar and a 50 mm check bar. Long layouts continue on extra pages at the same scale. They're never shrunk to fit. It is a diagram, not a full-size pattern.
- Full-size SVG: width and height in real millimetres, for projectors or plotters. Not tiled for home printers.
Tests
- Hand-checked examples: 2×2 squares; a 100 cm square plus four 50 cm squares; strips with and without gaps; seam-allowance growth; 5 % shrinkage (100 ÷ 0.95 = 105.26 → 110 cm); width shrinkage (112 × 0.97 − 2 = 106.64 cm); 64 cm repeat (114 cm used, 178 cm to buy); crosswise strips; nap blocking a rotation; shortfall; rounding.
- Property test over 300 random fabrics and piece lists. Each layout is checked by the independent checker. Quantities are accounted for. Unplaced pieces are confirmed to be really too wide. Used length is never below the area bound. Nap orientations are respected.
- Exports and projects: the PDF is parsed (page size, stated scale) and checked with Poppler. SVG sizes and the used-length line are parsed. Project files survive a round trip, and malformed or malicious ones are rejected.
- Browser: headless Chrome on desktop and mobile covers every page, editing (drag, rotate, copy, remove, undo), exports, project reopen, and a log of every network request.
Who runs this
Bolt & Grain is operated by SPAZ Power LLC. It's free, with no account. Feedback: 55paz.power@gmail.com. Estimates depend on your measurements, so always check against the real fabric before cutting. We can't be responsible for fabric or materials.