Skip to main content

Module mates

Module mates 

Source
Expand description

Mates: what holds the parts placed in a part together — two entities, each of a placed part or of the part itself, and what they must be to each other (see MateKind) — and solving them, by moving the placed parts (see crate::mechanism).

What a mate asks is said by crate::residuals and crate::joints. What is added here is how an element (MateEntity) becomes a point, a line, a plane or a joint’s connector of a placed part: an element of a placed part moves with that part; an element of the part itself never moves.

A joint is made between two frames, one on each part, which a click puts on whatever is picked — a face, an edge, a point or a datum (see MateEntity::frame): it turns about, or slides along, their common z axis, the second part’s frame moving on the first’s.

A joint’s coordinates — how far it is turned and slid — are parameters of the part’s state, like the poses of its placed parts: named after the mate, add_part(arm2,m1).angle (see joint_parameter). Solving sets them, and a program sets them to place a mechanism at a pose. A joint whose coordinate the state does not give starts where its parts are.

Re-exports§

pub use crate::joints::Connector;
pub use crate::joints::CouplingKind;
pub use crate::joints::Joint;
pub use crate::joints::JointKind;
pub use crate::joints::Limits;
pub use crate::joints::MOTIONS;
pub use crate::joints::Motion;
pub use crate::joints::Transmission;
pub use crate::residuals::Geometry;
pub use crate::residuals::Kind;

Structs§

Mate
A mate: what two entities must be to each other — or, for a coupling, two joints. Serializes flat: {"type": "distance", "value": 1.0, "entities": [...]}.
MateEntity
What a mate holds by: the element on, of the part itself or of a part placed in it, however deep (see geop_core_program::placed) — and, for a joint’s frame, the element of the same part the frame sits at: a corner or a side of a face, an end of an edge (see MateEntity::frame). Saved as {"on": {"face": {"target": "/bolt:model", "name": "extrude(head,end)"}}}.
On
What an entity of a mate is to a solve: what it is, in the frame of the body it moves with — the placed part it is of, however deep, by name; none for the part itself, which never moves — and the entity, as the part names it, to say what the mate joins.

Enums§

Anchor
What holds a part where it is, whatever the other mates ask: the part one entity of the mate is of never moves in a solve.
MateKind
What a mate asks: that two entities touch, line up or keep a distance (a constraint); that one part may only turn or slide against another about an axis (a joint); or that two joints move together (a coupling). Serializes flat, by the kind’s own type: {"type": "revolute", "max": 90.0}.
Resolved
A mate as a solve takes it, its entities resolved where their parts are: the value of its target (mate). It reads no state, so a part moved does not resolve it again.

Functions§

foot_parameter
The name of the parameter foot of the foot point a constraint named mate keeps its follower at (see Kind::feet): add_part(cam,m1).t.
joint_parameter
The name of the parameter that is the coordinate of motion of the joint named mate: add_part(arm2,m1).angle — in degrees — or .distance.
mate
The mate name, resolved.
mate_name
The name of the mate whose target is named target, if it is one.