Expand description
Joints and couplings: mates that say how one part may move against another, rather than only what touches what.
A joint holds a Connector of one part on a connector of another — an
origin, an axis through it and a direction square to the axis that
turns are measured from — and lets the second part turn about the first
one’s axis, slide along it, or both, as its JointKind says. How far
it is turned and slid are the joint’s coordinates: values of the
program’s state, solved with the poses, so that a joint can be set to a
value, held there, kept within limits, and coupled to another joint’s.
A coupling (CouplingKind) ties a coordinate of one joint to one of
another — or of the same one — linearly: a gear pair, a rack and its
pinion, a screw.
Like crate::residuals, every residual is computed in dual numbers.
Structs§
- Connector
- A joint’s end on a body, in that body’s frame — or, placed, where its body puts it: where its axis passes, the axis, and the direction its turns are measured from — unit vectors, the reference square to the axis.
- Coupling
Kind - How a coupling ties its two joints’ coordinates: the second’s is the
first’s times a factor — given by
valueas the transmission says, negated ifreverse— plusoffset, in the second’s units, degrees for an angle. Serializes flat:{"type": "gear", "value": 2.0, "reverse": true}. - Joint
Kind - How a joint lets its second body move against its first: which joint
of the table it is (
Joint), and the limits of its coordinates. Serializes flat, the limits of only those limited, by name:{"type": "revolute", "limits": {"angle": {"min": -90.0, "max": 90.0}}}. - Limits
- The limits a joint’s coordinate is kept within, either missing — an angle’s in degrees.
Enums§
- Joint
- The joints there are, each a row of one table — how it lets the second
frame turn, and which motions it frees (
Joint::frees): every joint is the second frame held on the first within those, so that one formulation (joint_residuals) holds them all. - Motion
- One of the ways a joint may let its second frame move on its first:
turning about the first frame’s
zaxis, or sliding along itsz,xoryaxis. Each it frees is a coordinate of the joint, called as it serializes (Motion::name). - Transmission
- What a coupling transmits between its two joints: the motions of each
it ties (
Transmission::motions) and what its value is (CouplingKind::factor) — presets of one linear relation. - Turning
- How a joint lets its second frame turn against its first.
Constants§
- MOTIONS
- How many motions there are: what a joint’s coordinates are indexed by.
Functions§
- joint_
residuals - The residuals of a joint of
kindbetweena— the first part’s connector — andb, at the coordinatesat(an angle in degrees), where they are: each a length, a direction’s scaled by the part’s sizescale. - measure
- Where the coordinates of a joint between
aandbare, measured from where its ends are, byMotion::index: the angleb’s reference is turned froma’s abouta’s axis, in degrees in(-180, 180], and how farb’s origin is alonga’s axis, its reference and the direction square to both. Only a seed for a solve, which finds the exact values: read off midpoints.
Type Aliases§
- Coordinates
- A joint’s coordinates where they are, by
Motion::index: zero for a motion it does not free.