Skip to main content

build123d-techdraw

CI Docs PyPI Python Versions License: Apache-2.0 Ruff Mypy

build123d-techdraw is a modern, high-performance, Apache 2.0-licensed 2D technical drawing and blueprint engine for build123d (v0.13.0+) and Python CAD.


🎯 Comparison Matrix

Feature build123d-techdraw draftwright build123d-drafting-helpers
Open Source License Apache 2.0 (Permissive, enterprise friendly) AGPLv3 (Copyleft, restrictive) MIT
build123d Compatibility >= 0.13.0 (Strictly stable public APIs) < 0.12 (Crashes on OCP symbols) Legacy
Annotation Architecture True 2D Paper-Space (mm) 3D B-Rep sketch faces (bloats kernel) Pure 2D overlay
Interactive Dual-Theme SVG Yes (Dark Blueprint ↔ Clean White ISO) No (Raster/Basic SVG) No
GPU Shaded + Vector Views Yes (Opt-in WebGPU: Gooch, Toon, Blueprint, BOM, X-Ray + SSAO) No No
GPU Visibility-Buffer HLR Yes (Fast WebGPU depth + Face-ID HLR with crisp vector output) No No
SDF / JFA Smart Layout Yes (2D Euclidean clearance field for dims, balloons & leaders) No No
Interactive 3D HTML5 Export Yes (Zero-CDN WebGL2 viewport, section cut, explode, BOM linking) No No
Standard ISO 5457 Borders Yes (A0–A4 portrait/landscape, grid marks) Custom templates Partial
ISO 7200 Title Blocks Yes (Configurable fields, projection cones) Hardcoded Minimal
GD&T Feature Control Frames Yes (ISO 1101 geometric tolerances & datums) No No
ISO 1302 Surface Roughness Yes (Machining required/prohibited symbols) No No
Automated Multi-View Layout Yes (ISO first-angle default, auto-scale solver, parallel projection) Manual view placement Manual
Automated Assembly BOM Yes (Recursive component discovery & balloons) Manual BOM tables No
Multi-Format Export SVG, Native PDF 1.4 (16×–30× faster), 1:1 DXF, 3D HTML5 SVG / PDF SVG

🏗️ Core Architecture: Paper-Space Hybrid

Traditional automated drafting tools often generate dimension arrows and text as 3D planar B-Rep faces directly in the CAD kernel. This causes severe computational slowdowns, bloats the OpenCASCADE kernel memory, and causes text sizes to distort when views are scaled.

build123d-techdraw implements a paper-space hybrid vector architecture:

  1. Geometry Projection: 3D shapes are projected via build123d.Drawing into pure 2D vector path segments.
  2. Paper-Space Annotations: Dimensions, GD&T frames, surface finish symbols, BOM balloons, centerlines, and ISO 7200 title blocks are rendered directly in true 2D paper space ($mm$).
  3. Invariant Typography: Text heights ($2.5\text{ mm}$ for dimensions, $3.5\text{ mm}$ for headers) and arrowheads remain crisp, invariant, and fast, regardless of whether a view is scaled $1:1$, $1:5$, or $10:1$.

📦 Installation

# Core package (100% GPU-free, with uv)
uv add build123d-techdraw

# Optional WebGPU acceleration (shaded views, GPU HLR, WGSL SDF layout)
uv add build123d-techdraw --extra gpu

# With pip
pip install build123d-techdraw
pip install "build123d-techdraw[gpu]"

🚀 GPU Shading, Visibility-Buffer HLR, SDF Layout & Interactive 3D HTML5

  • WebGPU Shaded + Vector-Edge Views: Render Gooch + SSAO, Blueprint Shaded, Toon, BOM Part Colors, or X-Ray Fresnel views underneath exact vector edges in both SVG and native PDF 1.4 (examples/shaded_technical_views.py).
  • GPU Visibility-Buffer HLR: Accelerate hidden-line removal on large assemblies (hlr="gpu" | "auto") while keeping crisp vector SVG/PDF/DXF output (examples/gpu_hlr_assembly.py).
  • SDF / Jump-Flooding Smart Layout: Compute a 2D sheet clearance field (compute_sheet_sdf, WebGPU JFA+1 with automatic CPU SciPy EDT fallback) for zero-overlap dimensions, balloons, and leaders (examples/sdf_smart_layout.py).
  • Zero-CDN Interactive 3D-in-2D HTML5: Export a single .html file (sheet.export_html(...)) with a live WebGL2 3D viewport, custom GLSL shaders, X/Y/Z section-plane cuts, assembly explode, and BOM hover/click linking (examples/interactive_3d_blueprint.py).
  • Fast Core CPU & Native PDF 1.4: 4D spatial-hash hidden-edge deduplication (~11× faster), parallel multi-view projection, and native PDF 1.4 output (16×–30× faster; run uv run python examples/benchmark_performance.py).

