#[non_exhaustive]pub struct CompileOutcome {
pub mesh: TriMesh,
pub attribute_fates: Option<Vec<(String, AttributeFate)>>,
pub closure: MeshClosure,
}Expand description
A compiled mesh and, when the compiler tracks it, each channel’s fate.
Compilation moves and concatenates geometry, and a boolean inside the
graph cuts it, so a channel can reach the result unchanged, derived, or
not at all. mesh.attributes shows what survived; attribute_fates
says why the rest did not – the #84 contract, applied to graph
compilation (#115).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mesh: TriMeshThe compiled mesh.
attribute_fates: Option<Vec<(String, AttributeFate)>>Each channel seen anywhere in the compiled subgraph, in first-seen order, with its worst fate on any path to the root.
None when the compiler does not track channels: that is “unknown”,
not “nothing was dropped”.
closure: MeshClosureWhether the mesh bounds a solid. MeshClosure::Unknown unless the
compiler reports it; read the mesh through Self::solid_mesh
before taking a volume from it.
Implementations§
Source§impl CompileOutcome
impl CompileOutcome
Sourcepub const fn untracked(mesh: TriMesh) -> Self
pub const fn untracked(mesh: TriMesh) -> Self
A mesh from a compiler that does not report channel fates.
Sourcepub const fn tracked(
mesh: TriMesh,
attribute_fates: Vec<(String, AttributeFate)>,
) -> Self
pub const fn tracked( mesh: TriMesh, attribute_fates: Vec<(String, AttributeFate)>, ) -> Self
A mesh with its channel report.
Sourcepub const fn with_closure(self, closure: MeshClosure) -> Self
pub const fn with_closure(self, closure: MeshClosure) -> Self
The same outcome with its closure reported.
Sourcepub fn solid_mesh(&self) -> GeomResult<&TriMesh>
pub fn solid_mesh(&self) -> GeomResult<&TriMesh>
The mesh, only if it is known to bound a solid.
Use this before measuring volume, centroid or second moments. A surface model’s mesh can be closed and consistently wound, so a volume computed from it would be a plausible number with no meaning; this refuses instead of returning it (#161).
§Errors
GeomError::InvalidInput for MeshClosure::Surface and for
MeshClosure::Unknown: an unreported closure is not a solid.
Sourcepub fn fate(&self, name: &str) -> Option<&AttributeFate>
pub fn fate(&self, name: &str) -> Option<&AttributeFate>
The fate of the channel named name, if the compiler reported one.
Trait Implementations§
Source§impl Clone for CompileOutcome
impl Clone for CompileOutcome
Source§fn clone(&self) -> CompileOutcome
fn clone(&self) -> CompileOutcome
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more