Nestpact Documentation
Nestpact is a DXF nesting optimization tool for CNC cutting. It takes your part outlines and material sheets, computes the most efficient layout, and gives you a ready-to-cut DXF or G-code file. It also accepts STL, OBJ, PLY, and 3MF files, extracting the 2D silhouette automatically before nesting.
Building an integration? See the Developer API for the REST endpoints, authentication, and code examples.
Workflow
Every job follows four stages.
Upload
Upload your material sheet as a DXF, or enter dimensions manually, or pick a sheet from the material library. Then upload one or more part files (DXF, STL, OBJ, PLY, or 3MF). Each part can have a quantity.
Configure
Set the gap between parts, edge offsets, rotation granularity, optimization level, and whether to enable hole-filling (nesting smaller parts inside holes of larger ones). G-code settings such as feed rate, spindle RPM, cut depth, and tabs are also configured here.
Nest
The nesting job runs asynchronously on the server. The canvas updates in real time via a Server-Sent Events stream as each part is placed. You can cancel a running job at any point.
Download
Download the result as a nested DXF (all placements drawn on a single sheet) or as a G-code .nc file ready for your controller. If a job exceeds one sheet, additional sheets are generated automatically.
File Support
DXF, DWG & SVG parts and sheets
DXF files are parsed using ezdxf. Supported entities include LINE, LWPOLYLINE, POLYLINE, CIRCLE, ARC, SPLINE, ELLIPSE, and INSERT (block references). The parser runs in two modes:
- Material mode (merge_holes=True): all geometry on the sheet is merged into a single boundary polygon.
- Parts mode (merge_holes=False): holes (interior rings) are preserved so the nesting engine can perform hole-filling.
DWG and SVG files are accepted too: they are converted to DXF on upload (SVG via svgelements, with every transform flattened so files from Illustrator, Inkscape and Figma come in clean) and then follow the same parsing path.
3D files: STL, OBJ, PLY, 3MF
3D files go through a silhouette extraction pipeline before reaching the nesting engine:
- The mesh is loaded with trimesh.
- The largest planar facet group is found using a graph-based facet detection algorithm (requires networkx). If the graph engine is unavailable, the oriented bounding box shortest axis is used as a fallback.
- That face is reoriented to face +Z, and every triangle is projected onto the XY plane.
- The projected triangles are unioned with Shapely to produce a single silhouette polygon.
- The silhouette is handed to the nesting engine exactly like any DXF part.
Libraries & Presets
Signed-in users get reusable libraries, so a sheet, a part, or a set of settings only has to be prepared once. Using a library item never consumes the original: it is copied into the job, so the saved version stays intact for the next time you need it.
Sheet library
Save any material sheet (an uploaded DXF outline or a manual size) as a named plate you can reload from the sheet picker. Banked offcuts appear in the same picker, so remnants and full sheets live side by side.
Offcuts
After a nest, save the unused area of the sheet as an offcut. It becomes an irregular reusable sheet in your library, so a later job can be nested onto the remnant instead of a fresh plate. This closes the loop on material waste.
Part library
Save frequently cut parts (each with a cached thumbnail) and drop them into any job from the part picker. Every use copies the part into the job, so quantities and edits never touch the saved original.
BOM import
Import a bill of materials to add many parts at once with their quantities, instead of adding each part by hand.
Nesting presets
Save a full set of nesting settings (gap, rotation, optimization level, G-code options, and so on) as a named preset, then apply it to future jobs in one click. Presets are stored per account and follow you across devices.
Nesting Engine
The nesting engine combines multiple placement and optimization algorithms with true-shape collision detection. The settings below are exposed in the Configure step of the wizard.
Optimization level
Controls how hard the engine searches for a better layout. Higher levels try more sorting strategies and rotation angles, which improves material utilization but takes longer to run. For most production jobs, Thorough is a good starting point. For concave or interlocking parts, Interlock and Extreme use true No-Fit-Polygon nesting (NFP) to fit parts against each other's real outlines and pack them noticeably tighter.
| Level | What it uses | Best for |
|---|---|---|
| Quick | A single fast placement pass. | Previews and simple rectangular parts, when speed matters most. |
| Balanced | A couple of placement strategies, lightly rotated. | Many similar parts when you want a quick, solid layout. |
| Thorough | Several strategies compared, the best layout kept. | The everyday default for most production jobs. |
| Genetic | An evolutionary search over the order parts are placed in. | Tricky mixed jobs where placement order matters. Results vary between runs. |
| Extreme NFP | The deepest search, plus true-shape No-Fit-Polygon refinement on concave parts. | High-value material where the best possible layout is worth the wait. |
| Interlock NFP | True-shape No-Fit-Polygon nesting that fits parts against each other's real outlines. | Concave and interlocking parts (brackets, L / T / U profiles, puzzle-like shapes). |
Rotation mode
Determines which orientations the engine is allowed to try for each part. Allowing more rotations gives the engine more placement candidates, which often improves utilization, but increases run time proportionally. If your parts are grain-sensitive (wood, fabric, rolled metal) you may want to restrict this to none or 90.
| Mode | Angles tried | Effect |
|---|---|---|
| none | 0° only | No rotation. Fastest, preserves grain direction. |
| grain | 0°, 180° | Flips a part end-for-end but never sideways, so directional stock (wood, brushed or rolled metal, fabric) keeps its grain while still packing a little tighter than none. |
| 90 | 0°, 90°, 180°, 270° | Good balance for most rectangular-ish parts. |
| 45 | Every 45° | Useful for parts with diagonal features. |
| 30 | Every 30° | Better packing for hexagonal or triangular shapes. |
| 15 | Every 15° | Fine-grained search. Noticeably better for curved parts. |
| free | Every 5° (72 candidates) | Maximum packing density. Best for irregular organic shapes. Slowest. |
Gap (minimum stock between parts)
When the Tool diameter setting is 0 (laser, plasma, waterjet), Gap is the raw outline-to-outline distance the engine maintains between adjacent parts. Set it to at least your kerf width so parts do not end up undersized after the beam or saw eats into the gap.
When Tool diameter is set (CNC router), Gap becomes the minimum material web that physically remains between two finished parts after cutting. The engine places outlines at Gap + Tool diameter apart so that the two cutter paths — each removing material out to half the bit's diameter — leave exactly Gap mm of untouched stock between them. Set Gap to 0 if you only need the bits to not overlap, or raise it for a wider land.
Tool diameter (CNC router)
The diameter of the router bit. Leave at 0 for laser, plasma, and waterjet machines — those use the Gap setting directly. When set, the nesting engine automatically adds this value to Gap when calculating how far apart to space part outlines, so Gap retains its physical meaning (stock remaining between parts) regardless of bit size. Example: a 6 mm end mill with Gap = 3 mm causes outlines to be placed 9 mm apart; after cutting, 3 mm of material is left between the two parts.
Edge offset
The minimum distance between any part and the edge of the sheet. Useful when your material has a clamping zone or a burned border that you do not want to cut into. Setting this to 0 allows parts to be placed flush against the sheet boundary.
Sorting strategy
Controls the order in which the engine places parts. The chosen strategy is one of the variables the optimization level iterates over — at higher levels all strategies are tried and the best result wins.
| Strategy | What it does |
|---|---|
| area-desc | Largest parts (by area) go first. Generally the best default: big parts constrain the layout most, so placing them early avoids painting yourself into a corner. |
| height-desc | Tallest parts first. Can outperform area-desc when parts are long and narrow. |
| width-desc | Widest parts first. Useful for horizontal-strip layouts. |
| interleaved | Alternates the largest and smallest remaining part. The small parts fill the gaps left between the large ones before those gaps close off. |
Hole-filling
When enabled, the engine attempts to nest smaller parts inside the holes of larger parts (for example, placing a small disc inside the circular cutout of a larger bracket). This recovers material that would otherwise be scrapped. Disable it if you need the holes to remain empty for downstream assembly reasons, or if the extra computation time is not worth it on simple flat parts with no holes.
Multi-sheet overflow
If not all parts fit on the first sheet, the engine automatically starts a second sheet and continues placing until every part in the job has been accommodated. Each sheet is downloaded as a separate DXF layer or file. You cannot disable this — if you want a single-sheet result, reduce the quantity or choose a larger sheet size.
Fill-remaining
After all unique parts have been placed once (satisfying the requested quantities), any leftover sheet area is filled with additional copies of the parts in round-robin order. This is useful when you want to cut as many parts as possible from a single sheet without specifying an exact quantity up front. Disable it if you want an exact count and do not want extras.
Post-placement compaction
After the initial placement pass, the engine runs a second sweep that nudges each placed part toward the bottom-left origin, closing any gaps that appeared because earlier placements blocked the ideal position. Compaction does not change which parts are placed — only tightens their final positions. It is always on and cannot be disabled from the UI.
Manual Editing
The layout the optimizer produces is a starting point, not a lock. Every placement can be adjusted by hand on the canvas before you export.
Moving parts
Drag any placed part to reposition it, rotate it, or duplicate it. Collision feedback warns you in real time if a move would overlap another part or run off the sheet, so a hand-tuned layout stays cuttable.
No-cut zones
Mark damaged or unusable areas so the engine avoids them. Draw a rectangle, circle, or polygon, or use the freehand scribble tool to trace an irregular defect. No-cut zones are subtracted from the usable sheet area before nesting, exactly like a hole in the material.
Measure tool
A ruler mode on the canvas toolbar measures any distance in your active unit (mm or inches), handy for checking a clearance or a specific dimension against the drawing.
Mobile photo background (QR pairing)
To trace real defects, pair your phone by scanning a QR code, photograph the actual sheet, and the picture drops onto the PC canvas as a background layer. Calibrate the scale by entering one known width, then draw no-cut zones directly over the flaws visible in the photo. The overlay opacity and visibility are adjustable.
Keyboard shortcuts
- Space and drag to pan; scroll to zoom (anchored to the cursor).
- Ctrl + Z and Ctrl + Y to undo and redo.
- Delete to remove the selected part or no-cut zone.
G-code Generation
After a nesting job completes, the placement coordinates are fed to the G-code generator. The output is a Fanuc-flavoured dialect (G21/G20, G90, G17, G94) accepted by most Fanuc-compatible controllers (LinuxCNC, GRBL, Mach3, Fanuc). Dedicated post-processor profiles are also available for Heidenhain and WoodWOP.
Output structure
Every generated program follows this structure:
- Header comments (job ID, units, part count, bounding box, tool number).
- Setup codes: unit system, absolute positioning, XY plane, feed-per-minute.
- Work offset declaration (G54–G59 or G92).
- Tool select and change (
T# M06), optional tool length offset (G43 H#). - For each part: rapid to entry point, spindle/beam on (M03), cut the profile, spindle/beam off (M05).
- Footer: cancel canned cycles (G80), return to origin, M30 program end and rewind.
Cut operations per DXF layer
Each DXF layer in the part file can be assigned a different operation:
| Operation | What it emits |
|---|---|
| profile (default) | Full closed contour cut around the ring. Outer profile is always last so the part stays held by the sheet while inner features are cut first. |
| drill | A single G81 canned drill cycle at the centroid of the ring. The contour itself is not cut. Use for bolt holes where a drill bit is preferred over an end mill. |
| centerline | Open-path G1 trace following the polyline as drawn, without closing back to the first vertex. Use for dado grooves or dovetail slots where the tool should follow the centerline rather than cut a closed pocket. |
Arc fitting (G02 / G03)
The DXF parser converts all curves (circles, arcs, splines, ellipses) into polygon approximations because Shapely needs polygons for collision detection. The G-code generator recovers the original arcs by fitting consecutive co-circular points back into G02 (clockwise) and G03 (counter-clockwise) arc commands with IJK centre offsets.
This matters for cut quality: a controller running constant feed through a G02/G03 arc produces a smoother edge than decelerating at every chord vertex of a polygon approximation. Arc fitting can be disabled for controllers that only understand G01.
Router mode (Z axis)
By default the generator produces 2D output with no Z column, suitable for laser, plasma, and waterjet machines. Router mode is activated when a cut depth is supplied.
| Parameter | Description |
|---|---|
| Cut Z | Depth the bit reaches at full cut (negative, e.g. -18 mm). |
| Safe Z | Retract height for rapids between parts (e.g. 5 mm). Must be above Cut Z. |
| Plunge feed | Feed rate for the Z plunge. Defaults to 40% of the XY cut feed. |
| Pass depth | Stepdown increment per pass. A 18 mm cut at 3 mm/pass emits 6 full-perimeter passes at progressively deeper Z before moving on to the next part. |
Lead-in / lead-out
A lead-in is a short approach move that brings the beam onto the profile away from the finished edge, so the pierce mark (which is rougher than the cut itself) lands in scrap rather than on the part. A lead-out does the same on exit. Both can be a straight line or a tangent arc, with a configurable length, and are applied only to profile rings (never to drilled or centerline operations).
Bridge tabs
Tabs are small uncut bridges that keep parts from dropping out of the sheet mid-cut. They are only applied to the outer profile cut of each part (never to holes or extra features). On the final stepdown pass the generator lifts to Safe Z across each tab location, rapids over it, then plunges back to Cut Z to continue the profile.
Tab placement follows three rules:
- Even spacing: tabs are distributed evenly around the perimeter at
(i + 0.5) × perimeter / nso the first tab does not land on the pierce point. - Corner avoidance: if an ideal position straddles a sharp corner, the tab is nudged to the nearest long segment where material exists on both sides.
- Hole proximity avoidance: tabs are kept at least 2× tab width away from interior hole edges to prevent thin slivers that snap during part removal.
Multi-tool jobs
When different DXF layers are assigned to different tool numbers, the generator emits a tool change sequence (M05 → T# M06 → optional G43 H#) automatically between rings that require different tools. The work offset is re-asserted after each change so the controller's modal state does not drift.
Work offsets
| Option | Behaviour |
|---|---|
| G54 – G59 | Selects a pre-stored work coordinate system. The operator zeroed this offset on the controller before running the program. Default is G54. |
| G92 | Declares the controller's current position as the job origin. Emitted before the tool change so the operator's manual touch-off is not invalidated by the M06 cycle. |
| none | No work-offset line is emitted. The caller is responsible for setting one externally. |
Spindle RPM
When a spindle RPM is supplied, every M03 command is augmented to M03 S#### so the controller starts the spindle at a defined speed. Without an S word, some controllers leave the spindle at its last-used speed, which can be zero. Leave this blank for laser, plasma, and waterjet machines.
Cycle time estimate
The generator returns metadata alongside the G-code text, including a rough cycle time estimate computed from total cut distance, total rapid distance, cut feed rate, and rapid feed rate. It also reports pierce count, arc count, bounding box utilization, and shortest/longest individual cut loop.
Results & Sharing
Shareable links
Turn any finished layout into a public, read-only link to send to a colleague or customer. The link shows the layout geometry only (no downloadable DXF or G-code bytes), and a watermark and expiry are applied based on your plan at the time the link is created.
Costing & quotes
Optional and off by default. When enabled in Settings, the results panel breaks down material, scrap, machine, and markup costs, plus a landed cost per part. It is a purely informational overlay: the nesting itself never depends on it.
Printable report
Generate a clean shop-floor report (print, or save as PDF) with a map of the nested sheet, numbered parts, and the key job stats. When costing is enabled, the cost breakdown is included.
Savings dashboard
Your history view summarizes how many sheets and parts you have nested and at what average utilization, for the current month and all-time, with an estimate of the material saved against a baseline. When costing prices are set, the dollar figure is shown alongside.
Re-run and email
Re-run any past job with the same or tweaked settings in one click (the parts and sheet are rebuilt from the stored job, with no re-upload needed), or email a finished result to yourself.
DXF Health Checker
The Health Checker analyzes a DXF file before nesting and reports issues that would cause a bad nest or a bad cut. It can also apply automatic fixes.
What it checks
- Unclosed polylines (open contours that do not form a valid polygon).
- Duplicate or near-duplicate geometry.
- Zero-length segments.
- Self-intersecting contours.
- Entities on layers that the nesting engine may not handle as expected.
Auto-fix
The fix endpoint attempts to close open polylines, remove duplicate entities, and simplify near-collinear points. The repaired DXF is returned as a downloadable file.