pub struct CouplingKind {
pub transmission: Transmission,
pub value: Scalar,
pub reverse: bool,
pub offset: Option<Scalar>,
}Expand description
How a coupling ties its two joints’ coordinates: the second’s is the
first’s times a factor — given by value as the transmission says,
negated if reverse — plus offset, in the second’s units, degrees for
an angle. Serializes flat: {"type": "gear", "value": 2.0, "reverse": true}.
Fields§
§transmission: Transmission§value: Scalar§reverse: bool§offset: Option<Scalar>Implementations§
Source§impl CouplingKind
impl CouplingKind
Sourcepub fn new(transmission: Transmission, value: Scalar, reverse: bool) -> Self
pub fn new(transmission: Transmission, value: Scalar, reverse: bool) -> Self
A coupling of transmission by value, turning the way that
transmission does unless reverse, at no offset.
Sourcepub fn factor(&self) -> GeopResult<Scalar>
pub fn factor(&self) -> GeopResult<Scalar>
The second coordinate per radian or unit of length of the first, both in natural units — radians and lengths.
Sourcepub fn validate(&self, same: bool, frees: [bool; 2]) -> GeopResult<()>
pub fn validate(&self, same: bool, frees: [bool; 2]) -> GeopResult<()>
Checks it can tie the motions of one joint and another — same
whether they are the one joint — that the joints free: frees
saying whether a joint does.
Sourcepub fn residual(&self, a: D, b: D, scale: D) -> GeopResult<D>
pub fn residual(&self, a: D, b: D, scale: D) -> GeopResult<D>
The residual between the coordinates a and b of its two joints —
in their own units, degrees for an angle: the second less the first
times the factor and the offset, in natural units, as a length — an
angle’s turned into one by the part’s size scale.
Trait Implementations§
Source§impl Clone for CouplingKind
impl Clone for CouplingKind
Source§fn clone(&self) -> CouplingKind
fn clone(&self) -> CouplingKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more