Skip to content
Agentmart
Submit a tool

dxf

Generate, regenerate, and validate 2D DXF drawings from Python build123d sources.

Skill by earthtojake

IndexedMIT★ 22,902
Write a review

Chalk Labs

Need help deploying dxf?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/earthtojake-dxf

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Generate, regenerate, and validate 2D DXF drawings from Python build123d sources. Use for DXF files, `.py` drawing scripts, @dxf models, 2D profiles, outlines, templates, gaskets, panels, flat patterns, laser/plasma/waterjet cut layouts, and 2D drawing exports of CAD geometry. Open and visually review existing DXF files in CAD Viewer.

Use cases: code-generation

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/dxf

What's inside

Skill name
dxf
Description
Generate, regenerate, and validate 2D DXF drawings from Python build123d sources. Use for DXF files, `.py` drawing scripts, @dxf models, 2D profiles, outlines, templates, gaskets, panels, flat patterns, laser/plasma/waterjet cut layouts, and 2D drawing exports of CAD geometry. Open and visually review existing DXF files in CAD Viewer.
License
MIT
Instructions
376 lines in SKILL.md · view on GitHub

Files (4)

  • LICENSE
  • SKILL.md
  • openai.yaml · agents/
  • generator-templates.md · references/

SKILL.md (first lines)

# DXF generation and validation

Provenance: maintained in [earthtojake/text-to-cad](https://github.com/earthtojake/text-to-cad).
Use the installed local skill files as the runtime source of truth; the
repository link is only for provenance and release review.

## Setup

Run cadgen through the `cadgen` command its installation writes, so this skill's commands
share one installation, and its engine server, with the CAD app's:

- `cadgen` below means `cadgen +0.8.4` (`~/.local/bin/cadgen +0.8.4` where `~/.local/bin` is not on your PATH)
- `python` below means `cadgen +0.8.4 run`

For first-time setup or an update, a missing `cadgen` command, a release it says is not
installed, an engine that is not running, or an installation or kernel load error, read
[Setup and troubleshooting](references/setup.md).

Drawings are build123d geometry, so a drawing builds in the engine's warm worker
like any model: the first run of a script loads the CAD kernel (a few seconds),
and later runs reuse it.

## Purpose

Create or modify 2D DXF drawings from natural-language requirements or from CAD
geometry, export validated DXF files, and return checked outputs. A drawing's source
of truth is a Python file named `<name>.py` defining a parameterless `@model` function
that returns planar geometry.

**A drawing is a model.** It builds as any `$cad` model does: `python <name>.py`
rebuilds it in the engine, prints its document's `id:` and page, and writes nothing.
The DXF is exported from that document, by build123d's own exporter, once the drawing
checks pass: `cadgen export <id> drawing.dxf`. A drawing that calls a part model
(`bracket()` in its body) builds that part in the same run. The CAD Viewer and
`cadgen snapshot` read the `.dxf` itself, so the file you hand a cutting service,
the file the viewer draws and the file a snapshot renders are one and the same.

## The contract

**A drawing is a `@model` function that takes no parameters and returns build123d 2D
geometry on z=0: a sketch, a face, wires or edges. `cadgen export` writes the DXF.**
You never construct a document, name an entity, or write a file from the model.

```python
import build123d as bd
from cadgen import model

HOLE_D = 4.5


@model
def gasket():
    with bd.BuildSketch() as cut:
        bd.Rectangle(60, 40)
        bd.Circle(HOLE_D / 2, mode=bd.Mode.SUBTRACT)
    return cut.sketch          # one shape: the CUT layer


if __name__ == "__main__":
    gasket()                   # decoration only declares: this call builds it
```

```bash
python src/gasket.py                       # prints id: and view:
cadgen export "$ID" DXF/gasket.dxf         # ID: the id: line it printed
```

- **One shape** is one layer, `CUT`. That is the whole contract for most drawings.
- **A layer per part** when the drawing genuinely has more than one CAM operation:
  return a `Compound` of labelled children, each label its layer
  (`profile.label, marks.label = "CUT", "ENGRAVE"`). Children sharing a label share
  a layer, and several shapes make one part of a layer as
  `bd.Compound([a, b], label="ENGRAVE")`. A layer name may not be empty or hold any
  of `<>/\":;?*|=` and a backtick.
- **Planar means 2D, on z=0.** The export refuses a document holding a solid
  (`bracket is 3D: a DXF is drawn from 2D geometry a model returns`) and an edge with
  any point more than 1e-6 mm off z=0, by its element name. A face taken from a solid
  sits at that solid's height; relocate it (`flatten.flatten_face(face)`, or
  `bd.Location((0, 0, -z)) * face`).
- **No parameters.** Dimensions are module constants (`HOLE_D = 4.5`) or constants
  imported from the part the drawing derives from; a different drawing is a
  different `@model` function.
- **Text** is `bd.Text(...)` engraved OUTLINES on a marking layer, never a DXF
  `TEXT` entity: cut and marking toolchains consume geometry, and font rendering
  inside CAM is unreliable.
- **Output bytes are a function of the geometry.** Layers are written in name order
  and entities in an order of their content, so an unchanged drawing exports an
  identical file, on any machine, and the file is replaced only when its bytes
  change.
- **Drawings delivered after every change** go in an `exports.py` beside them that
  imports each drawing and calls `export(drawing, path)` (the model function itself,
  or the handle its call returns):

  ```python
  # src/exports.py
  from pathlib import Path

  from cadgen import export

  from gasket import gasket

  ROOT = Path(__file__).resolve().parent.parent

  if __name__ == "__main__":
      export(gasket, ROOT / "DXF/gasket.dxf")
  ```

## The three DXF workflows

Copy the full template for the applicable workflow from
`references/generator-templates.md` when creating a new drawing.

1. **Drafted from scratch** (gaskets, panels, templates, cut layouts with no 3D
   model behind them): a `<name>.py` that builds sketches and returns them.

2. **Flat pattern of a part this project models**: a drawing script beside the
   model it derives from, with its OWN stem (`bracket_drawing.py` beside
   `bracket.py`). Import the model and call it, exactly as an assembly composes a
   child: importing never builds, and inside the drawing's run the call builds the

From earthtojake/text-to-cad, MIT.

More from earthtojake/text-to-cad

Signals

Stars
22,902
Forks
2,229
Open issues
4
Last commit (this folder)
Oct 20, 2026 (10 days ago)
Last release
Oct 20, 2026 (10 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from earthtojake

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get dxf running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying dxf?

CallGet help
Cite this page

dxf skill. Agent Mart. https://agentmart.dev/skills/earthtojake-dxf (last updated 2026-10-24)