ajandClaude Opus 5.5 beccbae106 perf(fill): skip copy-distance searches whose result is thrown away
One Irregular decode of a small job took seconds because each block in the
catalog is built by the full Fill pipeline (PrivatePlateFill), and inside it
StripeFiller's estimate rows spent about 85% of the CPU in FillLinear's
perpendicular TilePattern. A stripe estimate is exactly one pattern tall, so
the pattern's copy distance, an all-pairs slide search, always exceeded the
room left and the copies were discarded after the search had run in full.

TilePattern now passes FindPatternCopyDistance the largest distance that
could still place a copy: for a whole copy, the room past the pattern; for a
pattern that may tile partially, the most room past any one of its parts. The distance
is the maximum over every pair, so the search stops as soon as it passes that
bound and the tile returns empty, which is what the full search led to. The
public CopyDistance is unchanged. StripeFiller's angle searches also reuse
each rotated pattern's bounding box per angle instead of cloning and
rotating the parts again on every probe.

Output is identical: the layouts of every benchmark job that finishes match
the previous build. Measured A/B on this machine, alternating builds per job
(Benchmark --engines Irregular --parallel 1, benchmark ms):

- N26-2A5: 15.5 s -> 8.8 s (12.6 s -> ~7.2 s in quieter runs)
- 73 of the 80 bench jobs (the other 7 time out at 5 minutes in both
  builds): 1,990 s -> 1,578 s total (-21%), process CPU 6,486 s -> 3,842 s
  (-41%), median job 0.91x. N26-295 now finishes in 242 s with the same
  layout where it hit the 5-minute limit before.
- Problem-nest corpus auto-nest and fill areas: all at baseline.

A parallel herringbone pair build was tried and dropped: it saved 1.2 s on
N26-2A5 but cost 10 s and 45 s more CPU on P241017-01.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:08:12 -05:00
2026-10-26 20:33:20 -04:00

OpenNest

A Windows desktop application for CNC nesting — imports DXF drawings, arranges parts on material plates, and exports layouts as DXF or G-code for cutting.

OpenNest - parts nested on a 36x36 plate OpenNest - 44 parts nested on a 60x120 plate

