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).
Axis
Axis-bearing face (cylinder / cone / torus / general revolution): a point on the axis + unit direction.
Sphere
Spherical face.
Circle
Circular or arc edge; axis follows the right-hand rule along the
edge’s increasing-parameter direction.
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.
Point
Vertex (or whole-component representative point).
Implementations§
Source§impl SelectionGeometry
impl SelectionGeometry
Sourcepub fn mate_plane(&self) -> Option<MatePlane>
pub fn mate_plane(&self) -> Option<MatePlane>
The solver’s plane input, for planar-face selections.
Sourcepub fn mate_axis(&self) -> Option<MateAxis>
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.
Sourcepub fn representative_point(&self) -> Vec3
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.
Sourcepub fn transformed(
&self,
transform: &AffineTransform,
) -> Result<Self, ResolveError>
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
impl Clone for SelectionGeometry
Source§fn clone(&self) -> SelectionGeometry
fn clone(&self) -> SelectionGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more