dxf
하는 일
이 스킬은 절단 레이아웃, 외곽선, 템플릿을 위해 Python 스크립트로 2D DXF 도면을 만드는 방법을 AI에 안내합니다. 절단기용 파일이 필요한 메이커와 가공자를 위한 스킬입니다.
사용하는 경우
- ✓레이저, 플라즈마, 워터젯 절단을 위한 2D DXF 파일이 필요할 때.
- ✓3D 부품을 평평한 외곽선이나 절단 레이아웃으로 바꾸고 싶을 때.
- ✓뷰어에서 기존 DXF 파일을 검토하거나 편집하고 싶을 때.
스킬 링크
https://github.com/earthtojake/text-to-cad/blob/main/skills/dxf/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“레이저 절단기용으로, 모서리에 구멍 네 개가 있는 100 x 50 mm 판의 DXF 파일을 만들어 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 형상에 대한 Python 도면 스크립트를 작성합니다. CAD 도구가 이를 만들고 DXF 파일로 내보내며, AI는 사용하기 전에 그 파일을 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
DXF generation and validation
Setup
Run the cad command (~/.local/bin/cad where ~/.local/bin is not on your PATH, or where a
project's environment puts its own cad first; cad.cmd on Windows). If cad is not found and
the CAD app was only just added, its server may still be starting: wait five seconds and run the
command again, for up to a minute, before anything else. Otherwise install text-to-cad, outside a sandbox or with its permission:
curl -fsSL https://texttocad.dev/install.sh | sh
On Windows, in PowerShell: irm https://www.texttocad.dev/install.ps1 | iex. Any other failure
says what to do, and cad doctor explains the installation.
Drawings are build123d geometry, so a drawing builds in the server'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 text-to-cad model does: cad run <name>.py
rebuilds it in the server, 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: cad 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
cad 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. cad export writes the DXF.
You never construct a document, name an entity, or write a file from the model.
import build123d as bd
from cad 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
cad run src/gasket.py # prints id: and view:
cad 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
Compoundof 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 asbd.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), orbd.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@modelfunction.Text is
bd.Text(...)engraved OUTLINES on a marking layer, never a DXFTEXTentity: 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.pybeside them that imports each drawing and callsexport(drawing, path)(the model function itself, or the handle its call returns):# src/exports.py from pathlib import Path from cad 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 th
자주 묻는 질문
DXF 파일이란 무엇인가요?
절단 기계가 읽을 수 있는 일반적인 2D 도면 형식입니다.
3D 부품도 만드나요?
아니요. 이 스킬은 2D 도면을 다룹니다. 입체 부품에는 3D CAD 스킬을 쓰세요.
기존 DXF 파일도 열 수 있나요?
네. 이 스킬은 뷰어에서 기존 DXF 파일을 열고 검토할 수 있습니다.
상세 정보
작성자의 원본 설명
Generates, regenerates and validates 2D DXF drawings from Python build123d models, exported by text-to-cad. Use for DXF files, `.py` drawing scripts, 2D profiles, outlines, templates, gaskets, panels, flat patterns, laser/plasma/waterjet cut layouts, and 2D drawing exports of CAD geometry. Opens and visually reviews existing DXF files in the CAD Viewer. Covers the 2D drawing, not the 3D part or assembly it derives from, and not a cutting service's order preflight.
repo: earthtojake/text-to-cad
인기도
- GitHub 스타
- 25k
- 순위
- #10070
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
bambu-labs
25k에이전트가 Bambu Connect나 Bambu Studio를 통해 슬라이스된 또는 슬라이스되지 않은 3D 모델을 Bambu Lab 프린터로 보내도록 돕습니다.
cad
25k에이전트가 3D 부품과 조립품을 Python build123d 스크립트로 설계하고, STEP이나 STL 파일로 내보내며, 치수를 확인하도록 돕습니다.
dfam-check
25k에이전트가 3D 메시 파일을 잘 출력할 수 있는지 확인하고, 오버행, 벽 두께, 지지대 필요성을 보고하도록 돕습니다.
dfm
25k에이전트가 부품을 판금, CNC 가공, 사출 성형으로 만들 수 있는지 검토하고, 무엇을 바꿔야 하는지 확인하도록 돕습니다.