dxf
🤖 AI Summary
This skill generates validated 2D `.dxf` files from natural-language descriptions or CAD geometry by executing Python sources that define a `gen_dxf()` function using `ezdxf`, supporting both standalone drafting and 3D model projection.
How to Install
Claude Code:
git clone --depth 1 https://github.com/earthtojake/text-to-cad.git && cp text-to-cad/skills/dxf ~/.claude/skills/dxf -r# 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.
## Purpose
Create or modify 2D DXF drawings from natural-language requirements or from CAD geometry, generate validated `.dxf` artifacts, and return checked outputs. DXF sources are Python files defining `gen_dxf()` returning an `ezdxf` document; the CLI owns output paths.
Two source shapes are supported:
- **Standalone drafting**: a Python source defining only `gen_dxf()`. Use for pure 2D outputs — gaskets, panels, templates, cut layouts — with no 3D model behind them.
- **CAD projection**: a `gen_dxf()` added to a CAD generator source that also defines `gen_step()`. Use when the DXF is a drawing or profile of a 3D part; create and validate the STEP geometry with `$cad` first, then add the projection in the same source file.
## Use this skill when
Use this skill when the user asks for DXF files, 2D drawings, profiles, outlines, templates, gaskets, panels, flat patterns, or cut layouts for laser, plasma, waterjet, or CNC routing.
Use `$cad` for the 3D part or assembly a DXF derives from. Use `$sendcutsend` for SendCutSend-specific upload preflight.
## Defaults
Use these defaults unless the user specifies otherwise:
- Units: millimeters; set them explicitly on the document (`doc.units = ezdxf.units.MM`).
- Geometry lives in modelspace at 1:1 scale.
- Cut profiles are closed polylines or closed line/arc loops; open contours only for engraving or reference geometry.
- Layers carry intent: keep cut geometry and bend/fold lines on separate layers, and include "bend" in bend-layer names so downstream tools classify them as bends rather than cuts.
- DXF layers are drawing structure, not STEP part/assembly structure.
## Tool
The launcher lives in the DXF skill directory:
```bash
python scripts/dxf targets... [flags]
```
Use the active project Python interpreter; treat `python` as an interpreter placeholder, and use `--help` for the full interface. Target paths resolve from the command's current working directory; run from the workspace that owns the artifacts with cwd-relative target paths. Keep a DXF output and its Python generator in the same directory with the same basename unless the user requests otherwise.
A DXF target is a Python source defining:
```python
def gen_dxf():
...
return document
```
Plain generated Python targets write sibling `.dxf` outputs. Use `-o`/`--output` only with one plain generated Python target, or use `SOURCE.py=OUTPUT.dxf` positional pairs for per-target custom outputs. Do not put output paths in the `gen_dxf()` return value.
`scripts/dxf` is a generator; it does not inspect existing `.dxf` files. For existing DXF inspection, use `ezdxf` for entity/layer checks and `$cad-viewer` for visual review.
## Workflow
1. Convert the request into a
Details
| Category | Coding → generation |
| Source | earthtojake/text-to-cad |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 6.8K |
| Est. per Skill | 622 (shared across 11 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
jq
jq — JSON Querying and Transformation Overview jq is the standard CLI tool for querying and reshapin
pubmed-database
PubMed Database Overview PubMed is the U.S. National Library of Medicine's comprehensive database pr
angular-ui-patterns
Angular UI Patterns Core Principles Never show stale UI - Loading states only when actually loading
animejs-animation
Anime.js Animation Skill Anime.js is a lightweight but extremely powerful JavaScript animation engin
Works Well With
Skills from the same repository — often designed to work together
bambu-labs
Bambu Labs Provenance: maintained in earthtojake/text-to-cad(https://github.com/earthtojake/text-to-
cad-viewer
CAD Viewer Provenance: maintained in earthtojake/text-to-cad(https://github.com/earthtojake/text-to-
cad
CAD generation, inspection, and validation Provenance: maintained in earthtojake/text-to-cad(https:/