Guillotine Cutting Algorithms
2D guillotine cutting is an NP-hard bin packing variant. Two strategies, offcut stock, grain direction 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. fast runs several greedy solvers at the same time and keeps the best plan. It suits real-time quoting and busy job queues. thorough adds Gilmore-Gomory column generation on top. It takes longer and can find a plan that uses fewer sheets.
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. You can also mark a sheet as an offcut with is_offcut. The solver uses those sheets first, before it cuts into new stock.
Two more settings affect the result. The grain field on parts and sheets decides whether a part may be rotated 90 degrees. blade_thickness on the machine sets the kerf, so the material lost in every cut is counted in the layout. The response lists every placement per sheet layout with its position, size and a rotated flag, together with yield and waste.