Guillotine Cutting Algorithms
2D guillotine cutting is an NP-hard bin packing variant. Two strategies, scored offcut handling, and configurable rotation and kerf.
A guillotine cut goes all the way across a panel from one edge to the other. Every panel saw works this way. You cannot stop a cut halfway and resume from a different angle. This constraint shapes the entire algorithm. A nesting algorithm places parts in arbitrary orientations and positions. A guillotine algorithm must produce a sequence of straight, edge-to-edge cuts that can be physically executed in order. The output is an instruction sequence for the saw, not just a layout.
Guillotine cutting is an NP-hard bin packing variant. Optimal placement for one part changes the remaining free rectangles and affects every subsequent placement. Sawvant exposes this trade-off through two strategies. StrategyFast uses a greedy first-fit algorithm: it evaluates each part against available free spaces and places it in the first viable location using a scored heuristic. It runs in linear time relative to part count. Suitable for real-time quoting or high-throughput job queues. StrategyThorough explores a wider candidate space with backtracking, investing more compute time to achieve higher material efficiency. The difference is typically 3 to 8 percent on real-world jobs with mixed part sizes.
When a part does not fill the full width or height of a free rectangle, the remainder splits into two new free rectangles: a horizontal strip and a vertical strip. Which split orientation you choose affects what shapes are available for subsequent parts. Sawvant scores free rectangles by area and aspect ratio, prioritizing placements that preserve large, squarish offcuts over thin strips. You can flag specific offcut dimensions as reusable stock. The optimizer will treat those dimensions as target boundaries rather than waste.
Two additional parameters influence output quality. allowRotation enables 90-degree part rotation when grain direction does not matter. kerf specifies blade thickness so the cut waste is factored into every dimension calculation. Both are optional but make a measurable difference on tight layouts. The API returns the complete cut tree as nested JSON so you can reconstruct the exact cut sequence and feed it directly to machine control software.