Features

  • Import / export — DXF & DWG parts (ACadSharp), Excel BOMs, bend-line detection, built-in parametric shapes; export DXF or post-processed G-code.
  • Nesting — automatic multi-plate/multi-material jobs, interlocking pair evaluation, and built-in or plug-in engines. Choose an engine.
  • Plate operations — manual sheet cut-offs, plate- or nest-wide automatic scrap cutoffs with a minimum tail-to-keep setting, oversized-part splitting (straight, weld-gap tabs, spike-groove), interactive editing, and spacing-aware pushes that can slide along or away from touching parts.
  • Visual overlap check — highlight shared material on the active plate, rechecked automatically after edits, including containment and cutouts, with area shading, pair markers, and hover details through View > Overlap Check. Usage and limitations.
  • Cut simulator — Plate > Simulate Cutting replays the active plate in cut order: the torch traces each cut, rapid and pierce at adjustable feed, rapid and pierce settings, with play/pause, scrubbing, 1×–250× speed and previous/next part (Page Up/Down) and cutout (Ctrl+Left/Right) jumps. Parts the torch has not reached stay grayed. It and Calculate Cut Time use separate outside and hole feeds, skip etch-only contours like the CI Fiber post, and apply the chosen machine's acceleration and corner limits from Machine Configuration (placeholder values until you enter the controller's). Timing model.
  • CNC output — configurable lead-ins/outs and tabs, contour editing, user-defined G-code variables ($name → #200+ machine variables), plugin post-processors (Cincinnati CL-707/800/900/940/CLX included). Pre-post verification checks overlaps, missing lead-ins, and rapid crossings, with explicit risk acknowledgment required to bypass warnings.

Requirements

  • Windows 10+ for the desktop app; the console, API, shared desktop library (OpenNest.Desktop) and most test projects build on Linux/macOS too. OpenNest.Avalonia is an early cross-platform desktop prototype, not yet a usable replacement.
  • .NET 8 SDK to build from source.

Prebuilt Windows downloads are on GitHub Releases, or build from source to run the latest code. Release ZIPs are self-contained: extract the entire archive into a new folder and run OpenNest.exe; no separate .NET installation is needed. For automatic updates, install with OpenNest-win-Setup.exe or extract OpenNest-win-Portable.zip instead: those copies download new full releases in the background, from GitHub Releases or, in Database mode, the nest server's mirror of them first (a hand-set feed URL overrides both) and restart only when you agree (auto-update). The plain ZIP does not auto-update; to update it, close OpenNest and extract the new release into a new folder. All nesting engines (Default, Rectangles, Irregular, Circles, FlatBar and the fill strategies) are built in; see nesting engines.

Build, Test, Run

git clone https://github.com/ajisaacs/OpenNest.git
cd OpenNest
dotnet build OpenNest.sln                                       # full solution (Windows)
dotnet test OpenNest.Engine.Tests/OpenNest.Engine.Tests.csproj  # cross-platform engine tests
dotnet test OpenNest.Tests/OpenNest.Tests.csproj                # core/engine/IO/API tests
dotnet test OpenNest.Desktop.Tests/OpenNest.Desktop.Tests.csproj # shared desktop library tests
dotnet test OpenNest.FrontEnd.Tests/OpenNest.FrontEnd.Tests.csproj # console/MCP/API integration
dotnet run --project OpenNest/OpenNest.csproj                   # desktop app (Windows)
dotnet run --project OpenNest.Avalonia/OpenNest.Avalonia.csproj # cross-platform prototype

OpenNest.WinForms.Tests (desktop-assembly tests) runs on Windows only; CI runs it on a GitHub-hosted Windows runner, and OpenNest.FrontEnd.Tests on both Linux and Windows, for every master push and pull request.

Quick start

  1. File > New
  2. Import DXFs via the CAD Converter (layer/color filtering, per-entity exclude and cut/etch/display-only roles, bend detection, G-code preview) or create built-in shapes
  3. Define plate size, material, quadrant, spacing
  4. Fill — the engine arranges parts
  5. Optionally add cut-off lines, apply Part Sequencing to order crossing cut-offs before their parts, then save .nest, export DXF, or post-process to G-code

Review part spacing before cutting, especially for interlocking pairs. See pair-spacing checks and current limitations.

Command-Line Interface

dotnet run --project OpenNest.Console -- part.dxf --size 60x120               # fill one plate
dotnet run --project OpenNest.Console -- part1.dxf part2.dxf --size 60x120 --autonest
dotnet run --project OpenNest.Console -- project.zip                          # re-fill a nest file
dotnet run --project OpenNest.Console -- job.nest --no-fill --plan-cutting --all-plates
Option What it does
--size WxL Set the plate size; required for DXF-only input.
--autonest Run validated whole-job nesting; one sheet unless --max-sheets <n> allows more.
--engine <name> Choose a whole-job engine with --autonest, or a fill strategy without it.
--quantity <n> Limit parts placed (0 means unlimited). With --autonest, nest n of each drawing instead of its required quantity.
--spacing <value> Override part spacing.
--template <path> Read plate defaults from a nest file.
--output <path> Set the output nest path.
--check-overlaps Check the result for overlaps.
--no-fill Keep a loaded nest as it is, for example to plan cutting or post it.
--plan-cutting Plan and apply cutting (part order, contours, entries, lead-ins); see cut planning.
--cutting-params <path> Cutting settings JSON for --plan-cutting; otherwise the plates' saved settings are used.
--post <name> Run a post-processor after nesting.
--no-save Skip saving the nest.
--allow-invalid Explicitly keep a representable invalid --autonest result; otherwise it is rejected.

Run dotnet run --project OpenNest.Console -- --help for the complete options and their defaults.

Project Structure

Project Purpose
OpenNest WinForms desktop app
OpenNest.Core Domain model, geometry, CNC primitives; material-overlap diagnostics
OpenNest.Engine Nesting algorithms and whole-job contracts
OpenNest.IO DXF/DWG, .nest, G-code, BOM I/O; CAD import
OpenNest.Console Headless batch nesting
OpenNest.Api / .Data Programmatic pipeline; machine & cutting-parameter data
OpenNest.Gpu GPU-accelerated pair evaluation (ILGPU)
OpenNest.Benchmark Head-to-head engine comparison
OpenNest.Mcp MCP server for AI tool integration
Posts/ Post-processor plugins (Cincinnati CL / CI Fiber lasers, Gravograph IS8000)
*.Tests Cross-platform suites; WinForms tests are Windows-only

Nesting Engines

Default compares the built-in Irregular, Rectangles and Circles engines and keeps the best valid whole-job layout. Other engines and plug-ins suit particular jobs; see which engine to use. Desktop Auto Nest, console autonest, MCP autonest, and the API share an independent validation pipeline, including for plug-ins. Automatic nesting and validation explains how callers handle invalid results.

File Format

.nest files are ZIP archives containing drawing programs, metadata, plates, and placements. Saved nests retain each part's lead-ins, lead-outs, tab gaps, and locks, plus the plate's cutting settings. Changing a drawing's geometry removes obsolete cutting paths from its parts; name, quantity, and color edits preserve them. See the file-format reference for compatibility and recovery behavior.

Supported Formats

Format Import Export
DXF Yes Yes
DWG Yes No
Excel BOM Yes No
G-code No Yes (post-processors)
.nest Yes Yes

Keyboard Shortcuts

Ctrl+F fill area · F zoom to fit · Shift+wheel / middle-click rotate · X/Y push · arrows nudge by the offset increment (F5), or with its calculated distance by the selection's own size plus part spacing, landing tight with no push back (it always moves, even off the plate) · Shift+arrow push.

Status & License

Actively developed; core workflows run end-to-end from DXF import to G-code. Contributions welcome. MIT licensed — see LICENSE.

S
Description
Read-only backup mirror of https://github.com/ajisaacs/OpenNest (GitHub is the primary). Pulled hourly.
Readme MIT
16 MiB
0 Stars 1 Watchers 0 Forks
Languages
C# 98.3%
Python 1.3%
PowerShell 0.2%
Shell 0.1%