CAD, FEA & studies.

Design parts, assemblies, boards, and optical cavities in code — then solve structural loads, thermal/EMI fields, manufacturability, and ray traces before cutting metal.

Parametric 3D CAD in code

.3d.tsx (and .3d.py / .3d.rs) files declare exact OpenCascade (OCCT) B-rep solids, fillets, chamfers, helical sweeps, assemblies, kinematic mates, and <check> invariants. Visual drags in the 3D editor write minimal AST diffs directly back into source parameters.

shell
commandagi threed install                           # vendor OpenCascade WASM (~130 MB)
commandagi threed observe Part.3d.tsx               # bounds, volume, surface area, mass, failed features
commandagi threed interference Assembly.3d.tsx --clearance 0.5
commandagi threed export Part.3d.tsx --format step  # step, iges, stl, 3mf, or quad (Gmsh OBJ/GLB)
  • Geometry conformance gate: CommandAGI maintains an automated 57-fixture conformance suite (packages/applets/3d-design/conformance). Our OCCT kernel passes 50 of 57 fixtures deterministically across fresh processes (conformance/baseline.json), and our reproducible SMLib fork (packages/kernels/smlib-fork) passes 42 of 57 with zero UBSan findings across 198 checks.
  • Photo-to-articulated-CAD: commandagi threed articulate <photo> [--mesh <glb>] extracts parts and kinematic joints, retaining only joints that pass automated range-of-motion collision sweeps.

Structural FEA and bisection validation (.study.tsx)

Instead of picking dimensions by hand, declare load cases, boundary constraints, material properties, and pass/fail targets inside a .study.tsx file beside your design:

shell
commandagi fea install                              # Gmsh + CalculiX C3D10 container
commandagi validate ./gripper --draft --run --revise
commandagi study run gripper/Jaw.study.tsx
commandagi study results gripper/Jaw.study.tsx

When invoked with --revise, the validation planner brackets parameters between pass and fail and runs three quadratic tetrahedral C3D10 mesh refinement levels per candidate until Roache's grid-convergence index holds (<= 0.05). In the shipped humanoid hand benchmark (Jaw.study.tsx under a 40 N grip load with a 2 mm tip-deflection cap), the solver automatically sweeps wall thickness from 4 mm (15.92 mm deflection, 30.02 MPa stress) to 8.125 mm (1.96 mm deflection, 7.55 MPa peak von Mises stress across 354,583 nodes) and updates the design file directly.

Every solved study writes raw Gmsh/CalculiX artifacts, reaction-force balances, and mesh-convergence summaries inside runs/<run>/ with reality: "simulation". Simulated pass verdicts never stand in for physical load-cell commissioning.

Drawings, DFM, CAM, slicing, and CFD

domaincommandswhat runs offline
Engineering drawingscommandagi threed sheet <file> [--format svg|dxf|pdf] · threed bom <file>Projections, Section A-A, GD&T datums, hole coordinate tables (e.g., 21 holes / 2.3 s export on Z plate.3d.tsx), mass roll-up, priced CSV BOM
DFM verificationcommandagi threed dfm <file> --process print|mill --device <def>Checks wall thickness, overhangs, tool reach, internal corners, and build volume against the machine's definition.tsx
3D slicingcommandagi slicer install · slicer slice <file|setup.slice.tsx>Containerized PrusaSlicer emits machine-specific .gcode bound to process.print limits and filament estimates
CFD flowcommandagi study new <part> --kind flow · commandagi flow solve <study.json>Containerized OpenFOAM steady-state mesh sweep with mass-balance and residual credibility checks (calibrated on commandagi flow benchmark pipe)

Schematics, PCB layout, EMI fields, and firmware pins

Circuit assemblies live in .sch.tsx and .pcb.tsx files checked directly against KiCad 8+ footprints (working/home+user-commandagi+assets/kicad/) and automated electromagnetic solvers:

shell
commandagi import kicad board.kicad_pcb             # convert existing KiCad projects into .sch.tsx + .pcb.tsx
commandagi layout board.pcb.tsx && commandagi route board.pcb.tsx
commandagi kicad check board.pcb.tsx                # KiCad ERC/DRC mapped back to TSX source lines
commandagi spice circuit.sch.tsx --kind transient   # DC / AC / transient SPICE solve
commandagi fabricate board.pcb.tsx --out fab/       # Gerbers, Excellon drill, BOM, pick-and-place
commandagi pins schematic.sch.tsx --part U1 --c pins.h --rust pins.rs

Near-field Biot–Savart and boundary-element capacitance solves inspect real copper geometry before fab. On CommandAGI's Hand board.pcb.tsx (14 conductors in the switching cut), the solver flags 724 A/m magnetic coupling under the 6 V buck inductor (84 A/m directly above the coil) and 55 of 97 pF/m parasitic capacitance from switching node to sensor trace. commandagi electronics design and commandagi firmware design tie board layout, generated pins.h / pins.rs bindings, MicroPython/PlatformIO firmware, and schematic pin verification (commandagi check) into one pipeline.

Sequential 3D ray tracing and optical cavities

Optical benches, lithography projection columns, and folded photonic cavities declare refractive materials, mirrors, diffractive elements, detectors, and light sources in .3d.tsx:

  • PHASER optical cavity (phaser-cavity.3d.tsx): Models a 650 nm AlGaInP laser injecting into a four-corner folded ring with a 64×64 SLM, relay doublets, microlens array, gain slab, and CMOS readout tap (306 3D rays traced; modeled cavity metrics such as 150 MHz / 1.9 nJ follow Exp. 29/34 — no physical PHASER cavity built).
  • Five-stage 4× lithography cleanroom (lithography-cell.3d.tsx): Models an ISO cleanroom bay (AMHS FOUP hoist, three-port EFEM, granite isolation plinth, EUV/excimer collector through 4× CaF₂ reduction stack to 300 mm XY wafer chuck) with 49 collision-verified solids and 310 end-to-end sequential rays (150.7 mm reticle field focused to a 24.9 mm wafer slit).
  • Verified analytic benchmarks: Sphere/ball-lens aberration converges within 116 µm RMS spot at 3.7 mm (0.97 mm inside paraxial focus across 26 swept runs), and an equilateral N-BK7 prism reproduces Snell dispersion across 450/530/650 nm to 0.0001° against closed form (38.8888° traced vs 38.8889° exact).