Vibe-cading CAD engine
Reason this release was yanked:
Dummy release
Project description
vibe-cading
A robust, AI-friendly, parametric Code-CAD library written in Python using CadQuery.
The purpose of this repository is to provide a universal toolkit of reusable mechanical components (screws, heat-set inserts, hex nuts, joints, bearings, and enclosures). It also features practical examples demonstrating how to use these primitives to build parts that interface RC (radio-controlled) components with Lego Technic assemblies (motor mounts, ESC holders, axle adapters, etc.).
Tolerances are driven by a per-printer profile system you calibrate once (see Print Tolerances & Calibration below) — shipped defaults work, but slip.radial is the one knob almost every contributor re-tunes for their machine.
Models are built with AI assistance via Claude Code or Google Antigravity. Project
agent personas and slash commands live under vibe/agents/ and
vibe/commands/ (tracked, tool-neutral); the runtime
.claude/ or .agents/skills/ trees are per-clone scratch, populated by
vibe_cading/tools/init-claude-runtime.sh or vibe_cading/tools/init-agy-runtime.sh respectively.
Featured Models
| Model | Location | Description |
|---|---|---|
TechnicAxle |
vibe_cading/lego/technic_axle.py |
Lego Technic cross axle solid, parametric length in stud units |
TechnicAxleHole |
vibe_cading/lego/cutters/technic_axle_hole.py |
Cross axle hole cutter profile for use in boolean operations |
TechnicAxleToBearingSleeve |
vibe_cading/lego_adapters/technic_axle_to_bearing_sleeve.py |
Sleeve that seats a Lego Technic axle inside a ball bearing |
FreespinHexHub |
vibe_cading/rc/freespin_hex_hub.py |
Freespinning RC hex wheel hub adapter |
EscMount |
parts/arrma_vorteks_223s/esc_mount.py |
ESC mount plate for the Arrma Vorteks 223S |
See vibe_cading/ for the full library tree — screws, gears, joints, nuts, heat-set inserts, hinges, magnets, standoffs, bearings, enclosures, and the Lego Technic primitives + adapters.
Examples
Four self-contained scripts under examples/ demonstrate the library's
canonical usage patterns. Each runs under a vanilla CadQuery install and
writes STEP + SVG output to examples/build/<name>/ (gitignored):
| Example | What it shows |
|---|---|
examples/lego_technic_beam.py |
LegoTechnicBeam(length_in_studs=5) from vibe_cading.lego.technic_beam |
examples/screw_cutter.py |
MetricMachineScrew.to_cutter(profile=...) boring a counterbore + clearance into a host block |
examples/gear_from_iso.py |
SpurGear.from_iso(module=1.0, teeth=20, face_width=5.0) ISO-validated gear factory |
examples/snap_fit_hook.py |
CantileverSnapFit male hook plus host block cut by .to_cutter(...) (two STEP files) |
Run one with:
python3 examples/lego_technic_beam.py
Dev Setup
This project runs in a VS Code Dev Container — no manual installation required.
Prerequisites: Docker and the VS Code Dev Containers extension.
- Clone the repo and open it in VS Code.
- When prompted, click Reopen in Container (or run
Dev Containers: Reopen in Containerfrom the command palette). - The container builds automatically with Python 3.11, CadQuery, the OCP CAD Viewer extension, and the Claude Code extension. Your host
~/.claude/is mounted into the container so any personal Claude Code agents, skills, or settings travel with you.
The OCP viewer backend runs on port 3939 and is forwarded to your host automatically.
Workspace Initialization
Since this repository is managed via a multi-role AI Agentic Workflow, you should initialize your local settings upon cloning the repository.
Open your agent host (e.g. Claude Code or Google Antigravity) in this workspace and ask it to initialize the project, e.g.:
please initialize the project
The agent will read the onboarding instructions, create the local tmp/ and .agents/plans/ folders for tool analysis, copy print_profiles.json.example → print_profiles_user.json so you can configure your manufacturing tolerance profiles, and run the appropriate host-platform scaffolder:
- For Claude Code: runs
vibe_cading/tools/init-claude-runtime.shto populate the per-clone.claude/runtime aliases (discovering subagents and slash commands). - For Google Antigravity: runs
vibe_cading/tools/init-agy-runtime.shto populate the per-clone.agents/skills/runtime skills.
Four contributor roles are shipped under
vibe/agents/:admin(workflow governance & instruction maintenance),designer(domain reasoning & design briefs),tl(code architecture & shared-contract stewardship — invoked for architecturally-significant work only), anddeveloper(per-part implementation & validation). Only the PM role (backlog prioritisation) is not shipped — the human contributor drives it, and remains the final acceptance authority for merges and project policy above all shipped roles. Maintainers who prefer a dedicated PM agent can load their own persona from~/.claude/.
Manufacturing & Tolerance Profiles: This repository uses a global tolerance configuration system to ensure parts fit together correctly based on your specific manufacturing method (e.g. FDM vs Resin 3D printing).
print_profiles.json: Checked into version control. Contains defaults (likefdm_standard,resin_precise).print_profiles_user.json: Untracked (gitignored). Use this to override specific fields in the default profiles or define entirely new profiles without creating a dirty git history. Your fields are recursively deep-merged into the defaults — override a single leaf and the sibling fields inherit from the shipped grade (see Print Tolerances & Calibration below)..env: Untracked. You can setPRINT_PROFILE=your_profile_namehere to define the global fallback profile used across all CAD scripts.
Building
Generate all STEP files defined in build.toml:
python build.py
Output files are written to output/ (gitignored — regenerate at any time).
Options:
| Flag | Description |
|---|---|
--list |
Print configured outputs without building |
--config PATH |
Use an alternate TOML config (default: build.toml) |
Adding a Model
- Choose the right home for the new file:
- Reusable, project-agnostic library classes (screws, gears, joints,
Lego adapters, etc.) live under
vibe_cading/in an appropriate subpackage (mechanical/,lego/,lego_adapters/,rc/, ...). - Project- or vehicle-specific parts (an ESC mount tied to one chassis,
a motor plate for one truck) live under
parts/<vehicle_or_project>/.
- Reusable, project-agnostic library classes (screws, gears, joints,
Lego adapters, etc.) live under
- Define a class with a
.solidproperty that returns acq.Workplane. - Add a
[[build]]entry tobuild.toml:
[[build]]
model = "vibe_cading.your_subpackage.your_module.YourClass"
output = "your_subpackage/your_output.step"
[build.params]
param_a = 10.0
param_b = 5.0
- Iterate locally with
python3 vibe_cading/tools/preview.py <module.path.YourClass>(orthographic SVGs) orpython3 vibe_cading/tools/view.py <module.path.YourClass>(live OCP CAD Viewer on port 3939). Runpython build.pyto verify the registered output.
Repository Hygiene & AI Dev
This repository uses an AI-first CAD approach and enforces strict separation of code for version control:
vibe_cading/: The reusable, project-agnostic library tree — purely declarative CadQuery class definitions and parameters (screws, nuts, joints, holes, drives, gears, Lego primitives, Lego adapters, RC building blocks). Do not put throwaway debug scripts here.parts/<vehicle_or_project>/: Project- or vehicle-specific parts that consume the library (e.g.parts/arrma_vorteks_223s/). One sub-folder per real-world target.tmp/: Gitignored. All isolated experiments, AI-generated metric checks (e.g.check_gap_2.py), parameter sweeps, block gauges, and exported STEP files for debugging must be placed here.output/: Gitignored; populated bypython build.py(see Building).
Please keep Pull Requests clean by keeping scratch-pad test scripts restricted strictly to tmp/.
Lego Technic Reference
See docs/lego-technic.md for a full reference table of Lego Technic dimensions — stud grid, pin holes, axle profiles, beam geometry, and FDM printing tolerances.
Key constants are centralised in vibe_cading/lego/constants.py.
Print Tolerances & Calibration
TL;DR for new contributors. The shipped
print_profiles.jsonis a starting point, not a contract. After cloning:
- Copy
print_profiles.json.example→print_profiles_user.json(the workspace initializer does this).- Export the axle gauge to STEP and slice/print it on your machine:
python3 vibe_cading/tools/view.py vibe_cading.lego.axle_hole_gauge.AxleHoleGauge --export tmp/axle_gauge.step(preview first withvibe_cading/tools/preview.py … --views iso_neif you want to confirm it looks right).- Run
python3 vibe_cading/tools/calibrate.py slip— it writes the measuredslip.radialinto your gitignoredprint_profiles_user.json.- Set
PRINT_PROFILE=<your_profile>in.env(defaults tofdm_standard).
slip.radialis the one knob almost everyone re-tunes;freeandpressdefaults work for most FDM printers out of the box.
Printed fits are printer- and material-dependent: the same model bores a tight hole on one machine and a loose one on another. Dimensional nominals in the library are fixed real-world geometry; the per-machine clearance is carried separately by a ToleranceProfile. The project ships profiles (fdm_standard, resin_precise, cnc) in print_profiles.json; override them per-machine in the gitignored print_profiles_user.json and select the active one with PRINT_PROFILE.
For the full taxonomy reference — what each fit grade (free / slip / press) means physically, what each allowance (radial / axial / slot) modifies geometrically, which model classes read which knob, and the shipped 27-leaf-float snapshot — see docs/print-tolerances.md. The rest of this section is the calibration workflow.
User key convention. User-defined profile keys are recommended (not enforced) to follow the <machine>__<material>[__<brand>] lexical convention with __ (double underscore) as the separator — for example bambu_p1s__pla_overture, ender3__petg_polymaker, prusa_mk4__pla. The convention is purely documentary; the loader treats every key as opaque. The shipped fallback keys (fdm_standard, resin_precise, cnc) remain the coarse-default categories and are exempt.
Field-level deep merge. Your override file recursively deep-merges onto the shipped defaults, leaf-wins. This means you can calibrate a single value without restating the rest of a fit grade. For example, to bump only slip.radial:
// print_profiles_user.json
{
"fdm_standard": {
"slip": { "radial": 0.11 }
}
}
The resolved slip grade then carries radial = 0.11 (your override) together with axial = 0.20 and slot = 0.10 inherited from the shipped fdm_standard. A typo'd leaf key (e.g. radail) is silently ignored downstream — the resolved tolerance falls back to the shipped value. A null override (e.g. {"slot": null}) is rejected with a clear error rather than silently zeroing.
Calibration helper. Once you've printed a calibration gauge, run python3 vibe_cading/tools/calibrate.py to write the calibrated value directly into your print_profiles_user.json:
python3 vibe_cading/tools/calibrate.py # walk free.radial → press.radial
python3 vibe_cading/tools/calibrate.py free # calibrate only free.radial
python3 vibe_cading/tools/calibrate.py press # calibrate only press.radial
python3 vibe_cading/tools/calibrate.py slip # opt-in: calibrate slip.radial (Lego axle)
python3 vibe_cading/tools/calibrate.py free --diameter 3.30 --yes \
--profile bambu_p1s__pla_overture # one-shot non-interactive
The helper resolves the active profile (via --profile, PRINT_PROFILE, or the hardcoded fdm_standard fallback), reads the best-fitting gauge variant you measured, computes radial = (D − N) / 2 against the live source-of-truth nominal, and atomically writes the value into your user file. Per-knob field-level merge — your file stays a diff from shipped.
v1 calibratable knobs and their default gauges:
| Knob | Gauge | Nominal source |
|---|---|---|
free.radial |
MThreeClearanceGauge (M3 clearance hole) |
METRIC_SIZES["M3"]["clearance"] = 3.2 mm |
press.radial |
MThreeNutPocketGauge (M3 nut press-fit pocket) |
MetricHexNut.DIMENSIONS["M3"]["width_flats"] = 5.5 mm |
slip.radial |
AxleHoleGauge (Lego axle slip fit — opt-in via slip subcommand) |
AXLE_HOLE_TIP_TO_TIP = 4.80 mm |
Print the gauge first with python3 vibe_cading/tools/preview.py <module.path.GaugeClass> --views iso_ne to see what you're going to print, then run the matching vibe_cading/tools/calibrate.py <knob>. For the slip-fit calibration procedure (axle judging criteria), see docs/lego-technic.md > Tuning Tolerances.
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.
Project details
Release history Release notifications | RSS feed
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.0.1.tar.gz.
File metadata
- Download URL: vibe_cading-0.0.1.tar.gz
- Upload date:
- Size: 218.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fca7151e690fca9efc79d73baf2303567b7404a5325846f91c1ad7fa43869ebc
|
|
| MD5 |
f751597c83abddf5922e4aea620aaff1
|
|
| BLAKE2b-256 |
4a6e27b39c884ee9753ebf62d9398f3e79c2b508ef7eb646d188bbe8bd1c2146
|
Provenance
The following attestation bundles were made for vibe_cading-0.0.1.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.0.1.tar.gz -
Subject digest:
fca7151e690fca9efc79d73baf2303567b7404a5325846f91c1ad7fa43869ebc - Sigstore transparency entry: 1828624710
- Sigstore integration time:
-
Permalink:
fa-mc/vibe-cading@6f02eafc29a577e3c39e9ca403dc3d8f73237f2c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fa-mc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f02eafc29a577e3c39e9ca403dc3d8f73237f2c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vibe_cading-0.0.1-py3-none-any.whl.
File metadata
- Download URL: vibe_cading-0.0.1-py3-none-any.whl
- Upload date:
- Size: 317.8 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 |
7decc2ff55a867b5eea0d6cf80635b75961ad78a6b209c73b1900cd99978e138
|
|
| MD5 |
f23f76d810db547dc9c6374f16a69a9b
|
|
| BLAKE2b-256 |
a5de87bd75d486163780f6aa6408266d62b04d1e87e407bdd9456bfca697c51e
|
Provenance
The following attestation bundles were made for vibe_cading-0.0.1-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.0.1-py3-none-any.whl -
Subject digest:
7decc2ff55a867b5eea0d6cf80635b75961ad78a6b209c73b1900cd99978e138 - Sigstore transparency entry: 1828624770
- Sigstore integration time:
-
Permalink:
fa-mc/vibe-cading@6f02eafc29a577e3c39e9ca403dc3d8f73237f2c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fa-mc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f02eafc29a577e3c39e9ca403dc3d8f73237f2c -
Trigger Event:
workflow_dispatch
-
Statement type: