pub struct TriMesh {
pub positions: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub indices: Vec<u32>,
pub edges: Vec<u32>,
pub colors: Vec<[f32; 3]>,
pub faces: Vec<u32>,
pub edge_ids: Vec<u32>,
pub face_surfaces: Vec<FaceSurface>,
pub face_names: Vec<TopoName>,
pub edge_faces: Vec<[TopoName; 2]>,
}Expand description
Triangular mesh generated from kernel bodies for viewports and export.
Fields§
§positions: Vec<[f32; 3]>§normals: Vec<[f32; 3]>§indices: Vec<u32>§edges: Vec<u32>Optional line-list of feature edges that should be drawn as outlines on
top of the shaded surface (e.g. face boundaries from a STEP import).
Stored as flat pairs of indices into Self::positions; the slice
length is therefore always a multiple of two. Empty when the source has
no edge information available.
colors: Vec<[f32; 3]>Optional per-vertex linear RGB albedo in 0..1 (same length as Self::positions when set).
Empty means the renderer uses the body tint from push constants only.
faces: Vec<u32>Which kernel face each triangle was cut from: one entry per triangle
(indices.len() / 3), an index into the body’s faces in the kernel’s
own order. A curved face is many triangles with many normals, and
this is what lets a click on one of them select the whole face.
Empty when the source has no faces (a sketch, a datum, a mesh saved
before faces were recorded), and a consumer falls back to geometry.
edge_ids: Vec<u32>Which kernel edge each outline segment belongs to: one entry per
pair in Self::edges, an index into the body’s edges in the
kernel’s own order. A curved edge is many segments, and this is what
lets a click on one of them select the whole edge. Empty when the
outline came from triangle boundaries rather than kernel edges.
face_surfaces: Vec<FaceSurface>The exact surface of each kernel face, indexed like Self::faces:
what a picked face is, beyond the triangles drawn for it. Empty when
the source has no faces.
face_names: Vec<TopoName>The name of each kernel face, indexed like Self::faces: what a
pick keeps so a rebuild finds the face again. Zero where a face has
none; empty when the source names none.
edge_faces: Vec<[TopoName; 2]>The names of the two faces each kernel edge runs between, indexed
like Self::edge_ids.