Nº 05Tools / Nesting
Ply and flat part nesting
Place plies and flat parts on a roll so that the used length is short, each ply turned only as its fiber direction allows. planex2d nests them in this tab, running on Pyodide/ngapp. Nothing is uploaded.
- Files stay on your computer
- Runs in your browser
- Built on the planex2d library
Parts
Each closed outline is a part. Its fiber angles, in degrees, give one ply each.
Roll
Drop DXF, SVG, STEP or BREP files, or a zip of them, onto the sheet. Each closed outline becomes a part, and each of its fiber angles one ply. The search runs in your browser for the time you set.
What the nesting tool does
It places the plies of a ply book on a roll of fixed width so that the roll length they use is short.
Composite parts are laid up from plies cut out of rolls of prepreg or dry fabric, and the material is expensive. Nesting arranges the plies on the roll so that the length they use, and with it the offcut, is as short as possible. For composites the fiber direction adds a rule: a ply's fibers must run at the angle the ply book gives it, so a ply can only turn on the roll in the steps the material allows. The same layout problem comes up for flat parts cut from any roll, such as textiles or foils. The tool takes the plies from DXF, SVG, STEP or BREP files, nests them and shows the used length and the material utilization, with the layout saved as DXF or PDF.
Parts and plies
Each closed outline of a file becomes a part, with the outlines inside it as its holes. A part's list of angles gives its plies, one ply per angle, and its number how many of that set are cut.
Fiber angles
The roll's fibers run along its length. A ply cut at 45° is turned so that its fibers lie along the roll; woven fabric also allows turns in 90° steps, unidirectional material a turn by 180°. The search never mirrors a ply. Flip mirrors a part upside down before it is placed, for a ply drawn from its other side, and its fiber angles turn with it.
Spacing
With a spacing of 0, parts may touch, as for a cutter that cuts a shared edge once. A spacing keeps every pair of parts at least that far apart and half of it from the roll's edges.
The layout
The used length is the length of roll from its start to the end of the last ply, and the utilization the plies' area over the roll area up to that length. The DXF file holds every ply's outline in millimeters on a layer per fiber angle, with the roll as a rectangle; the PDF shows the layout on an A3 sheet at the largest standard scale that fits, the plies filled by fiber angle.
How the layout is found
The tool places the plies with no-fit polygons and planex2d's Boolean operations, then searches for a shorter arrangement within the search time.
- Load
The page loads Python and planex2d into this tab. Your browser keeps both in its cache, so later visits start faster.
- Read
The browser reads the files you add from your disk into memory and unpacks a zip in the tab. No request carries a file to a server.
- Nest
planex2d places the plies on the roll and searches for a shorter layout until the search time is up or you stop it, drawing the best layout as it goes.
- Save
The layout is saved as DXF in millimeters or as a PDF sheet.
No-fit polygons
For every pair of shapes and rotations, planex2d computes where one part may not go next to the other: the Minkowski sum of the first part and the mirrored second, built from convex pieces and united with planex2d's Boolean operations. Straight edges are exact, and arcs and splines are enclosed by polygons that lie at most 0.5 mm outside them, so a layout that fits the polygons fits the parts.
Placement
The parts go onto the roll one after the other, the largest first. For each allowed rotation, the free region is the roll minus the no-fit polygons of the parts already placed, and the part takes the free region's vertex that keeps the layout shortest.
Search
A simulated annealing search then changes the order and the rotations within the search time and keeps the shortest layout it finds. After it, small parts move into the holes of larger ones where they fit. An exact check on the real shapes confirms that no two parts overlap and that every part lies on the roll.
Supported files
| Format | Extensions | Notes |
|---|---|---|
| DXF | .dxf | Parts to nest, and the layout saved in millimeters. See Files. |
| SVG | .svg | Parts to nest. See SVG. |
| STEP, BREP | .step .stp .brep | Planar parts to nest. See STEP and BREP. |
| Zip | .zip | Every DXF, SVG, STEP and BREP file inside, as parts. |
| The layout on an A3 sheet, at the largest standard scale that fits. |
Built on planex2d
The nesting is this tool's own code, not a call of the library, written with planex2d's public calls only: the readers for the parts, polygons around the curves, Boolean operations for the no-fit polygons and the free region, and offsets for the spacing. Install the library with pip install planex2d to work with the same geometry in Python.
Privacy
Nothing is uploaded. The parts are read and nested in this tab and are gone when you close it. Python, planex2d and its packages come from public package servers (jsDelivr and PyPI). See the privacy notice.
Limits
- In the browser, planex2d runs in one thread. Each layout takes a fraction of a second, so a longer search time lets the search try more layouts.
- The search is random: another run can give a different, sometimes shorter layout.
- A part that is wider than the roll in every allowed rotation cannot be placed.
- A layout that fails? Open an issue on GitHub and attach the parts if you can.
Questions and answers
Is my ply book uploaded?
No. The parts are read and nested in this browser tab by planex2d, running on Pyodide/ngapp, and are gone when you close the tab. Python and its packages come from jsDelivr and PyPI; your files are never sent anywhere.
Which files can I nest?
DXF, SVG, planar STEP and BREP files. Each closed outline becomes a part, with the outlines inside it as its holes. A layer without closed outlines, such as one with center lines, is left out.
How are the fiber angles handled?
Each angle in a part's list is one ply cut at that angle. The ply is turned so that its fibers lie along the roll; woven fabric also allows turns in 90° steps, unidirectional material a turn by 180°. Plies are never mirrored.
Can parts touch?
Yes, with a spacing of 0, for a cutter that cuts a shared edge once. A spacing keeps every pair of parts at least that far apart and half of it from the roll's edges, for example for cutting by hand.
Do small parts go into holes?
Yes, when Small parts into holes is on. After the search, parts move into the holes of larger parts where they fit, which never makes the used length longer.
What do I get out?
The layout drawn on the sheet, the used roll length and the material utilization, and a DXF file in millimeters with every ply's outline on a layer per fiber angle and the roll on a layer of its own. A PDF gives the layout on an A3 sheet at true scale, with a legend and a title block.
Other tools on planex2d.org
Every tool runs on the planex2d library, in your browser.
-
-
Converters
Many DXF, SVG, STEP and BREP files in, one format out, all saved at once.
-
Calculator
Area, centroid, second moments and section moduli of a drawing, and the mass of a sheet part.
-
Contour checker
Open contours, gaps, doubled lines and tiny edges in DXF, SVG and STEP drawings, marked and repaired.
-
Playground
planex2d code in the browser, beside what it prints and draws, shared as a link that carries the code.
The planex2d documentation shows the library behind the tools, and the homepage lists everything on planex2d.org.