Enum gltfgen::mesh::Mesh

source ·
pub enum Mesh {
    TriMesh(Box<TriMesh<f32>>),
    PointCloud(PointCloud<f32>),
}
Expand description

Supported output mesh types.

Variants§

§

TriMesh(Box<TriMesh<f32>>)

§

PointCloud(PointCloud<f32>)

Implementations§

source§

impl Mesh

source

pub fn is_empty(&self) -> bool

source

pub fn reverse(&mut self)

source

pub fn eq_topo(&self, other: &Mesh) -> bool

Returns true if the other mesh has equivalent topology to self.

source

pub fn build_topology( &self, attrib_transfer: &AttribTransfer, data: &mut Vec<u8>, buffer_views: &mut Vec<View>, accessors: &mut Vec<Accessor> ) -> (&[[f32; 3]], Option<Vec<Index<Accessor>>>)

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 From<PointCloud<f32>> for Mesh

source§

fn from(mesh: PointCloud<f32>) -> Self

Converts to this type from the input type.
source§

impl From<PointCloud<f64>> for Mesh

source§

fn from(mesh: PointCloud<f64>) -> Self

Converts to this type from the input type.
source§

impl From<PolyMesh<f32>> for Mesh

source§

fn from(mesh: PolyMesh<f32>) -> Self

Converts to this type from the input type.
source§

impl From<PolyMesh<f64>> for Mesh

source§

fn from(mesh: PolyMesh<f64>) -> Self

Converts to this type from the input type.
source§

impl From<TetMesh<f32>> for Mesh

source§

fn from(mesh: TetMesh<f32>) -> Self

Converts to this type from the input type.
source§

impl From<TetMesh<f64>> for Mesh

source§

fn from(mesh: TetMesh<f64>) -> Self

Converts to this type from the input type.
source§

impl From<TriMesh<f32>> for Mesh

source§

fn from(mesh: TriMesh<f32>) -> Self

Converts to this type from the input type.
source§

impl VertexPositions for Mesh

§

type Element = [f32; 3]

source§

fn vertex_positions(&self) -> &[Self::Element]

Vertex positions as a slice of triplets.
source§

fn vertex_positions_mut(&mut self) -> &mut [Self::Element]

Vertex positions as a mutable slice of triplets.
source§

fn vertex_position_iter(&self) -> Iter<'_, Self::Element>

Vertex iterator.
source§

fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>

Mutable vertex iterator.
source§

fn vertex_position<VI>(&self, vidx: VI) -> Self::Elementwhere VI: Into<VertexIndex>, Self::Element: Clone,

Vertex accessor.

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<M, T> BoundingBox<T> for Mwhere T: Real, M: VertexPositions<Element = [T; 3]>,

source§

fn bounding_box(&self) -> BBox<T>

Compute the bounding box of this object.

source§

impl<T> Bytes for T

source§

fn as_bytes(&self) -> &[u8]

Get a slice of bytes representing Self.
source§

fn interpret_bytes(bytes: &[u8]) -> &Self

Panics if the size of the given bytes slice is not equal to the size of Self.
§

impl<T> DebugBytes for Twhere T: Debug + 'static,

§

unsafe fn fmt_bytes( bytes: &[MaybeUninit<u8>], f: &mut Formatter<'_> ) -> Result<(), Error>

§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DropBytes for Twhere T: 'static,

§

unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'a, S, I> Get<'a, I> for Swhere I: GetIndex<'a, S>,

§

type Output = <I as GetIndex<'a, S>>::Output

§

fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>

§

fn at(&self, idx: I) -> Self::Output

Return a value at the given index. This is provided as the checked version of get that will panic if the equivalent get call is None, which typically means that the given index is out of bounds. Read more
§

unsafe fn at_unchecked(&self, idx: I) -> Self::Output

Return a value at the given index. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<S, I> Isolate<I> for Swhere I: IsolateIndex<S>,

§

type Output = <I as IsolateIndex<S>>::Output

§

unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output

Unchecked version of isolate. Read more
§

fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>

§

fn isolate(self, idx: I) -> Self::Outputwhere Self: Sized,

Return a value at the given index. This is provided as the checked version of try_isolate that will panic if the equivalent try_isolate call is None, which typically means that the given index is out of bounds. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, M> Rotate<T> for Mwhere T: RealField + Float, M: VertexPositions<Element = [T; 3]>,

source§

fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])

Rotate the mesh using the given column-major rotation matrix.

source§

fn rotate(&mut self, axis: [T; 3], theta: T)

Rotate the object around the given unit vector u by the given angle theta (in radians). Read more
source§

fn rotate_by_vector(&mut self, e: [T; 3])where T: Zero,

Rotate the object using the given Euler vector (or rotation vector) e. The direction of e specifies the axis of rotation and its magnitude is the angle in radians.
source§

impl<S, T> Rotated<T> for Swhere T: RealField, S: Rotate<T>,

source§

fn rotated(self, u: [T; 3], theta: T) -> S

Return a version of self rotated about the unit vector u by the given angle theta (in radians). Read more
source§

fn rotated_by_matrix(self, mtx: [[T; 3]; 3]) -> S

Return a version of self rotated using the given column-major rotation matrix
source§

fn rotated_by_vector(self, e: [T; 3]) -> S

Return a version of self rotated about the Euler vector e.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, M> Scale<T> for Mwhere T: RealField, M: VertexPositions<Element = [T; 3]>,

source§

fn scale(&mut self, _: [T; 3])

Scale a mesh in 3D by a given vector of scale factors. s = [1.0; 3] corresponds to a noop.

source§

fn uniform_scale(&mut self, s: T)

Uniformly scale the given object by the given factor in all dimensions.
source§

impl<S, T> Scaled<T> for Swhere T: Copy, S: Scale<T>,

source§

fn scaled(self, s: [T; 3]) -> S

Return a scaled version of self.
source§

fn uniformly_scaled(self, s: T) -> S

Return a uniformly scaled version of self.
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, M> Translate<T> for Mwhere T: RealField, M: VertexPositions<Element = [T; 3]>,

source§

fn translate(&mut self, _: [T; 3])

Translate the mesh by the given translation vector (displacement) t.

source§

impl<S, T> Translated<T> for Swhere S: Translate<T>,

source§

fn translated(self, t: [T; 3]) -> S

Return a version of self translated by the given translation vector t.
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<T> Elem for Twhere T: Any + DropBytes,