Skip to main content

SelectionGeometry

Enum SelectionGeometry 

Source
pub enum SelectionGeometry {
    Plane {
        origin: Vec3,
        normal: Vec3,
    },
    Axis {
        origin: Vec3,
        direction: Vec3,
        radius: Option<f64>,
    },
    Sphere {
        center: Vec3,
        radius: f64,
    },
    Circle {
        center: Vec3,
        axis: Vec3,
        radius: f64,
    },
    Line {
        origin: Vec3,
        direction: Vec3,
    },
    Point {
        position: Vec3,
    },
}
Expand description

A resolved analytic selection frame, in the coordinate space of the solid it was resolved from (module docs: pass the component’s world→local inverse to Self::transformed for the solver’s component-local mate inputs).

Cross-lane invariant: SelectionGeometry::Axis::radius is Some IFF the face is a genuine constant-radius cylinder — the gate for the tangent_cylinder_plane mate. Cones, tori, and general revolution faces resolve with radius: None.

Variants§

§

Plane

Planar face: origin on the plane (face boundary AABB center projected onto it — the face_frame convention) + OUTWARD unit normal (face sense respected, per the one plane-z direction convention).

Fields

§origin: Vec3
§normal: Vec3
§

Axis

Axis-bearing face (cylinder / cone / torus / general revolution): a point on the axis + unit direction.

Fields

§origin: Vec3
§direction: Vec3
§radius: Option<f64>
§

Sphere

Spherical face.

Fields

§center: Vec3
§radius: f64
§

Circle

Circular or arc edge; axis follows the right-hand rule along the edge’s increasing-parameter direction.

Fields

§center: Vec3
§axis: Vec3
§radius: f64
§

Line

Straight edge: the INFINITE carrier line (origin = chord midpoint, unit direction start→end). Distance mates measure against the carrier, never the clamped finite segment.

Fields

§origin: Vec3
§direction: Vec3
§

Point

Vertex (or whole-component representative point).

Fields

§position: Vec3

Implementations§

Source§

impl SelectionGeometry

Source

pub fn mate_plane(&self) -> Option<MatePlane>

The solver’s plane input, for planar-face selections.

Source

pub fn mate_axis(&self) -> Option<MateAxis>

The solver’s axis input, for every axis-bearing selection: an axis face, a circular edge (center + circle axis), or a straight edge’s carrier line.

Source

pub fn representative_point(&self) -> Vec3

The per-kind anchor point (requirements §4.1 point marshaling): plane / axis / line origin, sphere / circle center, the point itself.

Source

pub fn transformed( &self, transform: &AffineTransform, ) -> Result<Self, ResolveError>

Map the frame through transform — pass the owning component’s world→local inverse to express a world-resolved frame in the component-local coordinates the solver’s mate inputs require. Rigid / uniform-similarity matrices only (component poses are rigid by spec): radii scale by the uniform factor; a shearing or non-uniformly scaling matrix is refused (it has no analytic image for circles/cylinders).

Trait Implementations§

Source§

impl Clone for SelectionGeometry

Source§

fn clone(&self) -> SelectionGeometry

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 Copy for SelectionGeometry

Source§

impl Debug for SelectionGeometry

Source§

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

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

impl Serialize for SelectionGeometry

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> 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