Mesh

Struct Mesh 

Source
pub struct Mesh {
    pub verts: Vec<Vec3>,
    pub uvs: Vec<Vec2>,
    pub tri: Vec<usize>,
}

Fields§

§verts: Vec<Vec3>§uvs: Vec<Vec2>§tri: Vec<usize>

Implementations§

Source§

impl Mesh

Source

pub fn new(verts: Vec<Vec3>, tri: Vec<usize>, uvs: Vec<Vec2>) -> Self

Source

pub fn new_weave(verts: Grid2<Option<(Vec3, Vec2)>>) -> Mesh

Source

pub fn new_diamonds(points: Vec<Vec3>, size: fxx) -> Mesh

Source

pub fn new_diamond(center: Vec3, size: fxx) -> Mesh

Source

pub fn from_join(meshes: Vec<Mesh>) -> Mesh

Source

pub fn get_triangles(&self) -> Vec<(usize, usize, usize)>

Source

pub fn get_edges(&self) -> Vec<(usize, usize)>

Source

pub fn to_clean(&self) -> Mesh

Source

pub fn write_obj(&self, path: &str) -> Result<(), Error>

Source

pub fn write_obj_mtl( &self, path: &str, name_obj: &str, name_mtl: &str, name_texture: &str, ) -> Result<(), Error>

Source

pub fn gen_mtl_buffer( header: &str, mat_name: &str, texture_path: Option<&str>, ) -> Result<Vec<u8>, Error>

Source

pub fn gen_obj_buffer( &self, header: &str, mat_name: Option<&str>, mtl_path: Option<&str>, ) -> Result<Vec<u8>, Error>

Trait Implementations§

Source§

impl Debug for Mesh

Source§

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

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

impl Default for Mesh

Source§

fn default() -> Mesh

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

impl From<Polygon> for Mesh

Source§

fn from(p: Polygon) -> Self

Converts to this type from the input type.
Source§

impl PointBased for Mesh

Source§

fn mutate_points<'a>(&'a mut self) -> Vec<&'a mut Vec3>

Source§

fn scale_from(self, pos: Vec3, factor: fxx) -> Self

scale from a certain position.
Source§

fn scale_nu(self, pose: &Pose) -> Self

scale from a Pose, by applying only the scale element from the pose

Auto Trait Implementations§

§

impl Freeze for Mesh

§

impl RefUnwindSafe for Mesh

§

impl Send for Mesh

§

impl Sync for Mesh

§

impl Unpin for Mesh

§

impl UnwindSafe for Mesh

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> Geometry for T
where T: PointBased,

Source§

fn mv(self, mv: &DVec3) -> T

Source§

fn rot(self, rot: &DQuat) -> T

Source§

fn scale(self, scale: &DVec3) -> T

Source§

fn scale_u(self, scale: f64) -> T

Source§

fn rot_x(self, angle: fxx) -> Self

Source§

fn rot_y(self, angle: fxx) -> Self

Source§

fn rot_z(self, angle: fxx) -> Self

Source§

fn tf(self, tf: &Pose) -> Self

Source§

fn tf_inv(self, tf: &Pose) -> Self

Source§

fn reorient(self, from: &Pose, to: &Pose) -> Self

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V