dxf

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

465|41|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/autonomous-ai/openharness --skill dxf-autonomous-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dxf
Source: https://github.com/autonomous-ai/openharness/tree/main/store/agents/text-to-cad/skills/dxf
Command: npx skills add https://github.com/autonomous-ai/openharness --skill dxf-autonomous-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cadgen, and includes references (resource) components.

What problem does it solve? Creating production-ready 2D DXF drawings for laser, plasma, waterjet, or CNC cutting normally requires manual CAD drafting and separate validation passes. This Skill turns natural-language requirements or existing CAD geometry into validated DXF files generated from Python build123d sources, with checks enforced during generation. ## Core Features & Use Cases - Three generation workflows: draft drawings from scratch (gaskets, panels, templates), derive flat patterns from generated STEP parts, or flatten imported vendor STEP files with content-hash staleness tracking. - Built-in validation: cut-layer profiles must close, degenerate and duplicate entities are rejected, and open geometry is only allowed on bend/engrave layers — all enforced before the file is written. - Deterministic outputs and rendering: output bytes are a function of geometry, and cadgen dxf snapshot renders any DXF to a PNG for visual review. - Use Case: Ask for a mounting plate flat pattern with kerf compensation derived from an existing 3D bracket model; the Skill writes the drawing script, builds the DXF, validates it, and hands it to the CAD viewer. ## Quick Start Use the dxf skill to create a gasket drawing 60 by 40 millimeters with a 4.5 millimeter center hole and validate the generated DXF file.

Frequently Asked Questions about dxf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a DXF file from Python?

Write a Python script with a parameterless function decorated with @dxf that returns build123d 2D geometry, then run the script directly. The engine writes the sibling .dxf file and runs validation checks before anything is saved.

How do I create a flat pattern DXF from a STEP file?

Read the STEP with cadgen.read_step, which records its content hash as a build input, then call flatten.flat_pattern with a coordinate and optional kerf value. For STEP files generated by your own project, import the model script and call it instead of reading the artifact.

Does the DXF skill require Node.js?

Only the cadgen dxf snapshot rendering command needs Node 20 or newer on PATH, since it meshes the flat pattern through a bundled Node one-shot. Generating and validating DXF files requires only the cadgen Python distribution.

Why does my DXF build fail validation?

Builds fail when cut-layer profiles are not closed, entities are zero-length or duplicated, the document is explicitly unitless, or modelspace is empty. Open geometry is only permitted on layers whose names indicate bend, engrave, or reference intent.

Can I put text in a DXF drawing for laser cutting?

Yes, but text must be bd.Text engraved outlines placed on a marking layer such as ENGRAVE, never DXF TEXT entities. Cut and marking toolchains consume geometry, and font rendering inside CAM software is unreliable.

When should I not read a STEP file with read_step?

Never point read_step at a STEP file your own project generates, because the drawing's input would change on every model run and the freshness gate could never report current. Import the model script and call it instead so the dependency is tracked by result.