Design and Simulation of Devices
Model a Physical AI device in parametric CAD and prove it out in simulation before any hardware — geometry, mechanisms, dynamics, and the design→simulate→improve loop.
▶ Start the course ← All coursesParametric Thinking & Your First Part
Turn a real-world shape into parametric CadQuery code and export a clean, dimension-correct solid.
- L0Code is the Clay: Primitives & SolidsCreate a named solid of specified dimensions in real build123d and inspect it in the 3D viewer. Pass = the solid's bounding box matches the target within tolerance.→
- L1Workplanes & Sketches: 2D Becomes 3DPlace a 2D sketch on a workplane and extrude it into a solid, then cut a feature through it. Pass = the resulting build123d Part has the target bounding box AND the target volume (the through-hole removes the right amount of material).→
- L1Your First Parametric PartDrive a real build123d part from named Python variables instead of magic literals, so one number reshapes the whole solid. Pass = result is a 60 x 40 x 8 mm plate with a centered 6 mm through-hole: bounding box within +/-0.1 mm AND volume within +/-1 mm3 of 18973.81 (box volume minus the drilled cylinder), proving the hole is really cut, not faked.→
Parameters, Constraints & Reusable Design
Make one script generate a correct family of parts driven by named, mathematically-related, constrained parameters — verified by an autograder that regenerates the part across many parameter sets and checks that valid ones build correctly while invalid ones are rejected with a reason.
- L1Driven Dimensions & RelationshipsExpress a part's dimensions as formulas of a single driver parameter so derived dimensions stay consistent when the driver changes - verified by the bench measuring the real OpenCascade bounding box against an exact target.→
- L1Constraints & Valid Ranges: A Part FamilyBuild a real parametric part that lands inside a fixed spec envelope: drive its dimensions so the solid's bounding box and material volume both fall within tolerance of the published datasheet, proving the part is a legal member of the family rather than an out-of-range variant.→
Assemblies & Mechanisms
Combine multiple parts into a constrained assembly with joints that produce correct, intended motion: place independent solids into one shared coordinate frame so mating faces meet exactly; declare a joint that exposes exactly the degree of freedom intended; and chain joints into a linkage whose driven output traces a target path with zero self-collision across its full range.
- L1Locating Parts in SpacePosition parts in a shared coordinate frame with Pos (and Rot when needed) so the combined assembly fills an exact envelope - placing one solid on top of another and grading the bounding box of the fused part within tolerance.→
- L2Joints & Degrees of FreedomDefine a joint between two parts and correctly state and realize its allowed motion - revolute vs. prismatic - exposing exactly one intended degree of freedom and no others.→
- L2A Mechanism That MovesCompose joints into a linkage and sweep the input through its full range to confirm the output traces the target motion path with no self-collision.→
Simulating Your Device's Physics
Take a CAD assembly into a physics simulator and judge whether it works under gravity, friction, and applied force — giving geometry mass, inertia, collision, and gravity so it settles; driving a joint with an actuator to a measured target; and defining a pass/fail metric to deliver a trustworthy verdict.
- L2From CAD Body to Physics BodyTurn a geometric body into a physics body by giving it the right mass, then simulate on real MuJoCo until the spring-loaded part settles at the spec deflection (-0.10 m).→
- L2Force Balance: Spring vs GravityTune the spring stiffness so the spring force balances the load's weight at the target deflection — reading force equilibrium straight off a real simulation.→
- L2Reading the Verdict: Did It Settle?Learn that touching the target once is not passing — add damping so the device truly SETTLES (velocity → 0), and read the simulator's settle verdict correctly.→
Iterate, Validate & Optimize + Capstone
Close the design→simulate→improve loop for real: read sim telemetry, form a data-driven hypothesis about which parameter is wrong and which way to move it, and re-simulate a failing device to spec — then take a fresh device brief from a blank file all the way to a physics-validated, optimized, portfolio-ready artifact with a measurable margin beyond target. Competency arc: L2 (Practitioner), closing a full classical design loop.
- L2The Improvement Loop: Measure → Tune → Re-SimDiagnose a failing device from sim telemetry and adjust the correct parameter(s) in the correct direction to bring it to spec — and prove the change was driven by the measured data, not by guessing.→
- L2Capstone: Design, Simulate, Validate & Optimize a DeviceDeliver a complete, multi-feature parametric part to an exact spec: a mounting bracket = base plate + cylindrical boss + through-hole. Build it in real build123d on the OpenCascade kernel, then validate it against the spec by reading its bounding box (60 x 40 x 20 mm) and its volume (~20607.4 mm^3). Geometry valid, spec compliant within tolerance.→