VirkeKapning API

Cut Plan Demo

Edit the JSON request to calculate what stock boards to buy, which cuts to make at the lumber yard, what should be cut at home, which transport container each piece fits into, and the estimated total weight. Demo calls are limited to two requests per IP address during a rolling 24-hour window.

Request Reference

The request is split into global defaults and one or more board dimensions. Each dimension is optimized independently, then the response is summarized across the full request.

Global Settings

transportContainers
Optional list of available carriers, for example a trailer and a car. If omitted, the legacy maxTransportLengthCm value is used as one unnamed container.
defaultStockLengthsCm
Stock board lengths available for dimensions that do not define their own stockLengthsCm, typically values such as 360 and 420.
sawKerfMm
Saw blade width in millimeters. The optimizer reserves this loss for both lumber-yard cuts and final home cuts.
extraMarginPerTransportPieceCm
Optional extra length kept on every transported piece to give final home cuts more room.
maxExtraStockLengthCm
Search limit for how much extra stock may be bought beyond the final required lengths. A larger value gives the optimizer more room but can take longer.
optimizationGoal
Default trade-off for all dimensions unless a dimension overrides it.

Transport Containers

name
Display name used in the response, such as Trailer or Car.
maxLengthCm
Longest transported piece that fits in this container.
maxWeightKg
Optional weight cap. If only one container is available and the calculated load exceeds the cap, the API still returns a plan with a warning.
loadPriority
Optional loading preference. Lower numbers are filled first, which is useful when the trailer should carry most pieces and the car should be a backup.

Board Dimensions

dimension
Label for the board dimension, for example 45x70. It is copied into the response.
optimizationGoal
Optional dimension-level override. Use it when one dimension is cheap enough to prioritize fewer yard cuts, while another should prioritize reduced waste.
weightKgPerMeter
Optional weight per meter. When supplied, the response includes dimension weight, total weight and per-container weight usage.
stockLengthsCm
Optional stock lengths for this dimension. Overrides the request-level defaultStockLengthsCm.
requiredLengths
Final pieces needed for this dimension. Each row contains lengthCm and quantity.

Optimization Goals

minimizeYardCutsThenWaste
Prefer fewer lumber-yard cuts first, then less purchased stock and waste.
minimizeWasteThenYardCuts
Prefer less waste first, then fewer lumber-yard cuts.
minimizeLargestContainerUseThenYardCutsThenWaste
Prefer avoiding the largest container, then fewer yard cuts, then less waste.
minimizeYardCutsThenLargestContainerUseThenWaste
Prefer fewer yard cuts, then avoiding the largest container, then less waste.
minimizeWasteThenLargestContainerUseThenYardCuts
Prefer less waste, then avoiding the largest container, then fewer yard cuts.

Request JSON

Readable Plan

Calculate a plan to see a readable shopping and cutting list.

Response JSON

An unhandled error has occurred. Reload x