pub struct BinaryMesh {
pub vertices: Vec<[f64; 3]>,
pub triangles: Vec<[u32; 3]>,
}Expand description
A minimal binary triangle mesh representation.
Format:
u32number of verticesu32number of triangles3 * n_verts * f64flat XYZ vertex positions3 * n_tris * u32triangle vertex indices
Fields§
§vertices: Vec<[f64; 3]>Vertex positions stored as flat XYZ triples.
triangles: Vec<[u32; 3]>Triangle indices (0-based).
Implementations§
Source§impl BinaryMesh
impl BinaryMesh
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, String>
pub fn from_bytes(data: &[u8]) -> Result<Self, String>
Deserialize from bytes (little-endian).
Sourcepub fn n_vertices(&self) -> usize
pub fn n_vertices(&self) -> usize
Number of vertices.
Sourcepub fn n_triangles(&self) -> usize
pub fn n_triangles(&self) -> usize
Number of triangles.
Trait Implementations§
Source§impl Clone for BinaryMesh
impl Clone for BinaryMesh
Source§fn clone(&self) -> BinaryMesh
fn clone(&self) -> BinaryMesh
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryMesh
impl Debug for BinaryMesh
Auto Trait Implementations§
impl Freeze for BinaryMesh
impl RefUnwindSafe for BinaryMesh
impl Send for BinaryMesh
impl Sync for BinaryMesh
impl Unpin for BinaryMesh
impl UnsafeUnpin for BinaryMesh
impl UnwindSafe for BinaryMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.