build123d
Parametric CAD written as plain Python. build123d takes the idea behind CadQuery — define a part as code, not clicks — and rebuilds it as an independent framework over the same industrial geometry kernel that powers FreeCAD.
If your parts are really configurations — driven by maths, loops or a spreadsheet of dimensions — build123d lets you describe them in ordinary Python and get a precise B-rep solid you can export to STEP or STL. It is the modern, more Pythonic successor to CadQuery, and it is the most natural target for code-generating AI. It is still pre-1.0 (v0.10.0, November 2025) and under active development, so pin your version. If you prefer dragging a mouse over writing code, reach for FreeCAD instead.
What it is
build123d is a parametric boundary-representation (B-rep) CAD library for Python. Instead of sketching in a GUI, you build geometry with code: one-dimensional wires with BuildLine, planar profiles with BuildSketch, and solids with BuildPart. Because the model is a script, the full Python toolbox comes with it — variables, for loops, functions, imports, version control and tests all apply to your CAD.
Under the hood it drives the mature open-source OpenCASCADE kernel through the OCP Python bindings — the same kernel FreeCAD uses — so the geometry is real, watertight B-rep, not a mesh. build123d is "derived from portions of CadQuery, but extensively refactored and restructured into an independent framework over Open Cascade," and it is released under the permissive Apache-2.0 licence.
It offers two interchangeable styles. Builder mode uses Python context managers (with blocks) that track state, so objects add themselves to the active sketch or part as you create them. Algebra mode is stateless: objects are values combined with operators (+, -, &) like an equation. The two can be mixed, and both produce identical geometry.
Where it wins
- It is just Python. No fluent method-chaining DSL to fight. You get loops, conditionals, list comprehensions and your own helper functions, which makes families of parts and generative designs trivial.
- Real B-rep, real exports. Built on OpenCASCADE, it produces precise solids and exports to
STEPfor downstream CAD/CAM andSTL(and more) for printing — viaexport_step()andexport_stl(). - Diff-able and testable. A part is a text file. It lives in git, reviews in a pull request, and can be regression-tested like any other code — a genuine advantage over binary CAD files.
- Cleaner than CadQuery. It keeps CadQuery's core idea while dropping the restrictive fluent API, so you rarely have to convert objects back and forth to keep working.
Where it still hurts
- You have to think in code. There is no interactive canvas. Selecting the right edge or face to fillet means reasoning about selectors and geometry, not clicking it — a real shift if you come from GUI CAD.
- Pre-1.0 and moving. At v0.10.0 the project is still "under active development"; APIs can shift between releases, so pin a version and read the changelog before upgrading.
- You bring your own viewer. Visual feedback depends on an external tool such as the
ocp_vscodeviewer; it is not a self-contained application like FreeCAD. - Not for organic shapes. Like all parametric B-rep tools, it is built for mechanical parts. For sculpting or freeform surfaces, Blender is the right door.
The AI angle
Code-CAD is the cleanest bridge between a language model and a physical object. An LLM is already fluent in Python, so "describe the bracket, get a parametric part" maps directly onto build123d: the model writes a script, you run it headless, and you inspect or print the result — no GUI automation required. Because the output is text, an agent can read its own model back, reason about it, and iterate, and because it is real B-rep you can hand the STEP file straight to a CAM or FEA tool. That combination — Pythonic, headless, precise, version-controlled — is why build123d (alongside its ancestor CadQuery) keeps showing up as the back-end for emerging text-to-CAD experiments. It pairs naturally with FreeCAD, whose own Python core makes it a fine place to open and refine what an agent generates.
Start here
- Install into a Python 3.10+ environment:
pip install build123d. - Add a viewer — the OCP CAD Viewer for VS Code lets you
show()parts as you build them. - Work through the official docs and examples at build123d.readthedocs.io — start with builder mode, then try algebra mode.
- Source and releases: github.com/gumyr/build123d.