Polyhedron

Struct Polyhedron 

Source
pub struct Polyhedron<F>
where F: Float,
{ pub vtx: Vec<[F; 3]>, pub tri: Vec<Vec<[u16; 3]>>, pub uv: Vec<Vec<[[F; 2]; 3]>>, pub vol: F, pub center: bool, }
Expand description

Polyhedron

Fields§

§vtx: Vec<[F; 3]>

vtx

§tri: Vec<Vec<[u16; 3]>>

tri: [n][m] Vec n faces of Vec m indexed triangles

§uv: Vec<Vec<[[F; 2]; 3]>>

uv: [n][m] Vec n faces of Vec m uv triangles

§vol: F

volume

§center: bool

center

Trait Implementations§

Source§

impl<F> Debug for Polyhedron<F>
where F: Debug + Float,

Source§

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

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

impl<F> TUV<F> for Polyhedron<F>
where F: Float,

impl trait TUV for Polyhedron

Source§

fn get_uv_t( &self, fi: usize, ti: usize, vi: usize, _r: f64, _s: f64, o: [f64; 2], ) -> [F; 2]

get uv from the one texture (fi ti vi: id of expanded polyhedron)

Source§

fn ref_vtx(&self) -> &Vec<[F; 3]>

ref vtx

Source§

fn ref_tri(&self) -> &Vec<Vec<[u16; 3]>>

ref tri

Source§

fn ref_uv(&self) -> &Vec<Vec<[[F; 2]; 3]>>

ref uv

Source§

fn ref_vtx_mut(&mut self) -> &mut Vec<[F; 3]>

ref vtx mut

Source§

fn ref_tri_mut(&mut self) -> &mut Vec<Vec<[u16; 3]>>

ref tri mut

Source§

fn ref_uv_mut(&mut self) -> &mut Vec<Vec<[[F; 2]; 3]>>

ref uv mut

Source§

fn centered(&self) -> bool

centered

Source§

fn get_uv_f( &self, n: usize, i: usize, k: usize, c: bool, r: f64, s: f64, o: [f64; 2], ) -> [F; 2]

get uv from each face (i: vertex id of npolygon)
Source§

fn with_uv(&self, tf: bool) -> Vec<Vec<Vec<FTVI<F>>>>

with_uv
Source§

fn phf(&self, tf: bool, c: bool) -> Vec<Vec<Vec<FTVI<F>>>>

polyhedron faces by Vec N of Vec P(polygon) indexed triangles
Source§

fn gen_uv( &self, i: usize, tf: bool, fi: usize, n: usize, ti: usize, vi: usize, c: bool, ) -> FTVI<F>

gen uv
Source§

fn calc_cg_with_volume(&self, p: F) -> (Vec<F>, F)
where F: Debug + Sum,

calc cg with volume
Source§

fn calc_cg(&self, p: F) -> Vec<F>
where F: Debug + Sum,

calc cg
Source§

fn adjust_cg_with_volume(&mut self, p: F) -> (Vec<F>, F)
where F: Debug + Sum,

adjust cg with volume
Source§

fn adjust_cg(&mut self, p: F) -> Vec<F>
where F: Debug + Sum,

adjust cg
Source§

fn translate(&mut self, o: &[F])
where F: Debug,

translate

Auto Trait Implementations§

§

impl<F> Freeze for Polyhedron<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for Polyhedron<F>
where F: RefUnwindSafe,

§

impl<F> Send for Polyhedron<F>
where F: Send,

§

impl<F> Sync for Polyhedron<F>
where F: Sync,

§

impl<F> Unpin for Polyhedron<F>
where F: Unpin,

§

impl<F> UnwindSafe for Polyhedron<F>
where F: UnwindSafe,

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