Skip to main content

cadgen

STEP-first CAD artifact generation runtime for CAD agent skills, built on build123d and OCCT.

The package boundary is intentionally narrow: it owns artifact generation, validation, selector/topology extraction, mesh settings, source hashing, and the cadgen-step-artifact CLI. It also includes small generated-script helpers such as cadgen.assembly.AssemblyHelper, which wraps native build123d labels, joints, and compounds without owning skill-specific UX. Prompts, viewer UI, and snapshot job orchestration stay in their owning skills.

cadgen is developed in earthtojake/text-to-cad and was previously named cadpy inside that repository.

Public API

The supported import surface is the root cadgen exports plus the top-level cadgen.* modules:

  • Generator-script helpers: root exports (AssemblyHelper, MateRelation, MateTarget, label_text, label_shape, target, ensure_step_glb_artifact, validate_step_glb_artifact), cadgen.assembly, and cadgen.step_scene (import_step, load_step_scene, located_shape, occurrence_selector_id, scene_occurrence_shape).
  • Generator-script helpers (2D): cadgen.sources (load_source_module) and cadgen.flatten (planar-face projection/unfold, contour emission, kerf offsetting) for .dxf.py drawing generators.
  • Skill CLI surface: cadgen.generation (generate_step_targets, generate_dxf_targets, targets_include_output_pairs), cadgen.catalog, cadgen.metadata, cadgen.analysis, cadgen.lookup, cadgen.cad_ref_syntax, cadgen.selector_types, cadgen.reporting, cadgen.cli_logging, cadgen.render, cadgen.step_artifacts, cadgen.step_targets, cadgen.step_export, cadgen.drawing_checks (DXF drawing validation), and cadgen.drawing_render (DXF render payload + SVG snapshots).
  • Process entry points: cadgen-step-artifact, python -m cadgen.step_artifact_cli, python -m cadgen.step_export_target, and python -m cadgen.dxf_artifact.

Everything under cadgen._internal is private implementation (the STEP scene, generation, GLB/topology, and export engines live there) with no import stability between releases; cadgen.generation and cadgen.step_scene are thin facades over those engines that re-export only the supported names.

Install

Released versions are published to PyPI by the repository's Release workflow; the package version always matches the CAD plugin release version:

python -m pip install cadgen

Production skill bundles pin the exact release version in their requirements.txt (for example cadgen==0.4.0) and keep a vendored copy of this package as an offline fallback:

python -m pip install ./scripts/packages/cadgen

Local Development

Install it editable into the repo CAD runtime when working on the source package directly:

./.venv/bin/python -m pip install -e packages/cadgen

After that, changes under packages/cadgen/src/cadgen are immediately visible to local source checkouts that import the package directly.

On develop, the CAD skill and root Viewer point at this package through the development symlinks skills/cad/scripts/packages/cadgen and viewer/packages/cadgen. Keep those links intact with scripts/dev/setup-symlinks.sh --check.

Production Bundling

Build a wheel and install it into each skill's bundled Python environment during packaging:

./.venv/bin/python -m build packages/cadgen
python -m pip install packages/cadgen/dist/cadgen-*.whl

The CAD and cad-viewer skills should depend on the package artifact they bundle, not on skills/cad or the repository root. Production packaging vendors installable packages under skills/cad/scripts/packages/cadgen and skills/cad-viewer/scripts/viewer/packages/cadgen; production packaging can also set VIEWER_CAD_PYTHON to a skill-local Python runtime with this package installed. Production skill bundles install cadgen==<release version> from PyPI first and fall back to the vendored copy when offline.

Metadata

Release files for cadgen 0.4.12

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

Source distribution (sdist)

Source distribution for cadgen 0.4.12
File Size Uploaded
cadgen-0.4.12.tar.gz 262.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cadgen 0.4.12
File Interpreter ABI Platform
cadgen-0.4.12-py3-none-any.whl Python 3 none any Details

Total release size: 561.4 kB

Release files / cadgen-0.4.12.tar.gz

Download URL cadgen-0.4.12.tar.gz
Size 262.0 kB
Tags Source
SHA-256 checksum
How to use checksums
26fdfda1ad9911303b040eeba26b04d123dc693e0daeeea208cb1456fbbc48ce
BLAKE2b-256 checksum
How to use checksums
245c82028b58cfcc00aca8cbd7ddab70fbfd9628d49b268a1fe04266e9fe9809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 15, 2026.

Transparency log

Release files / cadgen-0.4.12-py3-none-any.whl

Download URL cadgen-0.4.12-py3-none-any.whl
Size 299.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3074690d37cf844c8de2208d613586da8d9098453f50d117267e74846397742
BLAKE2b-256 checksum
How to use checksums
d35eef97a1f51653d4917698b232d4307e78845153a9d985a53178ce4e2880a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.28

2 release files

0.4.27

2 release files

0.4.26

2 release files

0.4.25

2 release files

0.4.24

2 release files

0.4.23

2 release files

0.4.22

2 release files

0.4.21

2 release files

0.4.20

2 release files

0.4.19

2 release files

0.4.18

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.14

2 release files

0.4.13

2 release files

This release

0.4.12 This release

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

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