返回资讯中心
外部精选
软件工程
#开发者实时流

Show HN: Hackerscad – Code-first CAD with MCP server for AI agents

hackerscad is a parametric CAD where the model is code. Type and the 3D view follows; round an edge with the mouse and the code is written for you. Exact solids, real threads, files for every printer.

Hacker News 最新Kapendev2026/10/28 · 2 天前7 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Parts you write, see and print.

hackerscad is a parametric CAD where the model is code. Type and the 3D view follows; round an edge with the mouse and the code is written for you. Exact solids, real threads, files for every printer.

Paste this to it: it installs hackerscad's skill, then hackerscad itself if it's missing (asking you first) and the MCP server. Then it reads the language from docs written for agents, checks and renders its models, and shows them in your window. More below

A small, sandboxed language with units, selectors and libraries. It diffs, versions and reviews like any other code.

Fillets, holes, sketches on a face, parts moved and patterned: every click lands in the file, readable.

3MF with a colour per part, STL, STEP, or a drawing with views and dimensions.

unittest blocks hold what the part must do. The command line checks, renders and exports, in a script or in CI.

// batteries.hcad: a holder for AA cells import std;

@param immutable cells = 4; immutable aa = 14.5.mm, play = 0.4.mm; immutable hole = aa + play, pitch = hole + 2.mm;

@part Solid holder() { auto b = box(cells * pitch + 2.mm, pitch + 2.mm, 22.mm) .fillet(edges.parallel(Z), r: 3.mm);

// a pocket for each cell, its rim chamfered foreach (i; 0 .. cells) b -= cylinder(d: hole, h: 22.mm) .move(x: (i - (cells - 1) / 2.0) * pitch, z: 3.mm); b = b.chamfer(edges.of(faces.top), d: 0.6.mm);

// a grip on both long sides, last return b .knurl(faces.front, kind: "diagonal", pitch: 3.mm) .knurl(faces.back, kind: "diagonal", pitch: 3.mm); }

// a cell in the first pocket, to see it fit @part("Yellow Pop", alpha: 0.4, export: false) Solid cell() { auto body = cylinder(d: aa, h: 49.5.mm); auto tip = cylinder(d: 5.5.mm, h: 1.mm) .move(z: 49.5.mm); return (body + tip) .move(x: -(cells - 1) / 2.0 * pitch, z: 3.mm); }

unittest { assert(hole > aa, "an AA cell does not fit"); assert((holder & cell).volume < 0.01.mm ^^ 3, "the cell rubs against the holder"); }

$ hcad check batteries.hcad

part holder 69.6 × 19.9 × 22.0 mm volume 16091.0 mm³

part cell 14.5 × 14.5 × 50.5 mm (reference)

ok in 366 ms

$ hcad export batteries.hcad -o batteries.3mf

batteries.3mf · drag to turn

Ready-made, from screws to moulds

Hardware

Threads

Gears

Hinges

Snaps

Enclosures

Joints

Molds

Flex

Under the hood

For the curious.

Tell Claude or another agent what you need. It models it, checks its sizes, shows it in your window and leaves you code you can change.

Paste this: it installs the skill, then hackerscad itself if it is missing (asking you first) and the MCP server.

One package per system: the app, the command line tool and the MCP server.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →