# Threadsmith Marker Layout > Lay sewing pattern pieces on your fabric width with the grain respected; get length and efficiency. Places pattern pieces on a fabric of the width you have, as tightly as a deterministic bottom-left fill can: every piece keeps its grainline along the selvage (turned 180° when allowed, 90° only for cross-grain cutting, never for napped or one-way fabric), pairs get a mirrored copy, and pieces cut on the fold are unfolded on open fabric or put against the fold of folded fabric. You get the marker length — how much fabric to buy — the efficiency (piece area ÷ fabric area), the lower bound, the position and turn of every piece, a picture of the layout and an SVG or DXF of the marker. Pieces come from a JSON list or are drafted on the spot from bust, waist and hip. Part of usefulweb.site (https://usefulweb.site/). Part of [Threadsmith](https://threadsmith.usefulweb.site/) (ownerApp: threadsmith). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://threadsmithmarkerlayout.usefulweb.site/ (interactive tool at https://threadsmithmarkerlayout.usefulweb.site/tool) - JSON API: POST https://threadsmithmarkerlayout.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://threadsmithmarkerlayout.usefulweb.site/api/v1/tool) - OpenAPI: https://threadsmithmarkerlayout.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://threadsmithmarkerlayout.usefulweb.site/mcp - tool `threadsmith_marker_layout` ## Inputs - source (select): Pieces from - units (select): Units of all lengths - pieces (textarea): Pieces (JSON) - Array of {name, polygon: [[x, y], …] or path: "M … Z", grain (degrees, 90 = along +y), quantity, pair (true = half mirrored), fold: [[x1, y1], [x2, y2]]}. The whole result of threadsmith-pattern-block ({"pieces": […]}, in mm) is accepted too. - blocks (multiselect): Blocks (when drafting) - bust (number): Bust / chest girth (when drafting) - waist (number): Waist girth (when drafting) - hip (number): Hip girth (when drafting) - seamAllowance (number): Seam allowance (when drafting) - Empty = 1.5 cm or 5/8 in. - hemAllowance (number): Hem allowance (when drafting) - Empty = 4 cm or 1 1/2 in. - fabricWidth (number): Usable fabric width - Selvage to selvage minus edges you cannot use. Empty = 140 cm or 54 in. - mode (select): Fabric - crossGrain (boolean): Allow cross-grain (90°) placement - napped (boolean): Napped or one-way fabric (no 180° turns) - gap (number): Gap between pieces - Empty = 0. - resolution (select): Layout raster - output (select): File ## Method - Every piece is turned so its grainline runs along the selvage (the marker length). Allowed turns: 0° and 180° (only 0° on napped or one-way fabric), plus 90° and 270° when cross-grain cutting is allowed. Pairs get a mirrored copy for every second piece; on folded fabric each placement cuts two layers, so pairs need half the copies, and fold pieces must lie with their fold edge on the fabric fold. - Fabric and pieces are rasterised (2, 5 or 10 mm cells). A piece’s footprint is conservative: every cell the polygon (dilated by half the gap) touches is taken, so placed pieces never overlap. Bottom-left fill: each piece goes to the position with the smallest marker end, then the leftmost, then the lowest free spot, over all its allowed turns. - Three deterministic orders are tried (by area, by length, by width, largest first) and the shortest marker is kept. The result is verified exactly: no two cutting lines cross or contain each other and every piece lies within the usable width. - Efficiency = sum of piece areas ÷ (marker length × usable width). The lower bound (area ÷ width) shows how far any layout could get; real shapes rarely reach it. ## Limits - Lay the pieces out on the real fabric before cutting: check the print direction, stripes and checks (matching is not planned), and buy a little extra for shrinkage and straightening the grain.