WebGPU Shaded Technical Views


⚡ Quickstart

import build123d as bd
from build123d_techdraw import DrawingSheet, SheetSize, add_standard_multiview

# 1. Model a 3D CAD part
part = bd.Box(100.0, 50.0, 30.0)

# 2. Set up an ISO A3 drawing sheet
sheet = DrawingSheet(sheet_size=SheetSize.A3_LANDSCAPE)
sheet.set_title_block(
    title="ENCLOSURE BASE",
    drawing_number="DWG-001",
    author="J. DOE",
    material="AL 6061-T6",
)

# 3. Add standard orthographic multi-view layout with auto-scaling
layout = add_standard_multiview(
    sheet=sheet,
    shape=part,
    scale="auto",  # Automatically selects standard ISO 5455 scale
    auto_dimensions=True,  # Adds overall Length, Height, and Depth dimensions
    # layout="first_angle" is the ISO default; pass "third_angle" for ASME / US drawings
)

# 4. Export to interactive SVG, print-ready vector PDF, and 1:1 DXF
sheet.export_svg("blueprint.svg")
sheet.export_pdf("drawing.pdf")
sheet.export_dxf("flat_pattern.dxf")

🖼️ Generated Output Preview

Enclosure Base Blueprint


🎨 Native build123d Paradigms: Builder & Algebraic Modes

build123d-techdraw supports both programming modes that build123d users love, with direct 3D topological selections (edges(), faces(), vertices()):

1. 🏗️ Builder Mode (Context Managers & Auto-Registration)

import build123d as bd
from build123d_techdraw import (
    BuildDrawing,
    CenterMark,
    DatumFeature,
    FeatureControlFrame,
    FrontView,
    GDTCharacteristic,
    GeneralNotes,
    IsometricView,
    LinearDimension,
    SheetSize,
    TitleBlock,
    TopView,
)

with BuildDrawing(SheetSize.A3_LANDSCAPE) as sheet:
    TitleBlock(title="BRACKET BLUEPRINT", drawing_no="DWG-001", material="AL 6061-T6")
    GeneralNotes(["1. ALL DIMENSIONS IN MILLIMETERS.", "2. ISO 2768-mK."])

    # Front View with topological annotations
    with FrontView(part, center=(150.0, 105.0), scale=1.0) as front:
        CenterMark(part.faces().filter_by(bd.GeomType.CYLINDER)[0])
        LinearDimension(part.edges().filter_by(bd.Axis.Z).sort_by(bd.Axis.X)[0], offset=-15.0)
        DatumFeature("A", target=part.faces().sort_by(bd.Axis.Z)[0])
        FeatureControlFrame(
            GDTCharacteristic.PARALLELISM,
            tolerance_value="0.05",
            datum_refs=["A"],
            target=part.faces().sort_by(bd.Axis.Z)[-1],
        )

    # Top View below the Front View (ISO first-angle), dimensioned along its front edge
    with TopView(part, center=(150.0, 180.0), scale=1.0):
        front_edge = part.vertices().group_by(bd.Axis.Y)[0]
        v_min = front_edge.sort_by(bd.Axis.X)[0]
        v_max = front_edge.sort_by(bd.Axis.X)[-1]
        LinearDimension(v_min, v_max, offset=15.0, direction="horizontal")

    with IsometricView(part, center=(265.0, 105.0), scale=0.8):
        pass

sheet.export_svg("bracket_builder.svg")

2. ⚡ Algebraic Mode (Operators, Chaining & Composition)

import build123d as bd
from build123d_techdraw import (
    CenterMark,
    DrawingSheet,
    FrontView,
    IsometricView,
    LinearDimension,
    SheetSize,
    TitleBlock,
    TopView,
)

sheet = DrawingSheet(SheetSize.A3_LANDSCAPE)
sheet += TitleBlock(title="BRACKET BLUEPRINT", drawing_no="DWG-001", material="AL 6061-T6")

# Create views and layout relatively
front = FrontView(part, scale=1.0).locate((150.0, 105.0))
top = TopView(part, scale=1.0).align_to(front, direction="below", spacing=25.0)
iso = IsometricView(part, scale=0.8).align_to(front, direction="right", spacing=50.0)

