Skip to main content

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

TypeIdentity and role
Partpart_id, body, optional name, material, and connectors
Assemblyassembly_id, components, assembly connectors, constraints, grounded IDs
ComponentUnique occurrence ID, referenced item, and placement
PlacementRigid right-handed transform
MaterialExplicit 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

ConstraintMotion intent
FixedRemove relative rigid motion
RevolutePermit rotation around one axis
PrismaticPermit translation along one axis
GearCouple angular motion by ratio
BeltCouple pulley motion through pitch relationship
Rack-pinionCouple 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.