pub struct Triangle {
pub v1: u32,
pub v2: u32,
pub v3: u32,
pub p1: Option<u32>,
pub p2: Option<u32>,
pub p3: Option<u32>,
pub pid: Option<u32>,
}Expand description
A triangle face defined by three vertex indices.
Triangles are the fundamental building blocks of 3MF meshes. They reference vertices by index and can optionally specify material properties per-vertex or per-triangle.
§Material Properties
The property system allows materials/colors to be assigned at different levels:
- Triangle-level: Use
pidto assign a property resource to the entire triangle - Vertex-level: Use
p1,p2,p3to assign different properties to each vertex - Object-level: If no triangle properties are set, the object’s default
pid/pindexapply
The property resolution hierarchy is: Vertex → Triangle → Object → None
Fields§
§v1: u32Index of the first vertex (counter-clockwise winding).
v2: u32Index of the second vertex (counter-clockwise winding).
v3: u32Index of the third vertex (counter-clockwise winding).
p1: Option<u32>Property index for v1 (optional, for per-vertex material assignment).
p2: Option<u32>Property index for v2 (optional, for per-vertex material assignment).
p3: Option<u32>Property index for v3 (optional, for per-vertex material assignment).
pid: Option<u32>Property ID resource for the entire triangle (optional, for per-triangle material assignment).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Triangle
impl<'de> Deserialize<'de> for Triangle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Triangle
impl StructuralPartialEq for Triangle
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnwindSafe for Triangle
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
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>
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