# Attach dimensions directly to views
front += CenterMark(part.faces().filter_by(bd.GeomType.CYLINDER)[0])
front += LinearDimension(part.edges().filter_by(bd.Axis.Z).sort_by(bd.Axis.X)[0], offset=-15.0)
front_edge = part.vertices().group_by(bd.Axis.Y)[0].sort_by(bd.Axis.X)
top += LinearDimension(front_edge[0], front_edge[-1], offset=15.0)

# Compose onto sheet via operators
sheet += [front, top, iso]
sheet.export_svg("bracket_algebraic.svg")

🔩 Assembly Blueprint & Automated BOM

import build123d as bd
from build123d_techdraw import (
    DrawingSheet,
    SheetSize,
    add_assembly_bom_and_balloons,
    add_standard_multiview,
)

# 1. Build an assembly of labeled components
base = bd.Box(120.0, 80.0, 20.0)
base.label = "Machined Baseplate"

pin1 = bd.Cylinder(radius=6.0, height=30.0).move(bd.Location((30.0, 20.0, 25.0)))
pin1.label = "Dowel Pin"

pin2 = bd.Cylinder(radius=6.0, height=30.0).move(bd.Location((-30.0, -20.0, 25.0)))
pin2.label = "Dowel Pin"

assembly = bd.Compound(children=[base, pin1, pin2])

# 2. Create sheet and multi-view layout
sheet = DrawingSheet(sheet_size=SheetSize.A3_LANDSCAPE)
layout = add_standard_multiview(sheet, assembly, scale="auto")

# 3. Automatically tally quantities, populate BOM table, and place radiating balloons
bom, balloons = add_assembly_bom_and_balloons(
    sheet=sheet,
    assembly=assembly,
    target_view=layout.isometric,
    balloon_distance=30.0,
)

sheet.export_svg("assembly_drawing.svg")

🖼️ Generated Output Preview

Assembly Drawing with Automated BOM and Balloons


🎨 Interactive Dual-Theme SVG

Exported SVGs include dynamic CSS variables and an embedded client-side theme switcher button:

  • Dark Engineering Blueprint: Slate blue background (#0d1929), glowing cyan visible lines, golden dimensions, and high-contrast drafting layout.
  • Clean White ISO Archival: Pure white paper (#FFFFFF), solid black lines, gray dashed hidden lines, and standard engineering typography.

🧪 Development & Quality Standards

build123d-techdraw adheres to modern Python packaging and CI/CD standards:

  • Package Manager: uv (uv run, uv lock).
  • Build Backend: hatchling + hatch-vcs for dynamic Git-tag versioning.
  • Linter & Formatter: ruff with line length 100.
  • Type Checker: mypy in strict mode (100% typed public APIs).
  • Test Matrix: pytest + pytest-cov across Python 3.11, 3.12, 3.13, 3.14.
# Run linters
uv run ruff check
uv run ruff format --check

# Run strict type checking
uv run mypy src tests

# Run test suite with coverage
uv run pytest

# Build documentation
uv run mkdocs build --strict

📄 License

Licensed under the Apache License, Version 2.0.

Metadata

Release files for build123d-techdraw 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for build123d-techdraw 0.10.0
File Size Uploaded Provenance Actions
build123d_techdraw-0.10.0.tar.gz 6.8 MB With provenance Details for build123d_techdraw-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for build123d-techdraw 0.10.0
File Interpreter ABI Platform Actions
build123d_techdraw-0.10.0-py3-none-any.whl Python 3 none any Details for build123d_techdraw-0.10.0-py3-none-any.whl

Total release size: 7.1 MB

Release files / build123d_techdraw-0.10.0.tar.gz

Download URL build123d_techdraw-0.10.0.tar.gz
Size 6.8 MB
Tags Source
SHA-256 checksum
How to use checksums
7cfbabe3f4c50d8376ec709820b7f4f54c41074cffaa8034af138a8627611e60
BLAKE2b-256 checksum
How to use checksums
ee7a7a9e4be2baa70a19df92855ff4e8040d8a65ef4dd0d2ab70692defa6b0b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / build123d_techdraw-0.10.0-py3-none-any.whl

Download URL build123d_techdraw-0.10.0-py3-none-any.whl
Size 270.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eee773c830796fa41b456e582a575985e2825ea1a3f0a4f088d3f4e44e40412
BLAKE2b-256 checksum
How to use checksums
042e216e3810cd8e0987ca0204572823cac57c249015d987b3647a7ef58cd1d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for build123d-techdraw 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for build123d_techdraw-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page