Model dimensioned mechanical parts (brackets, enclosures, mounts, adapters, gears, replacement parts) as parametric CAD with build123d in Python, checked against the required dimensions and exported as STEP and STL.
3 stars
0 votes
0 copies
3 views
Added December 1, 2026
ai-agentspython
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Cad Mechanical?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/omerfaruk-aydn-cad-mechanical)
---
name: cad-mechanical
description: Model dimensioned mechanical parts (brackets, enclosures, mounts, adapters, gears, replacement parts) as parametric CAD with build123d in Python, checked against the required dimensions and exported as STEP and STL.
compatibility: Atlas native tools; Python 3.10+ with build123d (pip install build123d). Blender (blender tool) is optional, for looking at the result.
metadata:
provenance: atlas-authored
---
# cad-mechanical
A mechanical part is defined by its dimensions and how it mates with other
parts, not by how it looks. Model it the way a mechanical designer does:
sketch, constrain with numbers, extrude, then add holes, fillets and
chamfers as features, all driven by named parameters. build123d is a
Python CAD library on the OpenCascade kernel; it produces exact solids
(B-rep) that export to STEP for any CAD program and STL for printing.
## Setup
Check `python -c "import build123d"`. If it is missing, ask before
installing (`pip install build123d`, about 200 MB with the kernel). The
checker is installed at `.atlas/cad/atlas_cad_check.py`.
## 1. Requirements (`.atlas/cad/brief.md`)
- Every functional dimension with its tolerance and what it mates with:
"M5 clearance holes, 5.5 mm, on a 40 x 40 mm square", "slot for a 3 mm
aluminium sheet, 3.2 mm", "bore for a 608 bearing, 22.0 mm H7".
- Material and process (machined, FDM, resin, laser-cut sheet): it sets
minimum walls, radii, draft and clearances.
- Loads and where they act; the faces that locate the part.
## 2. Model parametrically (`part.py`)
```python
from build123d import *
# Parameters first: every number has a name and a unit (mm).
WIDTH, DEPTH, THICK = 60.0, 40.0, 5.0
HOLE_D, HOLE_PITCH = 5.5, 40.0
FILLET = 3.0
with BuildPart() as bracket:
with BuildSketch(Plane.XY):
RectangleRounded(WIDTH, DEPTH, FILLET)
extrude(amount=THICK)
with Locations((0, -DEPTH / 2 + THICK / 2, THICK)):
Box(WIDTH, THICK, 30, align=(Align.CENTER, Align.CENTER, Align.MIN))
with GridLocations(HOLE_PITCH, 0, 2, 1):
Hole(HOLE_D / 2)
fillet(bracket.edges().filter_by(Axis.X).group_by(Axis.Z)[1], radius=2)
part = bracket.part
import sys, os
sys.path.insert(0, os.path.join(os.getcwd(), ".atlas", "cad"))
from atlas_cad_check import check
check(part, name="bracket", size=(WIDTH, DEPTH, THICK + 30), tol=0.05,
holes=[{"diameter": HOLE_D, "count": 2}], out="qa")
```
Rules of the craft:
- Sketch on the plane that carries the design intent; extrude, revolve,
sweep or loft from it. Holes with `Hole`, `CounterBoreHole`,
`CounterSinkHole` at `Locations`/`GridLocations`/`PolarLocations`.
- Fillets and chamfers last, selected by geometry (`edges().filter_by`,
`group_by`, `sort_by`), never by index: indices change when the model
changes.
- Inside corners of machined pockets get a radius at least the tool
radius; printed parts get 45-degree chamfers instead of overhangs.
- Keep one solid; fuse features, and check every cut did not split it.
- Standard sizes: ISO metric clearance holes (M3 3.4, M4 4.5, M5 5.5, M6
6.6), tapping holes (M3 2.5, M4 3.3, M5 4.2), counterbores (M3 6.5 x 3.3
deep), bearing seats from the bearing's datasheet.
## 3. Check
Run `python part.py`. `ATLAS_CAD_QA` reports the bounding box, volume
(and mass in PLA), the cylinders found by diameter, validity, the number
of solids, and the checks you asked for; it writes `qa/<name>.step` and
`qa/<name>.stl`. Fix every failure. For a printed part, also run the print
QA on the STL in the blender tool: `exec` with
`bpy.ops.wm.stl_import(filepath="qa/bracket.stl")`, then `qa` with
`script: print` and `args: --unit mm`.
## 4. Look
Import the STL into the blender tool and `look` in `clay` from front34,
top and side (and `wire` to see the tessellation is fine), or render a
section. Check the features against the brief one by one.
## 5. Report
The parameters, every functional dimension with its measured value, the
checker's result, the files (STEP for CAD, STL for printing), and the
assumptions (tolerances chosen, standard sizes used).