开发者用 Rust 自建刺绣编辑器 支持 MCP 与 AI 代理

原标题:Show HN: My $300 embroidery machine needed a subscription, so I built my own app
58AI 研判分

因不满 300 美元刺绣机被订阅制绑定,开发者用 Rust 从零构建了可视化刺绣编辑器 ZigZag,可将 SVG 转为针迹并导出 PES、DST 等主流格式。其亮点是内置 MCP 协议支持,允许 AI 代理直接参与设计与编辑,同时提供命令行工具与蓝牙直连 Brother 绣花机。

报道正文

本文目录5 个章节
<img src="packaging/macos/AppIcon-dark.png" alt="ZigZag dark mode app icon" width="160" height="160">

ZigZag

Visit zigzag.diy

ZigZag is a visual embroidery editor built in Rust for performance, with built-in MCP (Model Context Protocol) support so AI agents can create and edit designs alongside you. Turn SVG artwork into stitches, fine-tune it in the editor, and export PES, DST, EXP, JEF, or VP3 for broad compatibility with embroidery machines—or send designs directly to a Brother Skitch (PP1) over Bluetooth.

Draw in Illustrator, draw in ZigZag, or let an agent draw. The Rust engine and zigzag command-line tool power the same workflow outside the editor.

See ZigZag in action

https://github.com/user-attachments/assets/94812f25-82f4-429f-85db-5e20c1d5e723

Download for Mac

Download ZigZag.dmg

For Apple Silicon and Intel Macs, macOS 11 or later. Open the DMG, then drag ZigZag into Applications. The release is signed and notarized by Apple. No Rust installation is needed.

Download for Windows

Download ZigZag for Windows — the ZigZag-<version>-x86_64-windows.zip asset on the latest release.

For 64-bit Windows 10 (version 1709 or later) and Windows 11. Unzip it and double-click ZigZag.exe. Windows SmartScreen warns on apps without a Microsoft-trusted signature the first time they run; click More info → Run anyway. No Rust installation is needed.

Release notes and checksums · Publishing a release

YAML
zigzag/
  src/svg.rs              SVG import (usvg): fill and stroke parts, transforms, text
  src/document/           editable document; settings saved back into SVG ids,
                          layout edits as SVG transforms, lettering
  src/params.rs           stitch settings tokens + fabric presets
  src/stitch/fill.rs      tatami fill (scanline sections, staggered rows)
  src/stitch/satin.rs     satin columns: two rails, auto-satin, underlays, short stitches
  src/stitch/stroke.rs    running / triple-run stitch
  src/boolean.rs          polygon booleans and offsets (i_overlay)
  src/design.rs           planner: overlap removal, cap order, routing, trims
  src/checks.rs           digitizing checks (sizes, widths, lettering, hoop)
  src/formats/            PES (+PEC), DST, EXP, JEF, VP3, Skitch PEN writers;
                          PES/PEC/DST/EXP/JEF readers; preview; worksheet
  src/machine/            Skitch Bluetooth protocol (+ btleplug client, `ble` feature)
  src/studio/             editor (egui on OpenGL via glow) + MCP server (`gui` feature)
  src/mcp_bridge.rs       stdio ↔ HTTP bridge for MCP clients that launch a command

Build

BASH
cargo build --release                        # CLI + MCP bridge, no system deps
cargo build --release --features gui,ble     # + the studio editor and Skitch upload

Linux needs the usual X11/Wayland and OpenGL dev libraries for gui. libdbus is vendored for ble.

Stitch types

TypeWhat it doesWorks on
Fill (tatami)Staggered rows, any angle, with underlay (edge walk + rows) and pull compensationFilled shapes
SatinZigzag column between two rails, with center/contour/zigzag underlay, pull compensation and short stitches on tight curves; plain, S-stitch or zig-zag top stitching; several threads across the column (multicolor satin)Strokes (any width); Ink/Stitch-style two-rail paths with rungs; filled shapes: rings use inner/outer outline, bars/letters/crescents split at their tips (auto-satin), or border follows the outline
RunRunning stitch, single or triple (bean)Strokes and outlines
ContourRows that follow the outline inward, or one spiral out from the center (Ink/Stitch's circular fill)Filled shapes
BlanketE-stitch: a line with prongs into the shapeEdges, appliqué
AppliquéPlacement line → stop → tack-down → stop → satin coverFilled shapes
ManualEvery path point is a needle pointImported machine files, pen tool
MeanderOne wandering line through the shape, quilting style: light and softFilled shapes
RippleOpen running-stitch rows following the outline, or one spiralFilled shapes
Cross-stitchA grid of X's, sewn as rows of half-crosses out and backFilled shapes
TartanWoven stripes in several threads (a mirrored sett you edit in the panel), each thread its own color blockFilled shapes

Satins wider than 7 mm are auto-split (shorter, staggered stitches) and use auto spacing (narrow columns more open, wide ones denser).

Planner features:

  • Remove overlaps: fill hidden under later objects isn't sewn (keeps 0.5 mm of overlap).
  • Cap order: center-out, bottom-up, grouped by color, still respecting layering.
  • Routing: travel stitches stay inside shapes: straight across where a straight line stays inside, otherwise round the inside of the outline (Ink/Stitch's underpath), so a fill with a cut-out is sewn with few or no cuts. Trims only where neither works (up to 50 mm of travel).
  • Sewing control per object: a start and an end point (where the thread comes in and leaves, so the next object is close), trim after, stop after (to lay foam or trim appliqué). The document can also connect objects up to N mm apart with running stitches instead of cuts.
  • Fabric presets: standard, thin cotton cap, structured cap, knit.
  • Checks: narrow fills, wide/narrow satins, small lettering, tiny gaps, fully covered objects, hoop fit.
  • Group colors: reorder to cut thread changes without breaking layering.

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)