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