Skip to main content

Module residuals

Module residuals 

Source
Expand description

What a constraint mate asks of the geometry of two placed parts, as residuals: a point, a line or a plane of each — where its part puts it (Geometry::placed) — and what they must be to each other (Kind), each residual a length that vanishes where it holds (residuals).

Everything placed is computed in dual numbers (D), so that every residual carries its derivatives (see crate::mechanism).

A mate that holds a point on a curve or a face of the other part (Kind::Path, Kind::Tangent) asks where on it: the foot point’s parameters (Kind::feet) are values of the program’s state, solved with the poses, and its residuals are the follower’s point less the foot point (contact_residuals).

Re-exports§

pub use crate::solving::D;

Structs§

Direction
A line’s direction or a plane’s normal where it is, and two directions square to it and to each other.
Foot
A parameter of a foot point: its domain, and whether the curve or surface closes on itself along it — then the parameter has no end, and a value past one stands for the point as far past the other.

Enums§

Geometry
A point, a line or a plane of a part, in its own frame — or what a point is kept on: a curve, a face’s surface.
Kind
What a constraint asks of its two features.
World
A feature where its part puts it.

Functions§

contact_residuals
The residuals of a constraint of kind that keeps the follower b on a — a point on a curve, a circle or a point touching a face — at the foot point feet (see Kind::feet), where pa and pb put them: the follower’s point less the foot point, three lengths.
residuals
The residuals of a constraint of kind between a and b, where they are, each a length — a direction’s scaled by the part’s size scale.
seed_feet
Where on a the foot point of the follower b is, where pa and pb put them: of a curve its t, of a surface its u and v, nearest the follower’s point. A seed for a solve, which finds the true one: a free choice.