MeshCollection

Struct MeshCollection 

Source
pub struct MeshCollection {
    pub meshes: Vec<TriangleMesh>,
}
Expand description

Represents a collection of TriangleMesh objects.

Fields§

§meshes: Vec<TriangleMesh>

Implementations§

Source§

impl MeshCollection

Source

pub fn new(meshes: Vec<TriangleMesh>) -> Self

Creates a new MeshCollection from a vector of TriangleMeshes

Source

pub fn num_meshes(&self) -> usize

Returns the number of meshes in the collection.

Source

pub fn num_triangles(&self) -> usize

Returns the number of triangles in the collection.

Source

pub fn num_vertices(&self) -> usize

Returns the number of vertices in the collection.

Source

pub fn num_normals(&self) -> usize

Returns the number of normal vectors in the collection.

Source

pub fn triangles(&self) -> impl Iterator<Item = Triangle> + '_

Returns an iterator over all the Triangles in the collection.

Source

pub fn vertices(&self) -> impl Iterator<Item = Vertex> + '_

Returns an iterator over all the Vertex objects in the collection.

Source

pub fn normals(&self) -> impl Iterator<Item = Normal> + '_

Returns an iterator over all the Normals in the collection.

Source

pub fn index_of_first_vertex(&self, mesh_index: usize) -> usize

Returns the index of the first Vertex of a given TriangleMesh in the collection.

Source§

impl MeshCollection

Source

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

Writes the STL representation of the mesh collection to a file.

Source

pub fn to_stl(&self) -> String

Source

pub fn from_stl(stl_str: &str) -> Result<Self>

Reads an STL file and returns a TriangleMesh.

Trait Implementations§

Source§

impl Debug for MeshCollection

Source§

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

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

impl<'de> Deserialize<'de> for MeshCollection

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<I> From<I> for MeshCollection
where I: IntoIterator<Item = TriangleMesh>,

Source§

fn from(meshes: I) -> Self

Converts to this type from the input type.
Source§

impl From<MeshCollection> for TriangleMesh

Source§

fn from(mesh_collection: MeshCollection) -> Self

Converts to this type from the input type.
Source§

impl From<TriangleMesh> for MeshCollection

Source§

fn from(triangle_mesh: TriangleMesh) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MeshCollection

Source§

fn eq(&self, other: &MeshCollection) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MeshCollection

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToVtk for MeshCollection

Source§

fn to_vtk(&self) -> Vtk

Source§

impl StructuralPartialEq for MeshCollection

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

Source§

fn downcast(&self) -> &T

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,