pub struct TriMesh { /* private fields */ }Expand description
A closed, watertight, outward-oriented triangle mesh with welded vertices.
Implementations§
Source§impl TriMesh
impl TriMesh
Sourcepub fn from_triangles(soup: &[[[f64; 3]; 3]]) -> Result<Self, GeometryError>
pub fn from_triangles(soup: &[[[f64; 3]; 3]]) -> Result<Self, GeometryError>
Build from a triangle soup (counter-clockwise seen from outside), coordinates in metres. Welds vertices and runs the watertightness checks of the module docs.
Sourcepub fn from_stl(bytes: &[u8], unit_m: f64) -> Result<Self, GeometryError>
pub fn from_stl(bytes: &[u8], unit_m: f64) -> Result<Self, GeometryError>
Parse an STL file (ASCII or binary), scaling coordinates by unit_m
(metres per file unit).
Sourcepub fn from_obj(text: &str, unit_m: f64) -> Result<Self, GeometryError>
pub fn from_obj(text: &str, unit_m: f64) -> Result<Self, GeometryError>
Parse a Wavefront OBJ file, scaling coordinates by unit_m (metres per
file unit). Faces with more than three vertices are fan-triangulated.
Sourcepub fn triangles(&self) -> &[[u32; 3]]
pub fn triangles(&self) -> &[[u32; 3]]
Triangles as indices into TriMesh::vertices, counter-clockwise
seen from outside.
Trait Implementations§
impl StructuralPartialEq for TriMesh
Auto Trait Implementations§
impl Freeze for TriMesh
impl RefUnwindSafe for TriMesh
impl Send for TriMesh
impl Sync for TriMesh
impl Unpin for TriMesh
impl UnsafeUnpin for TriMesh
impl UnwindSafe for TriMesh
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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