Menu

How a panel cutting optimiser works: guillotine cuts, kerf, grain, and why greedy fails
📰

How a panel cutting optimiser works: guillotine cuts, kerf, grain, and why greedy fails

DEV Community: opensource·Elam Uceda Herrero·10 days ago
#K3zqsahL
#devtoopensource#devto#dev#sheet#kerf
Long article (1532 words) — no AI summary yet.
Reading 0:00
15s threshold

A carpenter has a list of 60 rectangles and a stack of 2800 × 2070 mm boards. "How many boards do I buy?" sounds like textbook bin packing, until you add the constraints of a real saw. The board optimiser of SyntaxFlow is a plain JavaScript file with no DOM and no dependencies. Here is what is in it and why.

The constraint that defines the problem: guillotine cuts

A beam saw or a sliding table saw cannot cut a hole in the middle of a board. Every cut runs from one edge of the piece on the saw to the opposite edge. A layout that respects this is called guillotine . A pinwheel arrangement (four rectangles around a central one) can be denser on paper and cannot be cut with a saw at all.

So the optimiser produces only layouts a saw can cut. There is a separate mode for CNC routers, which cut round each part; more on it at the end.

Kerf and trim, with one trick

The blade removes material: the kerf, typically 3 to 4 mm. Factory edges are rough, so the sheet loses a trim strip on its edges.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.