vibe-cading
A parametric, AI-friendly Code-CAD library in Python.
Reusable mechanical components — plus adapters that bridge RC hardware to Lego Technic.
Built on CadQuery, every part is a Python class whose geometry regenerates from typed parameters — change a number, get a new part. Standard families (screws, gears, nuts) build straight from real-world size tables. And it's designed to be driven by humans and AI agents.
Samples
|
SpurGear · module=1.5, teeth=18
|
LegoTechnicLLiftarm · 3×5 Technic L-liftarm |
|
ServoMountBase + ServoMountClamp · SG90 → Lego, dovetail-clamped |
PrintInPlaceHinge · 2 countersunk M3 holes / leaf |
🔄 Click any sample to spin the real model in GitHub's interactive 3D viewer.
Each part is a few lines of Python. The geometry is a function of the parameters, so a part is never a static shape — it's a generator:
import cadquery as cq
from vibe_cading.mechanical.gears.spur import SpurGear
# Parameters drive the geometry — change teeth, get a new gear.
gear = SpurGear.from_iso(module=1.0, teeth=20, face_width=5.0)
cq.exporters.export(gear.solid, "gear.step") # extension picks the format
Why vibe-cading
- Parametric by construction. Every part regenerates from typed constructor
parameters; there are no frozen meshes. Standard families come from size tables —
MetricMachineScrew.from_size("M3", length=12),SpurGear.from_iso(module=1, teeth=20, face_width=5.0)— so one class yields a whole catalogue of real-world parts. - Parametric both ways. Forward is params → part. Reverse goes the other
direction: bring an existing STEP file, let the engine's analysis tools
measure it, and rebuild it — by hand or with an AI agent — as editable parametric
code.
boolean_diffthen confirms the rebuild matches the original to within ~1% by volume. That's how the SG90 servo body in the samples above was built: measured from a reference STEP, rebuilt as a parametric class. Works best on simple prismatic parts. - Print-ready fits. Real-world nominal geometry stays fixed; per-machine, per-material clearances live in a separate tolerance profile you calibrate once. The same model bores a tight hole on one printer and a loose one on another — the profile absorbs that, not your code.
- Built for humans and AI agents. Drive it from Python, from the live OCP CAD viewer, or from any MCP client. A multi-role agent workflow ships in-repo so models can be generated, validated, and reviewed by AI agents.
- RC ↔ Lego Technic. A library of reusable mechanical components (screws, gears, joints, bearings, heat-set inserts, hinges, standoffs) plus adapters that mate RC hardware to the 8 mm Lego Technic stud grid (motor mounts, ESC holders, axle adapters).
Featured models
Each is parametric — the call below is the whole construction.
| Component | Build it | Parametric handle |
|---|---|---|
| Lego Technic beam | LegoTechnicBeam(length_in_studs=5) |
studs → mm on the 8 mm grid |
| Metric machine screw | MetricMachineScrew.from_size("M3", length=12) |
M2–M5 size table; socket / flat / pan heads, hex / Torx / Phillips drives |
| Spur gear | SpurGear.from_iso(module=1.0, teeth=20, face_width=5.0) |
ISO module + teeth → involute profile |
| Hex nut | MetricHexNut.from_size("M3") |
M2–M8 size table |
| Snap-fit joint | CantileverSnapFit(hook_depth=1.5, retention_angle=90) |
hook geometry; .male() solid / .to_cutter() cavity |
…plus magnets, enclosures, more fastener and bearing types, the Lego Technic
primitives, and the RC adapters. See vibe_cading/ for the full library tree,
and four runnable demos under examples/.
Quick start
This project runs in a VS Code Dev Container — no local Python or CadQuery install.
- Clone the repo, open it in VS Code, and click Reopen in Container (Python 3.11 + CadQuery + the OCP CAD viewer are provisioned for you).
- Run an example — writes STEP + SVG to
examples/build/:python3 examples/gear_from_iso.py - Preview any part live in the OCP CAD viewer (port 3939):
python3 vibe_cading/tools/view.py vibe_cading.mechanical.gears.spur.SpurGear
- Before your first print, calibrate the slip fit for your printer + material:
print the axle gauge and run
python3 vibe_cading/tools/calibrate.py slip— it writes the measuredslip.radialinto your gitignoredprint_profiles_user.jsonso Lego pins and axles fit. (Why it matters, plus the other knobs: docs/print-tolerances.md.)
→ Full dev environment, the local test/lint/build loop (python build.py), and
adding your own parts: CONTRIBUTING.md.
Just want the library in your own project? It's on PyPI:
pip install vibe_cading # the library
pip install "vibe_cading[mcp]" # + the MCP server for AI agents
On headless Linux (cloud servers, CI runners, slim Docker images), CadQuery's
geometry kernel also needs the system OpenGL library — install it once with
apt install libgl1 (or your distro's equivalent). Desktop Linux, macOS, and
Windows already have it.
Tolerances & fit
Printed fits are printer- and material-dependent. vibe-cading keeps real-world
nominal geometry fixed and carries the per-machine clearance separately in a
tolerance profile — fdm_standard, resin_precise, and cnc ship in-repo,
selected via PRINT_PROFILE and overridable per-machine in a gitignored
print_profiles_user.json.
slip.radial (the Lego-axle slip fit) is the one knob almost everyone re-tunes;
calibrate it by printing a gauge and running python3 vibe_cading/tools/calibrate.py slip.
The free and press defaults work for most FDM printers out of the box.
→ Full fit-grade model and calibration workflow: docs/print-tolerances.md.
Learn more
| If you want to… | Read |
|---|---|
| Set up, build, and contribute parts | CONTRIBUTING.md |
| Understand tolerances & calibration | docs/print-tolerances.md |
| Look up Lego Technic dimensions | docs/lego-technic.md |
| Look up fastener sizes & fits | docs/screws.md |
| Drive the engine from an MCP client | docs/mcp.md |
| Understand the multi-role agent workflow | docs/agentic-workflow.md |
| Onboard an AI coding agent | AGENTS.md → vibe/INSTRUCTIONS.md |
License
AGPLv3. See LICENSE-FAQ.md for a plain-language guide to what this means for your projects.
For commercial or closed-source use cases that are incompatible with AGPLv3, dual-licensing is available. Contact licensing@vibe-cading.com for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vibe_cading-0.1.2.tar.gz.
File metadata
- Download URL: vibe_cading-0.1.2.tar.gz
- Upload date:
- Size: 252.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d62ef3d203aca1a661004fbe9bd13623ef26eb6fdab1ed48a3c26403520a02d9
|
|
| MD5 |
75f3927cac2ecb29285b3257da1c887f
|
|
| BLAKE2b-256 |
9e371329b5997a128176ab52dcc1787d0728ab14b016577ea79eee5e0cd9505d
|
Provenance
The following attestation bundles were made for vibe_cading-0.1.2.tar.gz:
Publisher:
release.yml on fa-mc/vibe-cading
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vibe_cading-0.1.2.tar.gz -
Subject digest:
d62ef3d203aca1a661004fbe9bd13623ef26eb6fdab1ed48a3c26403520a02d9 - Sigstore transparency entry: 1961719255
- Sigstore integration time:
-
Permalink:
fa-mc/vibe-cading@fc29b808bf2e0a64e627fb4affd020ddce8ca770 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fa-mc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc29b808bf2e0a64e627fb4affd020ddce8ca770 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vibe_cading-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vibe_cading-0.1.2-py3-none-any.whl
- Upload date:
- Size: 363.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63682093c6a254e6d714a58654dac90484d5946847d90f12806d6a1ff1bac76d
|
|
| MD5 |
1d9a53bedb61e5347edb1bdd064a2b93
|
|
| BLAKE2b-256 |
bdaf223c0c05d9fa4a19eb5e3ded7a977fd3cca73804fc96790c43e3a9ddac30
|
Provenance
The following attestation bundles were made for vibe_cading-0.1.2-py3-none-any.whl:
Publisher:
release.yml on fa-mc/vibe-cading
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vibe_cading-0.1.2-py3-none-any.whl -
Subject digest:
63682093c6a254e6d714a58654dac90484d5946847d90f12806d6a1ff1bac76d - Sigstore transparency entry: 1961719432
- Sigstore integration time:
-
Permalink:
fa-mc/vibe-cading@fc29b808bf2e0a64e627fb4affd020ddce8ca770 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fa-mc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc29b808bf2e0a64e627fb4affd020ddce8ca770 -
Trigger Event:
push
-
Statement type: