Laser Cutting Nesting API
Yes — there is an API for laser cutting nesting. Cutting irregular parts on a laser is a true-shape nesting problem: a part is an arbitrary polygon, not a rectangle, and parts interlock into each other’s concave pockets. The CutOptim Engine API solves it over HTTP at POST /v1/optimize/nest — your CAD/CAM, ERP or quoting software sends the part outlines and the stock sheets as JSON and gets back the nested layout, the placement of every part and the sheet count.
This is live today. Nesting is a different class of algorithm from the rectangular guillotine packer — a geometric collision engine (jagua-rs) that runs in production behind POST /v1/optimize/nest — so it returns a true-shape nest, not a rectangular cut plan.
Every format, engine, limit and code sample for developers: CutOptim nesting API
{
"parts": [
{ "name": "bracket",
"polygon": [[0,0],[300,0],[300,100],[100,100],[100,300],[0,300]],
"qty": 12, "allowedRotations": "continuous" },
{ "name": "gusset",
"polygon": [[0,0],[280,0],[140,240]],
"qty": 8, "allowedRotations": [0,90,180,270] }
],
"stock": [{ "w": 3000, "h": 1500, "qty": 20 }],
"options": { "minSeparation": 0.3, "edgeClearance": 5 }
}Nesting isn't in the public demo — run this example with a free test key. Create a free test key
- Live today on
POST /v1/optimize/nest— arbitrary polygon parts (with holes), not just rectangles. - Per-sheet exclusion zones keep parts off a defect, a clamp footprint or a pre-printed area (
stock[].exclusions). - Continuous or discrete rotation,
minSeparationfor the part spacing andedgeClearancefor the sheet edge. - Cut length and pierce count per sheet, plus sheets and price per sheet size (
stockUsage) — several sheet sizes may be mixed where that is cheaper. - On a representative 272-part job the nest used 6 sheets where the same parts by bounding box need 9 — the honest metric is sheet count, not a density percentage.
- Deterministic: a pinned seed makes the same request return the same nest, for quotes and audits.
- Free validation:
POST /v1/validate/nestchecks a job with no key and no quota.
Why laser shops need true-shape nesting
A rectangular packer counts each part’s bounding box as solid, so the notch-air inside an L-bracket or a triangular gusset is wasted. True-shape nesting interlocks the actual outlines, reclaiming that air. On a representative 272-part job the nest used 6 sheets where the same parts placed by bounding box need 9 — the honest metric is sheet count on the same parts, not a density percentage (a bounding box reads a higher density for a worse result).
What you send and what comes back
Send each part as a polygon outline (with optional interior holes) and a quantity, plus the stock sheets. The response gives the placement of every copy as a rigid transform — a rotation in degrees, then an x/y translation — not a re-emitted polygon: rotate your input outline and add the offset to reconstruct the placement exactly. It also returns the sheet count, the per-sheet and overall density, and any parts that did not fit — and for every sheet the stock row it was cut from, the cut length (the contour the beam follows, outlines and holes) and the pierce count, with stockUsage totalling sheets and price per sheet size. Give several sheet sizes and the nest compares them — by sheet area, or by price with minimizeCost — and may mix them where that is cheaper, for example moving a half-empty last sheet to a smaller size. Ask for include:["svg","dxf"] and the achieved layout comes back as a file inline.
Exclusion zones and continuous rotation
Two things a rectangular API cannot express come with the nesting engine. Per-sheet exclusion zones (stock[].exclusions) keep every part off a defect, a clamp footprint or a pre-printed area — a quality-0 zone is a hard no-go region. Rotation can be continuous (any angle) or a discrete list; options.minSeparation sets the spacing between parts (the beam width) and options.edgeClearance the distance to the sheet edge, so the two can differ. The layout is deterministic: set options.seed and the same request returns the same nest.
Instant for the quote, max for the order
POST /v1/optimize/nest answers synchronously with the lbf engine — deterministic and inside the request, fast enough to price a job while the customer waits. When the job is released to the machine, send the same body with engine: "max" and poll GET /v1/jobs/{id}: it runs lbf first, then spends a time budget you set (options.timeBudgetMs) looking for a layout with fewer sheets, and never returns more. The response has the same shape either way; a sheet with exclusion zones is still served by lbf inside that job, with a warning.
A two-page summary — the problem, what you send and get back, a request and response, and how to build on the engine. Print-ready, with a QR back to this page.
FAQ
Is there an API for laser cutting nesting?
POST /v1/optimize/nest. You send each part as a polygon outline (with optional holes) plus the stock sheets, and get back the nested layout, the placement of every copy and the sheet count. It is a geometric collision engine, a different class of algorithm from the rectangular guillotine packer, and it runs in production today.How is true-shape nesting different from rectangular packing?
Can it avoid a damaged area or a clamp footprint on the sheet?
stock[].exclusions) — polygons the engine keeps parts off. A quality-0 zone is a hard no-go region for every part, so you can nest around a defect, a clamp footprint or a pre-printed area. This is a capability the rectangular API cannot express.Can I validate a request for free while integrating?
POST /v1/validate/nest schema-validates the same body the nest endpoint takes without solving — free, no API key, no quota — so your team can confirm a payload is well-formed while building the integration. The Engine API itself has a 14-day trial.Does it return the cut length and the pierce count?
cutLength — the summed perimeter of its placed parts’ outlines and holes, in your unit — and pierces, one per closed contour; metrics totals both. It is the geometric contour length: common-line cutting, lead-ins and micro-joints are not included, because your machine’s CAM adds those, so it is a sound base for machine time and gas rather than the final tool path.Can my quoting system charge only the used part of a sheet?
usedWidth and usedHeight — the farthest point its placed parts reach from the sheet origin, in your unit — and usedArea, their product (stockUsage totals it per sheet size). A horizontal cut is usedHeight × the sheet width, a vertical cut usedWidth × the sheet height, a bounding box usedArea. Both engines also compact the least-filled sheet toward that corner by default, trying rotation subsets of what each part allows and never a new angle, without changing the sheet count, price or placed parts; options.compact: false turns it off. If you charge a strip instead of the box, options.compactFor: "horizontal" keeps the lowest used height and "vertical" the smallest used width. How small the used area gets depends on the parts.