pub struct Frame {
pub origin: Vec3,
pub x_axis: Vec3,
pub y_axis: Vec3,
pub z_axis: Vec3,
}Expand description
An orthonormal placement frame — a named plane (DATUM/PLANE feature) or a
resolved sketch plane. z_axis is the plane normal.
Fields§
§origin: Vec3§x_axis: Vec3§y_axis: Vec3§z_axis: Vec3Implementations§
Source§impl Frame
impl Frame
Sourcepub fn from_origin_normal(origin: Vec3, normal: Vec3) -> Result<Self, String>
pub fn from_origin_normal(origin: Vec3, normal: Vec3) -> Result<Self, String>
Derive an orthonormal frame from an origin + plane normal via the worldUp
convention, the
SINGLE source of truth for how a sketch/plane reference becomes in-plane
axes: refUp = |n·(0,1,0)| > 0.9 ? (1,0,0) : (0,1,0);
x = norm(refUp × n); y = norm(n × x); z = n. The referenced object’s
own x/y are intentionally ignored — only its (origin, normal) matter.
Sourcepub fn from_origin_direction(
origin: Vec3,
direction: Vec3,
) -> Result<Self, String>
pub fn from_origin_direction( origin: Vec3, direction: Vec3, ) -> Result<Self, String>
Derive an orthonormal frame whose x_axis is direction — the frame a
connection point’s placement is an offset in (its seat, ports::seat_of).
A connection point’s direction is its rotation applied to +X (the
convention every feature transform reads), so the frame that seats one
must carry the direction on X, not on Z. Rather than invent a second
worldUp rule this is the CYCLIC RELABEL of Self::from_origin_normal’s
triad — x = z’, y = x’, z = y’ — which is still right-handed and keeps
ONE convention for how a direction becomes a basis. A sketch on the
point’s published frame and the point’s own offset axes therefore agree
by construction: they are the same three vectors, named round.