#[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) -> CompileOutcome
pub const fn untracked(mesh: TriMesh) -> CompileOutcome
A mesh from a compiler that does not report channel fates.
Sourcepub const fn tracked(
mesh: TriMesh,
attribute_fates: Vec<(String, AttributeFate)>,
) -> CompileOutcome
pub const fn tracked( mesh: TriMesh, attribute_fates: Vec<(String, AttributeFate)>, ) -> CompileOutcome
A mesh with its channel report.
Sourcepub const fn with_closure(self, closure: MeshClosure) -> CompileOutcome
pub const fn with_closure(self, closure: MeshClosure) -> CompileOutcome
The same outcome with its closure reported.
Sourcepub fn solid_mesh(&self) -> Result<&TriMesh, GeomError>
pub fn solid_mesh(&self) -> Result<&TriMesh, GeomError>
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 moreSource§impl Debug for CompileOutcome
impl Debug for CompileOutcome
Source§impl PartialEq for CompileOutcome
impl PartialEq for CompileOutcome
impl StructuralPartialEq for CompileOutcome
Auto Trait Implementations§
impl Freeze for CompileOutcome
impl RefUnwindSafe for CompileOutcome
impl Send for CompileOutcome
impl Sync for CompileOutcome
impl Unpin for CompileOutcome
impl UnwindSafe for CompileOutcome
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
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