Introduction
An assembly places instances of parts in one space and connects them with joints. It lives in a .assembly.js file, imports the parts it uses, and writes three kinds of statement: insert() to place a part, .grounded() to anchor one, and mate() to join connectors. The viewport solves the mates live, so you can drag a part and watch the mechanism move.
Part parameters
A part declares its parameters with param(). Inserted into an assembly, that list is the part's interface: every insert() can supply its own values, and the same definition builds one variant per distinct set of values. The assembly can also declare its own parameters and pass them to its instances.
Grounded
A grounded instance does not move. It is the reference frame the solver places everything else against — the part you would bolt to the bench. Ground exactly one instance per mechanism; the joints carry the rest.
Fastened (fixed)
A fastened mate locks two parts together: the second connector is placed onto the first and no motion remains. It is the joint for anything bolted, glued or pressed on — a cover on its housing, a bracket on a beam.
Slider
A slider mate leaves one degree of freedom: translation along the shared Z axis. Everything else — the other two translations and all three rotations — is locked. It is the joint of a carriage on a rail, a drawer in a cabinet, a key in a keyway.
Revolute
A revolute mate is a hinge: the two connectors share an origin and a Z axis, and the second part is free to rotate about it. It is the joint of a lever on a pivot, a door on its hinge, a wheel on an axle.
Cylindrical
A cylindrical mate is a revolute and a slider in one: the two connectors share their Z axis, and the second part may both rotate about it and travel along it. It is the joint of a piston in a bore, a shaft in a plain bearing, a pin in a slot.
Planar
A planar mate keeps two faces in contact and lets the second part move freely across the first: slide in X, slide in Y, spin about Z. It is the joint of a block on a table, a tile on a floor, a workpiece on a machine bed.
Tangent
A tangent mate keeps two surfaces touching. Unlike the other joints it is not written on connectors but on exposed geometry: a cylindrical or spherical face against a plane, a cam against a follower, a roller on a track. The parts keep every freedom that does not break the contact.
Replicate
replicate() copies a mated part — or a mated sub-assembly — onto new mate targets. It is the "copy with mates" of other CAD systems, not a geometric pattern: every replica gets the seed's mates re-targeted to its own references, so the four standoffs on a plate each sit in their own hole and move on their own.