Automatic Nesting Library
This library nests one or more parts defined in DXF files.
The resulting layouts can be exported as command files (HPGL, GPGL, DXF, ALN, etc.) for laser, knife, and waterjet cutting machines.
All APIs are available as Web APIs or Python class methods.
The complete source code, including the library, Web APIs, and Python classes, is available.
Features
(1) Automatic Single-Part Nesting
Arranges copies of a single part efficiently on a rectangular material sheet, using pairing and rotation to maximize material utilization.
Note: Multi-part nesting also supports irregularly shaped material sheets.
Ten built-in nesting strategies are available.
Up to five user-defined nesting strategies can be created and selected.
Automatically selects the strategy with the highest material utilization from up to 15 strategies: ten built-in and five user-defined.
Selects the rotation angle yielding the highest material utilization under rotation limits of ±0°, ±1°, ±5°, or unrestricted rotation.
Manual rotation-angle specification is also supported.
Automatic rotation to the minimum bounding rectangle; this may involve a 90°, 180°, or 270° rotation.
Selects the nesting strategy with the highest material utilization from all available strategies.
Minimizes the area occupied by a pair of left- and right-hand parts, such as shoe or glove patterns.
Selects the nesting strategy with the highest material utilization from all available strategies.
(2) Automatic Multi-Part Nesting
Specify the required quantity of each part; the system rotates and places the parts to maximize material utilization.
Supports nesting on irregularly shaped material sheets.
Placement priority can be set to bottom-first or uniform distribution.
Material-utilization evaluation and placement order (search algorithm)
Material-utilization evaluation
The radio-button options are explained below.For all options, a smaller strip width used in area calculations improves accuracy.
With the bottom-edge weight set to 1.0, the top-edge weight can be set from 1.0 to 10.0. Higher values tend to pack parts more tightly toward the bottom.
- Maximize free area A larger free area is rated as better material utilization.
- Maximize total part area / occupied area A higher ratio of total part area to occupied area is rated as better utilization; denser packing scores higher.
- Maximize free area (greater weight for free space near the top) A larger free area is rated as better utilization. Free space near the top is weighted more heavily, encouraging parts to pack toward the bottom.
- Maximize total part area / occupied area (greater weight for free space near the top) A higher ratio of total part area to occupied area is rated as better utilization. Denser packing scores higher; weighting free space near the top encourages parts to pack toward the bottom.
Placement Order 1 and Placement Order 2
Placement Order 2 is explained first. “Small → Large” places smaller parts first; “Large → Small” places larger parts first.Placement Order 2 alone may not achieve high utilization. Setting Placement Order 1 to “Variable Order” allows limited reordering of nearby parts in the sequence.
With “Variable Order,” a larger part may be placed before a smaller one even when “Small → Large” is selected.
The library lets you adjust the permitted reordering range, but this GUI fixes it to one or two positions before or after the original position.
Placement Order 1 and Placement Order 2
Calculation completed in 3.3 seconds on a typical business laptop.
(3) Common Specifications
Common specifications
- Maximum placement resolution is 1/40,000 of the material sheet size. For a 1 m sheet: 25 micrometers (25 µm).
- Single-part automatic nesting takes 0.01 to 0.5 seconds.
- For multi-part nesting, typical computation time scales approximately with the square of the number of parts (in seconds); in the worst case, about 0.1 × (number of parts)³ seconds. These are approximate estimates and depend on part complexity and other factors.
- The resulting layout is an approximate optimum, not an analytically exact optimum. This is due to pruning and sparse search (at 1/40,000 of the sheet size resolution).
For a 10 m sheet: 250 micrometers (250 µm).
For 10 parts: approximately 10–100 seconds; 20 parts: 40–800 seconds; 30 parts: 90–2,700 seconds.
- Specify the gap (minimum distance between parts).
- Supports output from raster-to-vector conversion (including the Web application). Camera-captured images can also be used.
- Manual placement assistance
- Slide fit: slide a part into an available gap. After sliding, the part can also be moved along the boundary.
- Retrieve part outlines and gap-offset outlines.
- Check for overlapping parts.
- Export command files for CAD/NC machines in DXF, GPGL, HPGL, Gabar, ALN, and other formats. If a part contains holes, cut the holes first. If another part is nested inside a hole, cut the inner part first.
Negative gap values can also be specified.
(4) Planned Future Enhancements
The following enhancements are planned. Details may change in response to user requests.
- Incremental placement in single-part automatic nesting Place additional parts on a sheet where some parts have already been placed manually or automatically.
- Additional placement priorities for multi-part nesting (top, left, right, and perimeter-first, in addition to bottom-first and uniform placement) On very large sheets (e.g., 10 m × 10 m), parts cut near the center may be difficult to reach.
Cutting from the perimeter inward makes the cut parts easier to handle.