Assembly API
The assembly domain separates reusable item definitions from placed occurrences. Part owns body geometry and part metadata. Component places a part or child assembly inside an Assembly.
Product structure
| Type | Identity and role |
|---|---|
Part | part_id, body, optional name, material, and connectors |
Assembly | assembly_id, components, assembly connectors, constraints, grounded IDs |
Component | Unique occurrence ID, referenced item, and placement |
Placement | Rigid right-handed transform |
Material | Explicit engineering and appearance metadata |
body = cad.make_box_rsolid(60.0, 40.0, 4.0)
part = cad.make_part_rpart("base", body, name="Base plate")
assembly = cad.make_assembly_rassembly("fixture")
assembly = cad.add_component_rassembly(
assembly,
part,
component_id="base-1",
placement=cad.make_placement_rplacement((0.0, 0.0, 0.0)),
)
IDs must be non-empty and unique in their owning scope. Update helpers return new product values.
Placements
Placement contains origin and orthonormal axes. Public helpers create identity, translation, and Z-rotation placements, compose transforms, invert them, and compute relative placement. Composition order matters: placements propagate from the root assembly to each occurrence.
Connectors
Connector exposes a stable mating intent through an explicit placement or a face, edge, or vertex geometry reference. A ConnectorRef identifies the component and connector used by a constraint.
Connector resolution validates the component path and underlying reference. Forwarded connectors expose a child interface at a parent assembly boundary without flattening hierarchy.
Constraints
| Constraint | Motion intent |
|---|---|
| Fixed | Remove relative rigid motion |
| Revolute | Permit rotation around one axis |
| Prismatic | Permit translation along one axis |
| Gear | Couple angular motion by ratio |
| Belt | Couple pulley motion through pitch relationship |
| Rack-pinion | Couple rotation and linear travel |
Ground at least one appropriate component or otherwise provide a stable reference. solve_assembly_constraints_rassembly(..., strict=False) returns updated placements. inspect_assembly_constraints_rconstraintreport(...) exposes residuals and diagnostics; use strict solving at release boundaries.
Output and adjacent domains
make_compound_from_assembly_rcompound lowers placed occurrences into combined geometry. Kinematic constraints describe permitted motion, not stiffness, friction, preload, or distributed face contact. Those declarations belong to physical connections and simulation handoff.
See all 51 Assembly symbols.