Files
make-cad/examples

SimpleCADAPI Examples

Run examples from the repository root with uv run python <path>. Generated STEP/STL/JSON files are written to examples/out/, which is ignored by git.

Examples

  • 01_basic_modeling.py — functional shape modeling, booleans, and STEP/STL export.
  • 02_graph_replay.py — GraphSession, canonical model JSON export, and replay.
  • 03_expressions.py — expression parameters captured in a replayable model graph.
  • 05_loft_sweep_revolve.py — profile operations: revolve, loft, and sweep.
  • 06_parametric_gear_model.py — lightweight involute spur gear model JSON example for replay/export tests.
  • 07_serialization_operation_tree.py — compact serialization demo showing how source calls map to canonical operation-tree nodes, including expressions, primitive lowering, features, booleans, transforms, patterns, and detail operations.
  • 13_cycloidal_reducer.py — compact 50 mm diameter, 10 mm tall, 10:1 cycloidal reducer assembly with twin segmented B-spline cycloidal discs, 180-degree opposed input eccentric cams, 18-degree half-lobe tooth-index phase, three-hole input/output disks, and assembly constraints.
  • 14_ball_bearing.py — parameterized ball bearing standard assembly with grooved inner/outer race rings, direct sphere rolling elements, stable ring component IDs, ring axis connectors, an inner-to-outer revolute constraint, and a demo shaft/housing bound through those connectors.