# Nestbolt [简体中文](https://github.com/skulitom/Nestbolt/blob/main/README.zh-CN.md) · [日本語](https://github.com/skulitom/Nestbolt/blob/main/README.ja.md) In the frozen v1 benchmark, **8.5% less material at the median than the best of Deepnest, SVGnest and Sparrow** at equal 60-second budgets, and 9.6% at 300 seconds, in the final benchmark run (fresh seeds, ten held-out jobs). Sparrow still wins 8 of the 56 jobs at 60 seconds ([details](#how-it-compares), [every number](https://skulitom.github.io/Nestbolt/results/)). Free, open-source nesting for people who cut **fixed sheets**: laser cutters, CNC routers, plasma, waterjet, fabric and leather. Nestbolt arranges parts so they use the least material. It runs [in your browser](https://skulitom.github.io/Nestbolt/) (nothing is uploaded), on the command line, and as an MCP server that AI agents can call. [Open the browser app](https://skulitom.github.io/Nestbolt/) · [Download a release](https://github.com/skulitom/Nestbolt/releases) · [Connect an AI agent](docs/AGENT_INTERFACE.md) [![skulitom/Nestbolt MCP server](https://glama.ai/mcp/servers/skulitom/Nestbolt/badges/score.svg)](https://glama.ai/mcp/servers/skulitom/Nestbolt) ![451 letter outlines nested on one sheet, small letters inside the holes of large ones](docs/images/showcase.png) 451 parts on one 850 × 425 mm sheet in 120 seconds on one CPU core: DejaVu Sans Bold glyphs in four sizes with their exact Bézier outlines, 90° rotations and 1 mm spacing. 29 letters sit inside the holes of others, and the unused material stays as one clean offcut along the top. The layout passed the independent validator. Rebuild it with `python scripts/make_showcase.py --nest 120`. ## Versions - **[Browser app](https://skulitom.github.io/Nestbolt/):** built from `main`, so it is the newest build. Nothing is uploaded. - **[v0.2.0](https://github.com/skulitom/Nestbolt/releases/tag/v0.2.0)** (2026-11-28), the current stable release: everything in the preview, plus common-line nesting inside holes, binary DXF and every `$INSUNITS` length unit from 1 to 21, jobs of up to 10,000 parts, offcut export and job quotes, on the jagua-rs 2.0.0 engine. Windows x64, Linux x64 and macOS Apple silicon tools, plus the Windows MCP bundle. LightBurn project nesting is still a preview feature. - **Earlier:** the [v0.2.0-alpha.1 preview](https://github.com/skulitom/Nestbolt/releases/tag/v0.2.0-alpha.1) (2026-10-16; its [published-download checks](benchmarks/results/preview-depth-published-20261016.md) pass) and [v0.1.0](https://github.com/skulitom/Nestbolt/releases/tag/v0.1.0) (2026-10-14). [Status](docs/STATUS.md) lists what is released and what is still open; the [v1.1 plan is 75% complete](docs/STATUS.md#v11--real-shop-files) and import acceptance remains open. The benchmark figures on this page belong to the frozen `75cbb32` build; later builds make no new comparison against competing tools. ## Guides and comparisons - **AI agents:** [nesting for AI agents](https://skulitom.github.io/Nestbolt/compare/nesting-for-ai-agents/) compares Nestbolt with other ways an agent can nest parts (OpenNest, pyFit, Sparrow, Deepnest, SVGnest and more), by interface, file formats and sheet model. - **LightBurn users without Pro:** [True Nest, Quick Nest and Nestbolt compared](https://skulitom.github.io/Nestbolt/compare/lightburn-nesting-without-pro/), with a measured run of the v0.2.0-alpha.1 preview nesting a layered `.lbrn2` project onto a full sheet and two offcuts. - **Remnants** from SVG, DXF or LightBurn (LightBurn support is a preview): [nest parts onto a remnant or irregular offcut](https://skulitom.github.io/Nestbolt/nesting-examples/nest-parts-onto-scrap-offcut/), measured on 2026-11-13, with what LightBurn 2.2, its 2.3 beta and sparrow/studio do with remnants. - **Laser makers:** [how many ornaments fit on a 12 × 12 inch sheet](https://skulitom.github.io/Nestbolt/nesting-examples/nest-christmas-ornaments-on-one-sheet/), measured for six designs, with ready-to-cut sheets; more in [the examples](https://skulitom.github.io/Nestbolt/nesting-examples/). - **Someone else's DXF:** [check a drawing before you cut it](docs/CHECK-A-DXF.md): what the import report says about units, layers, open outlines and duplicated lines, and what it doesn't check. - **Your own program:** [embedding Nestbolt](docs/EMBEDDING.md) with the CLI, the Rust crates or the WebAssembly build, with what was measured on v0.2.0 and what wasn't. ## How it compares Final acceptance run (2026-10-13): 75 frozen sheet jobs (35 academic, 40 maker, ten of them held out from all tuning), equal time budgets, one CPU core per tool, five fresh seeds each, every layout checked by an independent validator. The comparison is against the best of [Deepnest](https://github.com/deepnest-next/deepnest), [SVGnest](https://github.com/Jack000/SVGnest) and [Sparrow](https://github.com/JeroenGar/sparrow) on each job, each with the better of its two settings. | Budget | Valid Nestbolt layouts | Less material than the best competitor (median) | Wins or ties | | --- | ---: | ---: | ---: | | 60 s | 375/375 | **8.5%** | 48 of 56 | | 300 s (long subset) | 60/60 | **9.6%** | 11 of 11 | At 60 s Nestbolt uses less material than Deepnest on all 55 jobs where Deepnest produced a layout (median 9.9%) and than SVGnest on all 36 (14.4%). Sparrow, which Nestbolt builds on, wins 8 jobs. Seven are one-sheet jobs that Nestbolt hands to Sparrow itself after its own first layout, so Sparrow runs with slightly less time there; it is 0.03-2.4% better on them. The eighth (two sheets) is 0.34% better. That misses the project's own 60-second bar (wins or ties on 90% of jobs and never more than 1% worse); the 300-second, strip-parity and speed bars are met ([status](docs/STATUS.md#v1--accepted)). ![A benchmark job as nested: frames with inserts in their windows, gears and brackets, compressed to one end of the sheet](docs/images/mechanical-mix.png) One benchmark job exactly as nested in a 60-second development run (`m-mechanical-frame-inserts`, seed 0, sheet turned to landscape): 138 parts, all 39 inserts placed inside frame windows, everything packed into 56% of a 2440 × 1220 mm sheet so the rest stays one offcut. The best competitor used 62% of the sheet on this job. In 30 s Nestbolt matches the competitors' 300 s result on 10 of 11 jobs. The first final run (build `484ce8b`) stopped with an error on one job; the fix is in `75cbb32` and both runs are published. Every run, including failures, is in [BENCHMARKS.md](BENCHMARKS.md); the [status history](docs/STATUS_HISTORY.md#v1--accepted) lists the evidence per gate. The [results page](https://skulitom.github.io/Nestbolt/results/) shows every per-job number, tool revision, seed and the hardware; `python scripts/reproduce.py --phase final --final-acceptance` rebuilds the datasets, reruns what is missing and regenerates it. ## What works today - **Import** SVG and DXF: lines, arcs, ellipses, Béziers, B-splines, blocks, transforms and units, converted to millimetres. Each closed outline is a part; outlines inside it are its holes. Choose cutting layers, identify stock outlines, and review repairs and unsupported geometry. See [import options](docs/IMPORTING.md) and the [shop-file verification](docs/STATUS.md#v11--real-shop-files). - **LightBurn projects** (`.lbrn2` and legacy `.lbrn`, a preview feature): nest groups as rigid units and export an editable `.lbrn2` per sheet, preserving original artwork, text, images and layer settings. Tool and output-disabled shapes stay fixed. Older text may need a separate native save to embed its outlines; mixed active/fixed groups need regrouping before nesting. Import messages explain cached text, bounding rectangles and missing curve controls. See [LightBurn preparation](docs/LBRN2.md#required-preparation-for-older-or-mixed-projects). On the CLI, `nestbolt lightburn-send` can also send exported files straight to a local LightBurn 2.2+ instance with a paired bearer token. See [REST setup](docs/LBRN2.md#send-an-exported-file-to-lightburn). - **Nest** on fixed sheets: margins, part and edge spacing, several sheets, several stock sizes with limits, defects, remnant outlines, rotations (free, stepped or a list such as 0/180 for fabric grain) and mirroring. Small parts can sit inside the holes of larger parts. The last sheet is compressed towards one end so the offcut stays usable. - **Export** one SVG and one DXF per sheet from the original curves, transformed rather than re-polygonised. LightBurn projects use preserving `.lbrn2` output. [Export fidelity checks](benchmarks/results/h2-training-exports-20261120/README.md) record the tested files and tolerances. - **Closed-loop remnant & offcut export**: extract reusable rectangular (guillotine) or exact (true-shape subtracted) remnants from nested sheets and export `SHEET`-layer SVG/DXF files that re-import directly into Nestbolt for your next job (CLI `nestbolt offcut`, MCP `export_offcut`, and browser app). - **Shop job costing & quoting**: compute exact curve cut lengths (from source curves, never flattened polygons), pierce counts, common-line cut savings, estimated machine run time, optional trailing-offcut credit and itemized material/machine/setup cost breakdowns in JSON, CSV or Markdown (CLI `nestbolt quote`, MCP `quote_layout`, and browser app). - **Lead-in allowances** reserve room for leads and set contour starts, with shortened leads and unresolved contours reported explicitly. Red LEADIN paths are review guides; the cutting program creates the actual leads. Imported LightBurn projects keep their editable contents and receive separate SVG/DXF cutting files. See [lead settings and CAM setup](docs/LEAD_INS.md). - **Common-line cutting** identifies straight edges that can share a kerf-compensated cut. It reserves holes by default. On `main`, enable **Nest parts inside holes** and **Search for more shared cuts** to let frames carry inserts while the solver aligns outer edges. Across 13 development jobs, median cutting distance fell by 13.031% at 0.2 mm kerf and 13.101% at 1.5 mm. Every job was within the +1% material limit at both kerfs. Prepare shared sections in CAM to avoid cutting them twice. [Common-line setup and per-job results](docs/COMMON_LINES.md). - **Check** every result with an independent Clipper2 validator (overlap, spacing, containment, rotations, quantities). On large sheets it filters placement pairs by bounding box before checking their exact geometry. Invalid layouts are never returned. - **Browser app** (`web/`): the same engine compiled to WebAssembly in Web Workers, automatic worker selection, a live view of the best layout, custom saved sheet presets, collapsible **Quote & Offcuts** reporting with one-click remnant SVG/DXF download, projects saved in the browser or as a ZIP, and five one-click examples. Files never leave the computer. An optional **Quick initial layout** setting (suggested automatically on 1,000+ part jobs) helps start large jobs. The browser checks and native comparisons are in the [browser gate evidence](benchmarks/results/h4-depth-complete-20261016.md). - **MCP server** with `import_parts`, `nest`, `validate_layout`, `export_layout`, `estimate_sheets`, `export_offcut` and `quote_layout`, tested with Claude Code. Its budgets are repeatable (`nestbolt-work-v5`): same build, inputs, work budget and seed give the same layout unless the real-time limit (`time_limit_s`) is reached, which is reported explicitly. See [the agent interface](docs/AGENT_INTERFACE.md). The engine builds on [jagua-rs](https://github.com/JeroenGar/jagua-rs) and [sparrow](https://github.com/JeroenGar/sparrow) by Jeroen Gardeyn and collaborators (arXiv [2509.13329](https://arxiv.org/abs/2509.13329)). Fixed-sheet search lays the last sheets end to end as one walled strip and shrinks the last sheet with a port of Sparrow's separator; parts move between sheets and an emptied sheet disappears. Near-rectangular parts such as box panels also get a bounding- rectangle packing start. One sheet of hole-free parts without defects is exactly Sparrow's own strip-packing problem, where it is the state of the art, so there Nestbolt runs unmodified Sparrow for the rest of the budget. ## Quick start Use the [browser app](https://skulitom.github.io/Nestbolt/) without installing anything, or download native tools for **Windows x64, Linux x64 or macOS Apple silicon** from the [latest release](https://github.com/skulitom/Nestbolt/releases/latest) (v0.2.0). Each archive contains `nestbolt`, `nestbolt-mcp` and licences; download checksums are provided alongside it. The separate Windows MCPB bundle installs the server in Claude Desktop; see [agent setup](docs/AGENT_INTERFACE.md). To build the development version, install Rust through rustup (the repository selects Rust 1.98.1): ```sh cargo build --release -p nestbolt-cli -p nestbolt-mcp ``` Import parts, nest them for 30 seconds, and get per-sheet SVG/DXF files (`examples/box-99x63x45.svg` is the browser app's example box): ```sh target/release/nestbolt import examples/parts.svg --output library.json target/release/nestbolt nest --library library.json --request examples/nest-request.json --out-dir run --seconds 30 ``` For drawings with larger gaps, `import --close-gaps 0.05` explicitly repairs up to 0.05 mm and reports every repair's position and size. It is off by default; the silent join limit remains 0.005 mm. The UI and MCP expose the same option. See [import options and reports](docs/IMPORTING.md). Lead reservations and contour starts are available in the browser, request JSON and `nest --lead-in --kerf ...`; see [settings and LightBurn setup](docs/LEAD_INS.md). A request names library parts with quantities and the sheets in millimetres: ```json { "parts": [{"id": "parts-1", "quantity": 4}, {"id": "parts-2", "quantity": 12, "rotations": {"kind": "free"}}], "sheets": [{"width_mm": 600, "height_mm": 400, "margins_mm": {"left": 5, "right": 5, "bottom": 5, "top": 5}}], "spacing_mm": 1.0, "edge_spacing_mm": 1.0 } ``` `run/` then holds `layout.json`, `report.json` and `sheet-0.svg`/`sheet-0.dxf` and so on. Existing files are never overwritten. `nestbolt export` re-exports a layout; `nestbolt validate` checks a polygon job and layout; `nestbolt offcut` extracts reusable rectangular or exact remnant SVG/DXF files on the `SHEET` layer; `nestbolt quote` computes exact curve cut length, pierce count, run time and shop cost (JSON, CSV or Markdown); and `nestbolt lightburn-send` sends a file to a local LightBurn 2.2+ REST listener (`127.0.0.1:19520`). Add `--repeatable` to `nestbolt nest` or `nestbolt sheets` for a deterministic work budget instead of wall-clock time: the same inputs, budget and seed then give the same layout. On a machine much slower than the reference PC, `--time-limit ` allows more real time for the same work (the default is `--seconds`). The optional `--quick-start` setting tries a conservative initial arrangement before improving it. It is off by default and may use more material. The browser calls it **Quick initial layout** under Advanced; request JSON and MCP use `"quick_start": true`. Original geometry, spacing, stock limits and rotation permissions still apply. Unsupported stock or angle rules use the ordinary constructor. `nestbolt nest --anchor bottom-left` (or `"placement_anchor": "bottom-left"` in the request) moves each plain sheet's packing as one piece toward that corner inside the margins and edge spacing. Use `bottom-right` for the other corner. Reported material never increases. Sheets with defects or outlines stay in place. `report.json` lists each sheet's move. Releases through v0.2.0 refuse the field. File formats are described by the [JSON Schemas](schemas/README.md). ## Browser app [Open the hosted app](https://skulitom.github.io/Nestbolt/) and pick an example (finger-jointed boxes, letters inside letters, a 138-part mechanical kit, a FreeSewing T-shirt pattern on a fabric roll, interlocking gears), or drop your own SVG/DXF files. LightBurn import (a preview feature), lead allowances and the newer large-drawing features are in v0.2.0, the hosted app and a local build. The best layout so far is drawn while the search runs, and each sheet shows the box around its parts and the clear offcut left above them. Guides: [free nesting for laser cutting](https://skulitom.github.io/Nestbolt/free-nesting-software-laser-cutting/), [Nestbolt vs Deepnest and SVGnest](https://skulitom.github.io/Nestbolt/deepnest-alternative/), [nesting SVG and DXF in the browser](https://skulitom.github.io/Nestbolt/nest-svg-dxf-in-browser/) and [the five examples](https://skulitom.github.io/Nestbolt/nesting-examples/). ![The mechanical-kit example in the browser app: 138 parts on one plywood sheet in 30 seconds, inserts inside the frames, the clear offcut shaded above the dashed box around the parts](docs/images/browser-example.png) To build it locally you need the `wasm32-unknown-unknown` target, `wasm-bindgen-cli` 0.2.129 and Node.js 24; then open the printed address: ```sh cd web && npm ci && cd .. python scripts/build_web.py npm --prefix web run preview ``` `python scripts/build_web.py --test` also runs the Playwright tests in Chromium and Firefox. ## Use from agents Register the MCP server with an absolute path, for example in Claude Code: ```sh claude mcp add --transport stdio --scope local nestbolt -- /path/to/target/release/nestbolt-mcp ``` The server reads and writes only inside its working directory (or `NESTBOLT_WORKSPACE`). [docs/AGENT_INTERFACE.md](docs/AGENT_INTERFACE.md) covers Claude Code, Codex and Claude Desktop, the request format and the rules. In Claude Code you can install the plugin instead. It registers the server and adds the `nestbolt` skill, and starts `nestbolt-mcp` from your PATH, so put it there first from the [v0.2.0 release](https://github.com/skulitom/Nestbolt/releases/tag/v0.2.0): ```text /plugin marketplace add https://raw.githubusercontent.com/skulitom/Nestbolt/main/.claude-plugin/marketplace.json /plugin install nestbolt@nestbolt ``` Then restart Claude Code. For Codex, Cursor, Kimi Code, OpenCode and the other agents the open-source [skills CLI](https://skills.sh) supports, the same skill installs with `npx skills add skulitom/nestbolt-plugin`. That small repository holds the same skill, so the CLI doesn't have to clone this one, whose benchmark results take about 5 GB. The skill doesn't start the server: register `nestbolt-mcp` as well (below for Kimi Code, OpenCode and DeepSeek Harness; [docs/AGENT_INTERFACE.md](docs/AGENT_INTERFACE.md#connecting) for Codex and other `mcpServers` clients). The skill's own setup notes assume Claude Code; in other agents, register the server as shown here. The skills CLI needs Node.js 22.20 or newer, and it reports installs to the skills.sh leaderboard unless `DISABLE_TELEMETRY=1` or `DO_NOT_TRACK=1` is set. **Kimi Code, OpenCode and DeepSeek Harness.** Extract `nestbolt-mcp` from the [v0.2.0 release](https://github.com/skulitom/Nestbolt/releases/tag/v0.2.0) archive for your platform (check it against `SHA256SUMS`) and give its absolute path (`nestbolt-mcp.exe` on Windows, where forward slashes work, for example `C:/Tools/nestbolt-mcp.exe`). Set `NESTBOLT_WORKSPACE` to the folder with your cutting files, because clients start servers in different folders. A `nest` call can run for up to 300 seconds, or up to 600 when its `time_limit_s` is set. Kimi Code and DeepSeek Harness stop waiting for a tool after 60 seconds by default, so each block below allows 330 seconds (raise it if you set a longer `time_limit_s`); OpenCode's `timeout` covers tool calls too. - **Kimi Code CLI:** put this in `~/.kimi-code/mcp.json` (or `.kimi-code/mcp.json` in a trusted project); `/mcp` shows it: ```json { "mcpServers": { "nestbolt": { "command": "/absolute/path/to/nestbolt-mcp", "args": [], "env": { "NESTBOLT_WORKSPACE": "/absolute/path/to/your/cutting/files" }, "toolTimeoutMs": 330000 } } } ``` - **OpenCode:** add it under `mcp` in `opencode.json` (the project's, or `~/.config/opencode/opencode.json`); `opencode mcp list` shows it connected: ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "nestbolt": { "type": "local", "command": ["/absolute/path/to/nestbolt-mcp"], "environment": { "NESTBOLT_WORKSPACE": "/absolute/path/to/your/cutting/files" }, "timeout": 330000 } } } ``` - **DeepSeek Harness:** add this to `~/.dsh/cordis.patch.yml`; the tools appear as `mcp__nestbolt__nest` and so on: ```yaml - insert: - id: mcp-nestbolt name: '@deepseek-ai/dsh-mcp-client' config: serverName: nestbolt transport: stdio command: /absolute/path/to/nestbolt-mcp args: [] env: NESTBOLT_WORKSPACE: /absolute/path/to/your/cutting/files toolCallTimeoutMs: 330000 ``` Checked on 5 November 2026 on Windows with the v0.1.0 server: OpenCode 1.19.5 lists it as connected; Kimi Code 2.5.0 finds all five tools; DeepSeek Harness 0.2.1-rc.5 accepts the patch, but the harness itself needs a DeepSeek key to start, so the server wasn't started from it. Driven directly over stdio from another folder, the server read and wrote only inside `NESTBOLT_WORKSPACE`. ## Development Rust applications can use the engine and validator with a small checkout. [Rust library setup](CONTRIBUTING.md#use-the-rust-crates-from-a-small-checkout). ```sh python scripts/check.py python scripts/sheets_batch.py --cpu 0 --cpu 2 --seconds 60 ``` The first runs format, lint, all Rust and Python tests, WebAssembly builds, notice and dataset checks; add `--web` for the browser build and tests. The second runs the development benchmark (held-out jobs excluded) and writes an audited report under `benchmarks/results/`. | Path | Purpose | | --- | --- | | `crates/core` | Geometry import/export, sheet search, separator, part-in-part | | `crates/cli` | Command-line interface | | `crates/mcp` | Native stdio MCP server | | `crates/validator` | Independent Clipper2 checker and material scoring | | `crates/wasm` | WebAssembly boundary for the browser app | | `web` | Browser app (Preact, Vite) and its Playwright tests | | `benchmarks` | Frozen datasets, competitor runners and all results | | `docs/PLAN.md` | Original v1 plan and acceptance gates | | `docs/PLAN_V1_1.md` | Current shop-file and cutting-feature plan | | `docs/STATUS.md` | Current state: gates, releases and open work | | `docs/STATUS_HISTORY.md` | Dated checkpoints and evidence up to 2026-11-27 | Every benchmark run, including failures, is logged in [BENCHMARKS.md](BENCHMARKS.md). ## Sibling tools Nestbolt belongs to a family of free, MIT-licensed tools for agents by the same author. These run locally as MCP servers: - [Anode](https://github.com/skulitom/Anode): a hidden background Windows desktop where agents automate and test GUI apps, take screenshots and run headed browser tests without taking over the user's screen. - [Pixelbolt](https://github.com/skulitom/Pixelbolt): pixel art and sprite animation from editable JSON recipes, exported as sprite sheets, atlases, animated PNGs and GIFs. - [Cutbolt](https://github.com/skulitom/Cutbolt): a video editing engine with exact timelines, captions and rendering. - [Inkbolt](https://github.com/skulitom/Inkbolt): vector and raster image editing for diagrams and illustrations, with SVG import and SVG and PDF export. ## Progress and licence Progress counts finished milestones only; see [docs/STATUS.md](docs/STATUS.md). Nestbolt is [MIT](LICENSE). jagua-rs is an unmodified MPL-2.0 dependency; the separator in `crates/core/src/separate.rs` is adapted from Sparrow (MIT). [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) records every dependency and licence.