Skip to main content

MateKind

Enum MateKind 

Source
pub enum MateKind {
Show 14 variants CoincidentPointPoint { point_a: [f64; 3], point_b: [f64; 3], }, CoincidentPointPlane { point_a: [f64; 3], plane_b: MatePlane, }, CoincidentPlanePlane { plane_a: MatePlane, plane_b: MatePlane, align: MateAlign, }, ConcentricAxisAxis { axis_a: MateAxis, axis_b: MateAxis, align: MateAlign, }, DistancePointPoint { point_a: [f64; 3], point_b: [f64; 3], distance: f64, }, DistancePointPlane { point_a: [f64; 3], plane_b: MatePlane, distance: f64, }, DistancePlanePlane { plane_a: MatePlane, plane_b: MatePlane, distance: f64, align: MateAlign, }, DistancePointLine { point_a: [f64; 3], axis_b: MateAxis, distance: f64, }, DistanceLineLine { axis_a: MateAxis, axis_b: MateAxis, distance: f64, }, Angle { direction_a: [f64; 3], direction_b: [f64; 3], angle_deg: f64, }, Parallel { direction_a: [f64; 3], direction_b: [f64; 3], align: MateAlign, }, Perpendicular { direction_a: [f64; 3], direction_b: [f64; 3], }, TangentSpherePlane { center_a: [f64; 3], radius: f64, plane_b: MatePlane, }, TangentCylinderPlane { axis_a: MateAxis, radius: f64, plane_b: MatePlane, },
}
Expand description

Mate geometry + semantics. All points/directions/planes/axes are expressed in the OWNING body’s local frame (*_a on body_a, *_b on body_b).

Variants§

§

CoincidentPointPoint

Two local points touch (3 DOF removed).

Fields

§point_a: [f64; 3]
§point_b: [f64; 3]
§

CoincidentPointPlane

A point of body A lies on a plane of body B (1 DOF removed).

Fields

§point_a: [f64; 3]
§plane_b: MatePlane
§

CoincidentPlanePlane

Two planes are coplanar with the given normal sense (3 DOF removed).

Fields

§plane_a: MatePlane
§plane_b: MatePlane
§

ConcentricAxisAxis

Two axes are collinear (4 DOF removed; spin + slide stay free).

Fields

§axis_a: MateAxis
§axis_b: MateAxis
§

DistancePointPoint

‖pa − pb‖ equals distance (1 DOF removed). A zero distance degrades gracefully to a point-point coincidence.

Fields

§point_a: [f64; 3]
§point_b: [f64; 3]
§distance: f64
§

DistancePointPlane

Signed height of the point above the plane (along its world normal) equals distance (1 DOF removed).

Fields

§point_a: [f64; 3]
§plane_b: MatePlane
§distance: f64
§

DistancePlanePlane

Parallel planes at a signed offset: distance is measured from plane A to plane B’s origin along plane A’s world normal (3 DOF removed).

Fields

§plane_a: MatePlane
§plane_b: MatePlane
§distance: f64
§

DistancePointLine

Distance from a point of body A to an INFINITE line of body B equals distance (1 DOF removed): residual ‖(p − o) ⊥ d‖ − distance. A zero distance degrades gracefully to point-on-line coincidence (the coincident_point_line shortcut — the norm residual would be non-differentiable at zero).

Fields

§point_a: [f64; 3]
§axis_b: MateAxis
§distance: f64
§

DistanceLineLine

Closest-approach distance between two INFINITE lines equals distance (1 DOF removed). Skew lines use |u·(da×db)|/‖da×db‖; nearly parallel lines (sine of the angle below ASM_LL_SIN_PARALLEL) are measured point-to-line instead — the skew formula degenerates there — with a C1 smoothstep blend of the squared measures across the band up to ASM_LL_SIN_SKEW. A zero distance degrades to a signed touch constraint (intersecting when skew, collinear when parallel), so parallel + distance_line_line(0) is the concentric shortcut without the direction rows.

Fields

§axis_a: MateAxis
§axis_b: MateAxis
§distance: f64
§

Angle

Angle in degrees between two world directions (plane normals or axis directions); residual is cos(measured) − cos(target) (1 DOF removed).

Fields

§direction_a: [f64; 3]
§direction_b: [f64; 3]
§angle_deg: f64
§

Parallel

Directions parallel (2 DOF removed).

Fields

§direction_a: [f64; 3]
§direction_b: [f64; 3]
§

Perpendicular

Directions perpendicular (1 DOF removed).

Fields

§direction_a: [f64; 3]
§direction_b: [f64; 3]
§

TangentSpherePlane

Sphere (centre on body A, radius) tangent to a plane of body B, centre on the positive-normal side (1 DOF removed).

Fields

§center_a: [f64; 3]
§radius: f64
§plane_b: MatePlane
§

TangentCylinderPlane

Cylinder (axis on body A, radius) tangent to a plane of body B, axis on the positive-normal side (2 DOF removed).

Fields

§axis_a: MateAxis
§radius: f64
§plane_b: MatePlane

Trait Implementations§

Source§

impl Clone for MateKind

Source§

fn clone(&self) -> MateKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MateKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MateKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MateKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more