pub enum ViewFrame {
World,
Board,
}Expand description
Which way the NAMED views face: the frame the standard-view table and the ViewCube’s labelled faces are read in, carried into the world by a rotation.
The table is written once, Y-up (FRONT on +Z, TOP on +Y), which is how a
modelled part is drawn. A PCB is not: the board is built Z-up — F.Cu’s plane
at z = 0, the parts standing on +Z, the layout’s +Y-down read as world −Y
(engine_state::board_geometry). Read in the Y-up frame, TOP shows the
board’s 1.6 mm edge and FRONT its component side (eCAD third audit, B5).
The board is NOT turned to suit the viewer, because its world coordinates
are what STEP export writes, what the parts’ placements are written in and
what locate reports; it is the names that turn. So a view is a direction
in the frame, and Self::to_world is the one place the frame is applied —
by the standard views and by the ViewCube alike, so the cube’s T face is the
one the TOP view looks at.
Variants§
World
Y-up: the world itself. Every document without a board.
Board
Z-up, for a document that shows a board: frame +X → world +X (the layout’s right), frame +Y (TOP) → world +Z (the component side), frame +Z (FRONT) → world −Y (the layout’s bottom edge, the one nearest the reader in the 2D board view). A +90° turn about X, so it is a proper rotation and the ViewCube’s letters stay unmirrored.
TOP then looks down with world +Y up, which is the 2D board view’s own orientation. BOTTOM is the Y-up table’s BOTTOM carried over (up = frame +Z = world −Y): the physical underside, as if the board were tipped towards the reader over its front edge, NOT the left-right mirror a 2D editor’s “flip board” shows.
Implementations§
Trait Implementations§
impl Copy for ViewFrame
impl Eq for ViewFrame
impl StructuralPartialEq for ViewFrame
Auto Trait Implementations§
impl Freeze for ViewFrame
impl RefUnwindSafe for ViewFrame
impl Send for ViewFrame
impl Sync for ViewFrame
impl Unpin for ViewFrame
impl UnsafeUnpin for ViewFrame
impl UnwindSafe for ViewFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more