parametric-part-cad
Skill16 starsChanged 16 days agoMITView on GitHub
Turns a plain-English or dimensioned part description into a parametric CadQuery script and exports STEP, STL, a shaded preview image, and a mass/volume report. Use when the user asks to model, create, or generate a 3D part, bracket, flange, enclosure, fixture, or any CAD geometry, or wants a STEP/STL file.
- Installs packages
In this repository34 other files it gives its agents.
- skills/cadsmith-text-to-cad/references/agents.mdAGENTS.md
- agentscad-fdm-dfamSkill
- am-alloy-screeningSkill
- am-literature-ragSkill
- cadsmith-text-to-cadSkill
- cfd-simulation-setupSkill
- design-review-packageSkill
- dfm-reviewSkill
- drawing-gdt-reviewSkill
- engineering-calc-reportSkill
- equation-discoverySkill
- image2gcodeSkill
- lattice-inverse-designSkill
- linkage-synthesisSkill
- llm-3d-print-monitorSkill
- llm-mechanical-designerSkill
- lpbf-defect-predictionSkill
- lpbf-superresSkill
- machine-element-sizingSkill
- material-selectionSkill
- mechanical-teardownSkill
- mechanics-visualsSkill
- meltpool-geometrySkill
- query2cad-freecadSkill
- quick-feaSkill
- rocketsmithSkill
- sketch-to-cadSkill
- sls-process-optimizationSkill
- stress-field-surrogateSkill
- thermal-fluids-calcSkill
- thermal-porositySkill
- tolerance-stackupSkill
- worked-problem-generatorSkill
- my-new-skillSkill
The file
Files
Parametric Part CAD (CadQuery)
Setup
pip install cadquery. If the install fails (some platforms lack OCP wheels), fall back to build123d. The same structure applies.
Workflow
- Spec → parameter table. List every dimension as a named parameter, with units in mm. Fill gaps using
references/design_defaults.md(clearance holes, wall thickness, fillets) and mark the filled values as assumptions. Ask the user only about dimensions that change function, such as interfaces and mating features. - Choose the datum. State where the origin is and which way +Z points, chosen so that functional faces sit on principal planes.
- Write the part script following
scripts/example_flanged_bushing.py:- a
PARAMSdict, updated fromOVERRIDES; assertgeometry sanity checks (minimum wall, hole-to-edge distance) with readable messages;- build order: base solid → bosses and ribs → holes and pockets → fillets → chamfers. Do fillets last; they fail most often;
- end with
result = ...; - set
DENSITY_KG_M3to get a mass estimate.
- a
- Build and export:
Exit code 2 means the geometry is invalid or not a single solid. Fix it before going further.python scripts/build_part.py part.py --out out/part python scripts/build_part.py part.py --out out/part_v2 --set n_bolts=6 --set bore=22 - Look at the preview. View
out/part_preview.png(isometric, top, and front) and check it against the spec. Confirm the bounding box matches the expected envelope. - Deliver the STEP (for CAD), STL (for printing), preview image, parameter table, and the
.pyfile so the user can keep changing it.
Debugging CadQuery
- A fillet fails (
BRep_API: command not done) → reduce the radius, or select edges more narrowly (NearestToPointSelector,.edges("|Z")). - A boolean leaves two solids → the features don't overlap. Extend one by 0.01 mm into the other.
- A hole lands on the wrong face → re-select with
.faces(">Z").workplane(centerOption="CenterOfBoundBox").
Assemblies
For multi-part designs, build each part as its own function and combine them with cq.Assembly() and constraints. Export with assy.save("out/assy.step").
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

