draftwright 0.6.0-alpha.1

Automated technical drawings from STEP B-rep: a Rust port of draftwright.
Documentation

Draftwright turns a 3D STEP file into a complete, dimensioned engineering drawing. It recognises the part's features (holes, patterns, slots, pockets, turned steps, threads), decides what to dimension and where, reads tolerances and GD&T from AP242 files, lays out the views on a standard sheet, and tells you anything it could not state. One Rust binary, one command, one repeatable drawing.

Python

pip install draftwright
from draftwright import make_drawing
svg_path, pdf_path = make_drawing("part.step", out="drawing", title="Bracket")

STEP paths and build123d shapes are supported (install build123d separately for shapes). The wheel also installs draftwright and draftwright-mcp on PATH.

Changed from 0.4: make_drawing returns (svg_path, pdf_path) as strings; the second file is now PDF, not DXF. DXF export and the other old Python classes/functions are unavailable. Unsupported options with non-default values raise TypeError; old names/imports give migration guidance. Pin draftwright<0.6 to keep the old API. The Rust engine uses a Spec. See the Python API, keyword mapping and interrupt behaviour.

Ways to use it

  • In the browser: draftwright.io. Open a STEP file, see the drawing, move and edit dimensions, add requirements, and export PDF or STEP. The whole engine runs in the browser as WebAssembly.
  • With an AI agent: the hosted MCP server at mcp.draftwright.io lets Claude, ChatGPT and other MCP clients open parts, read drawings and make changes. See docs/mcp.md.
  • On the command line: draftwright render part.step -o part (below).
  • From Rust: the draftwright crate's five stateless operations (analyse, plan, edit, render, review). See docs/model.md.

Install

With a recent stable Rust toolchain:

cargo install draftwright        # installs draftwright and draftwright-mcp

Without Rust, download a ready-built archive for macOS (Apple silicon), Linux x86_64 or Windows x86_64 from the latest release.

From 0.6.0, the same two commands install from PyPI without Rust:

uv tool install draftwright      # or: pipx install draftwright

PyPI releases before 0.6 use the archived Python implementation. Starting with 0.6, this Rust project provides both commands and the small Python API. Pin draftwright<0.6 to keep the full old API. The old command form draftwright part.step [options] still renders a drawing; see CLI migration for the options it keeps.

Shell completion: draftwright completions zsh (or bash, fish, powershell, elvish) prints a completion script; see docs/engine.md for where to put it.

Quick start

draftwright render part.step -o part                     # part.svg and part.pdf
draftwright render part.step -o part --shaded --below    # shaded views from above and below
draftwright render part.step -o part --formats pdf,png   # choose formats
draftwright review part.step                             # the drawing as text, with what it could not state

A drawing is adjusted with a Spec: a small JSON file naming only what you want different from the automatic drawing. For example, to fill in the title block:

{ "sheet": { "title": { "title": "Mounting plate", "number": "MP-001" } } }
draftwright render part.step --spec part.drawing.json -o part
draftwright spec part.pdf            # every drawing carries its Spec; this reads it back

More:

draftwright diff old.step new.step --spec part.drawing.json -o changes   # carry a drawing to a new revision
draftwright pack assembly.step -o pack                                   # drawings and parts list for an assembly
draftwright --help

What it does

  • Recognises features from the B-rep with quiddity: holes and counterbores, hole patterns, slots, pockets and recesses, turned steps, grooves, chamfers and fillets, threads. Anything it cannot read is reported, not guessed.
  • Dimensions completely. Each feature family has its own rules. Dimensions are placed without collisions, and every omission is reported with a reason.
  • Reads PMI. Tolerances, fits, datums, GD&T frames, threads and surface finish come from AP242 semantic PMI. Specify writes requirements back into STEP.
  • Lays out sheets. Views, sections, detail views and hole tables go on ISO 5457 sheets with an ISO 7200 title block. Sheet size and scale are chosen automatically, using more sheets when needed.
  • Is deterministic. The same inputs give the same bytes. SVG and PDF carry real, searchable text and embed the Spec that made them.
  • Handles assemblies. pack draws each made part once and writes an ISO 7573 parts list, item numbers and a CSV/JSON bill of materials.
  • Tracks revisions. diff carries a drawing's edits to a new revision of the part and marks up what changed.

Examples

Drawings of NIST test parts, FreeCAD and build123d parts, and assemblies, rebuilt by CI on every release, are in pzfreo/dw-examples.

Documentation

Status

Draftwright is young and moving quickly: 0.2.x releases come every few days. Drawings report what they do not state, but dense parts can still be less tidy than a hand-made drawing; see Known limitations. Issues and example parts are welcome.

Related projects

  • quiddity: feature recognition from STEP B-rep, and the haecceity geometry kernel Draftwright is built on.
  • Specify: writes requirements (tolerances, fits, GD&T, BOM data) into STEP as AP242 PMI. It is the Specify view at draftwright.io/specify.
  • dw-examples: the example drawings.
  • draftwright-python: the original Python implementation, no longer developed.

Licence and contributing

Draftwright is licensed under the GNU AGPL v3.0, and is also available under separate commercial terms; contact paul@draftwright.io. quiddity and haecceity are Apache-2.0. The bundled IBM Plex fonts are under the SIL Open Font License 1.1.

Contributions are welcome. See CONTRIBUTING.md; pull requests need the Contributor License Agreement.