Skip to main content

View3D

Struct View3D 

Source
pub struct View3D {
    pub azimuth: f64,
    pub elevation: f64,
}
Expand description

Viewing angles for 3D projection.

Fields§

§azimuth: f64

Azimuth angle in degrees (rotation around Z-axis). Default: -60.

§elevation: f64

Elevation angle in degrees (rotation from XY-plane). Default: 30.

Implementations§

Source§

impl View3D

Source

pub fn front_bottom_corner(&self) -> (f64, f64)

Find the floor-face corner closest to the viewer (smallest depth). Returns the normalized (x, y) signs of that corner, e.g. (0.5, -0.5). This is the “open front corner” where axes originate.

For positive elevation the floor is z=-0.5; for negative elevation (viewing from below) the floor is z=+0.5.

Source

pub fn auto_z_axis_right(&self) -> bool

Derive which screen side the Z axis should appear on for this view.

When the front corner is at fc_x >= 0 (e.g. default azimuth -60°), the rightmost back edge is the natural Z axis position. When the view is mirrored (fc_x < 0, e.g. azimuth +60°), the leftmost edge reads more naturally. This matches matplotlib’s default behaviour across all azimuths without the user needing to know about it.

Trait Implementations§

Source§

impl Clone for View3D

Source§

fn clone(&self) -> View3D

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 View3D

Source§

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

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

impl Default for View3D

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for View3D

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> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.