Struct CompileOutcome

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§mesh: TriMesh

The 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: MeshClosure

Whether 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

Source

pub const fn untracked(mesh: TriMesh) -> Self

A mesh from a compiler that does not report channel fates.

Source

pub const fn tracked( mesh: TriMesh, attribute_fates: Vec<(String, AttributeFate)>, ) -> Self

A mesh with its channel report.

Source

pub const fn with_closure(self, closure: MeshClosure) -> Self

The same outcome with its closure reported.

Source

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.

Source

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

Source§

fn clone(&self) -> CompileOutcome

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompileOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CompileOutcome

Source§

fn eq(&self, other: &CompileOutcome) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CompileOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.