CadFlow
Write an ordinary Python program. CadFlow builds the geometry. The host's file
and terminal tools are enough; there is no separate CAD agent, backend, viewer,
or execution service.
Selected release: CadFlow 0.2.0 on PyPI (wheels uploaded 2026-09-08).
API notes below match that release's public frontend, not a source checkout.
Prepare the environment
Create an isolated environment in the user's working directory. Do not modify
system Python or an unrelated project environment.
# macOS 12+ arm64
uv venv --python 3.13 .venv
uv pip install --python .venv/bin/python cadflow==0.2.0
# Linux x86_64, glibc 2.31+
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python cadflow==0.2.0
uv venv does not install pip. Use uv pip install --python .venv/bin/python ...,
not .venv/bin/pip. Stdlib venv still works:
python3.13 -m venv .venv && .venv/bin/pip install cadflow==0.2.0.
Honor the host's network and execution permissions. If PyPI has no wheel for
the current interpreter or platform, stop and report the installer error.
Do not fall back to CadFlow source builds or local wheels to hide a publish gap.
Verify:
.venv/bin/python - <<'PY'
import cadflow as cad
with cad.Model() as model:
box = model.box(2, 3, 4)
print(cad.__version__, box.volume)
PY
Expect version 0.2.0 and a box volume of 24 (floating-point error is fine).
Read references/environment.md
for the tested matrix, provenance, and installer failures.
Model
Use import cadflow as cad. Keep one consistent numeric unit, normally millimetres.
from pathlib import Path
import cadflow as cad
out = Path("mounting_plate.step")
with cad.Model() as model:
plate = model.box(80, 50, 8)
bore = model.translate(model.cylinder(radius=6, height=12), 20, 25, -2)
part = model.cut(plate, bore)
report = part.validate()
if not report.ok:
raise RuntimeError(report.to_dict())
print(part.describe())
part.export_step(str(out))
- One rigid manufactured solid:
cad.Model / cad.Shape.
- Separately manufactured parts, placements, connectors, or joints: the
replayable Part/Assembly API.
- Static cloth, leather, membranes, draped panels, garments:
cadflow.flexible.
That path is a triangle shell, not a BREP solid.
- Keep every
Shape inside the Model that created it.
- After each boolean or finishing feature, read
describe(), validate(),
volume, bbox, and topology. Repair from those facts.
- Export STEP/STL only after the measured result matches the request.
- Reopen STEP with
model.import_step(...) before treating the file as done.
Organize the program however the task needs. There is no required filename,
entry function, project layout, tool-call order, or review stage.
Load on demand
| When |
Read |
| Constructors, sketches, booleans, fillets |
references/part-api.md |
| Parts, placements, connectors, constraints |
references/assembly-api.md |
| Cloth, membranes, garments |
references/flexible-api.md |
| Measure, validate, import, export |
references/inspect-export.md |
| Session, Solid vs Shape, indices, units |
references/pitfalls.md |
| Runnable programs |
examples/mounting_plate.py, examples/hinge_assembly.py, examples/sleeve_panel.py |
Copy patterns from the examples; do not treat them as a required scaffold.
1---2name: cadflow3description: CadFlow Python CAD modeling from PyPI. Use when writing or editing a CadFlow program for a mechanical part, assembly, static cloth, membrane, or garment, preparing a compatible CadFlow environment, exporting STEP, STL, or OBJ, or inspecting CadFlow solids and flexible meshes. CadFlow's native Python API is the modeling interface.4license: MIT5---67# CadFlow89Write an ordinary Python program. CadFlow builds the geometry. The host's file10and terminal tools are enough; there is no separate CAD agent, backend, viewer,11or execution service.1213Selected release: **CadFlow 0.2.0** on PyPI (wheels uploaded 2026-09-08).14API notes below match that release's public frontend, not a source checkout.1516## Prepare the environment1718Create an isolated environment in the user's working directory. Do not modify19system Python or an unrelated project environment.2021```bash22# macOS 12+ arm6423uv venv --python 3.13 .venv24uv pip install --python .venv/bin/python cadflow==0.2.02526# Linux x86_64, glibc 2.31+27uv venv --python 3.12 .venv28uv pip install --python .venv/bin/python cadflow==0.2.029```3031`uv venv` does not install pip. Use `uv pip install --python .venv/bin/python ...`,32not `.venv/bin/pip`. Stdlib venv still works:33`python3.13 -m venv .venv && .venv/bin/pip install cadflow==0.2.0`.34Honor the host's network and execution permissions. If PyPI has no wheel for35the current interpreter or platform, stop and report the installer error.36Do not fall back to CadFlow source builds or local wheels to hide a publish gap.3738Verify:3940```bash41.venv/bin/python - <<'PY'42import cadflow as cad43with cad.Model() as model:44 box = model.box(2, 3, 4)45 print(cad.__version__, box.volume)46PY47```4849Expect version `0.2.0` and a box volume of 24 (floating-point error is fine).50Read [references/environment.md](references/environment.md)51for the tested matrix, provenance, and installer failures.5253## Model5455Use `import cadflow as cad`. Keep one consistent numeric unit, normally millimetres.5657```python58from pathlib import Path59import cadflow as cad6061out = Path("mounting_plate.step")62with cad.Model() as model:63 plate = model.box(80, 50, 8)64 bore = model.translate(model.cylinder(radius=6, height=12), 20, 25, -2)65 part = model.cut(plate, bore)66 report = part.validate()67 if not report.ok:68 raise RuntimeError(report.to_dict())69 print(part.describe())70 part.export_step(str(out))71```7273- One rigid manufactured solid: `cad.Model` / `cad.Shape`.74- Separately manufactured parts, placements, connectors, or joints: the75 replayable Part/Assembly API.76- Static cloth, leather, membranes, draped panels, garments: `cadflow.flexible`.77 That path is a triangle shell, not a BREP solid.78- Keep every `Shape` inside the `Model` that created it.79- After each boolean or finishing feature, read `describe()`, `validate()`,80 volume, bbox, and topology. Repair from those facts.81- Export STEP/STL only after the measured result matches the request.82- Reopen STEP with `model.import_step(...)` before treating the file as done.8384Organize the program however the task needs. There is no required filename,85entry function, project layout, tool-call order, or review stage.8687## Load on demand8889| When | Read |90| --- | --- |91| Constructors, sketches, booleans, fillets | [references/part-api.md](references/part-api.md) |92| Parts, placements, connectors, constraints | [references/assembly-api.md](references/assembly-api.md) |93| Cloth, membranes, garments | [references/flexible-api.md](references/flexible-api.md) |94| Measure, validate, import, export | [references/inspect-export.md](references/inspect-export.md) |95| Session, Solid vs Shape, indices, units | [references/pitfalls.md](references/pitfalls.md) |96| Runnable programs | [examples/mounting_plate.py](examples/mounting_plate.py), [examples/hinge_assembly.py](examples/hinge_assembly.py), [examples/sleeve_panel.py](examples/sleeve_panel.py) |9798Copy patterns from the examples; do not treat them as a required scaffold.