Přejít na hlavní obsah
← CutOptim Engine APIEngine API · live today

Timber & Structural Wood Cutting API

Yes — there is an API for cutting structural timber to length. Cutting joists, rafters, studs, battens and boards to length is a 1D cutting-stock problem with an extra rule that plain linear cutting ignores: the cross-section has to match. A 50×150 part cannot come out of a 50×100 bar. The CutOptim Engine API solves it over HTTP at POST /v1/optimize/wood — your ERP, estimating or timber-yard software sends the cut list and the available stock as JSON and gets back the optimized cut plan, matched and solved per cross-section, with the bar count and the yield.

This is a distinct mode, not a wrapper over /v1/optimize/1d: linear 1D treats every bar as interchangeable, whereas timber has an identity — the section must match. Sending N grouped 1D requests instead costs N calls for one job, moves the stock matching to you, and yields a total that does not agree with what the app shows. This endpoint does the matching and returns the whole job in one call, per section and job-wide.

POST /v1/optimize/wood
POST /v1/optimize/wood
{
  "parts": [
    { "name": "Rafter", "sw": 50, "sh": 150, "length": 3200, "qty": 8 },
    { "name": "Noggin", "sw": 50, "sh": 100, "length": 600, "qty": 24,
      "meta": { "ref": "C24-50x100" } }
  ],
  "stock": [
    { "name": "C24 50x150", "sw": 50, "sh": 150, "length": 4800, "qty": 20, "price": 18.4 },
    { "name": "C24 50x100", "sw": 50, "sh": 100, "length": 4800, "qty": 30, "price": 12.5 }
  ],
  "options": { "kerf": 3 }
}
  • — Live today on POST /v1/optimize/wood — the same engine as the app, cross-section aware.
  • — Sections matched and solved independently: a 50×150 part is only cut from 50×150 stock.
  • — sections[] carries per-section rods, totals and cut plan; unmatched reports demand with no stock at all.
  • — Deterministic and version-pinned — reproduce a cutting quote for an audit or a repeat order.
  • — The reported off-cut is the usable remainder — the freeing kerf is already deducted (per bar).
  • — Free validation: POST /v1/validate/wood checks a job with no key and no quota.

Why carpenters and timber merchants need it

Structural timber is bought in long lengths and cut to many parts, and cutting in list order wastes a published 15–30% of the stock. A cross-section-aware optimizer rearranges the cuts within each section to cut that sharply. Inside an estimating, ERP or point-of-sale workflow the API does it on every job automatically — a builder’s merchant can price and plan a cutting service straight from the order, and the plan reconciles with what the yard actually cuts.

Cross-section matching — the part of the problem 1D drops

Each part and each stock row carries two cross-section sides, sw and sh, in either order (50×150 and 150×50 are the same bar turned over). The engine partitions the job by cross-section, matches each part only to stock of a compatible section, and solves every section independently. The response comes back as sections[], each with its own rods, its own totals and its own cut plan, plus job-wide metrics — and demand whose cross-section has no stock at all is reported separately in unmatched, distinct from parts that had stock and simply did not fit, because the fix differs.

Deterministic — reproducible for quotes and audits

The same request always returns the same cut plan: no randomness, no clock in the algorithm. A cutting quote built from an API call can be reproduced months later for an audit or a repeat order, and results can be cached and diffed in tests. The reported off-cut on each bar is the usable remainder — the freeing kerf is already deducted — and any meta object you attach (an article number, an order line) comes back on every placed cut so the plan reconciles with your system.

Materiál ke stažení
Timber Cutting API one-pager

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.

PDF2 pagesFree
Stáhnout PDF

FAQ

Často kladené otázky

Is there an API for timber or structural wood cutting?
Yes. Cutting timber — joists, rafters, studs, battens, boards — to length with cross-section matching is the CutOptim Engine API’s wood mode, POST /v1/optimize/wood. You send the cut list and the stock as JSON, each with two cross-section sides, and get back the optimized cut plan matched and solved per section, with the bar count, the yield and the usable off-cuts. It is the same engine that runs the app, over HTTP.
Why not just use the 1D endpoint for timber?
Because 1D treats every bar as interchangeable, and timber does not: a 50×150 part cannot come out of a 50×100 bar. The wood endpoint partitions the job by cross-section, matches each part to compatible stock and solves each section on its own, returning per-section as well as job-wide totals. Fanning the job out into several 1D calls instead would cost one call per section, move the stock matching to you, and produce a total that does not agree with the app.
What happens to a part whose cross-section is not in stock?
It comes back in a separate unmatched list — demand whose cross-section has no stock at all — kept distinct from unplaced (parts that had matching stock and did not fit), because the fix differs: one is "buy or declare the section", the other is "add length". A part that cannot be fully placed is never an error; it is a 200 with the pieces reported so you can act on the plan. You can also validate for free at POST /v1/validate/wood, with no key and no quota.

Woodworking use case (app) · Benchmarks