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, andcadgen.step_scene(import_step,load_step_scene,located_shape,occurrence_selector_id,scene_occurrence_shape). - Generator-script helpers (2D):
cadgen.sources(load_source_module) andcadgen.flatten(planar-face projection/unfold, contour emission, kerf offsetting) for.dxf.pydrawing 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), andcadgen.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, andpython -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.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cadgen-0.4.14.tar.gz | 271.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cadgen-0.4.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 579.8 kB
Release files / cadgen-0.4.14.tar.gz
| Download URL | cadgen-0.4.14.tar.gz |
|---|---|
| Size | 271.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8260bf35b13a3ab9a87259f299c0e4565024599d942381d328a6f272281fe151
|
|
BLAKE2b-256 checksum How to use checksums |
c7e3055efdd9f79cc46654280e5e3c73fe36ff48220922c9a9bb7f242fe497eb
|
| 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 16, 2026.
Transparency logRelease files / cadgen-0.4.14-py3-none-any.whl
| Download URL | cadgen-0.4.14-py3-none-any.whl |
|---|---|
| Size | 308.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa722bf374821e6b60fa6e42bd8f3011da2d8563b82f86f3ef143b43f12d7052
|
|
BLAKE2b-256 checksum How to use checksums |
4bb4c07ae22a5cd73fd70d1770af91fc332ad2f914f2d9ec7dc029ef0a523012
|
| 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 16, 2026.
Transparency log