Skip to main content

GeometryError

Enum GeometryError 

Source
pub enum GeometryError {
Show 20 variants Empty, InvalidThickness { index: usize, thickness_m: f64, }, NoMaterials, ZeroDimension { axis: usize, }, InvalidSpacing { axis: usize, spacing_m: f64, }, TooManyVoxels { dims: [usize; 3], }, CellCountMismatch { expected: usize, actual: usize, }, MaterialIndexOutOfRange { cell: usize, index: u32, n_materials: usize, }, NoSolids, SolidMaterialOutOfRange { solid: usize, index: u32, n_materials: usize, }, MeshParse { format: &'static str, line: usize, message: String, }, MeshInvalidScale { unit_m: f64, }, MeshEmpty, MeshNonFinite { triangle: usize, }, MeshDegenerateTriangle { triangle: usize, vertices: [[f64; 3]; 3], }, MeshEdgeNotShared { edge: [[f64; 3]; 2], }, MeshInconsistentOrientation { edge: [[f64; 3]; 2], }, MeshNotOutward { volume_m3: f64, }, CsgInvalid { solid: usize, reason: &'static str, }, CsgUnbounded { solid: usize, },
}
Expand description

Errors from building a Stack, a VoxelGrid, a MeshGeometry or a CsgGeometry.

Variants§

§

Empty

No layers and no substrate.

§

InvalidThickness

A layer thickness was zero, negative or not finite.

Fields

§index: usize

Layer index (0 = front).

§thickness_m: f64

Offending value.

§

NoMaterials

A voxel grid needs at least one material.

§

ZeroDimension

A voxel grid dimension was zero.

Fields

§axis: usize

Axis (0 = x, 1 = y, 2 = z).

§

InvalidSpacing

A voxel spacing was zero, negative, not finite, or so large that the grid extent overflows.

Fields

§axis: usize

Axis (0 = x, 1 = y, 2 = z).

§spacing_m: f64

Offending value.

§

TooManyVoxels

The number of voxels does not fit in usize.

Fields

§dims: [usize; 3]

Requested dimensions.

§

CellCountMismatch

The material-index array does not have one entry per voxel.

Fields

§expected: usize

nx ny nz.

§actual: usize

Length supplied.

§

MaterialIndexOutOfRange

A voxel names a material that does not exist.

Fields

§cell: usize

Flat voxel index.

§index: u32

Offending material index.

§n_materials: usize

Number of materials supplied.

§

NoSolids

A mesh or CSG geometry needs at least one solid.

§

SolidMaterialOutOfRange

A solid names a material that does not exist.

Fields

§solid: usize

Solid index (listing order).

§index: u32

Offending material index.

§n_materials: usize

Number of materials supplied.

§

MeshParse

A mesh file could not be parsed. line is 1-based (0 for a binary file).

Fields

§format: &'static str

"STL" or "OBJ".

§line: usize

Line number, or 0 when not applicable.

§message: String

What was wrong.

§

MeshInvalidScale

The file-unit scale of a mesh loader was not finite and positive.

Fields

§unit_m: f64

Offending value.

§

MeshEmpty

A mesh has no triangles.

§

MeshNonFinite

A mesh vertex coordinate is NaN or infinite.

Fields

§triangle: usize

Triangle index (file order).

§

MeshDegenerateTriangle

A triangle has zero (or negligible) area.

Fields

§triangle: usize

Triangle index (file order).

§vertices: [[f64; 3]; 3]

Its three vertex positions, m.

§

MeshEdgeNotShared

An edge belongs to only one triangle: the mesh is not watertight.

Fields

§edge: [[f64; 3]; 2]

The two vertex positions, m.

§

MeshInconsistentOrientation

Two triangles traverse an edge in the same direction (inconsistent orientation, or more than two triangles on the edge).

Fields

§edge: [[f64; 3]; 2]

The two vertex positions, m.

§

MeshNotOutward

The signed volume is not positive: the normals point inward.

Fields

§volume_m3: f64

The signed volume, m^3.

§

CsgInvalid

A CSG solid has an invalid primitive (non-finite or non-positive size, zero axis or normal), an empty union or intersection, or an empty bounding box.

Fields

§solid: usize

Solid index (listing order).

§reason: &'static str

What was wrong.

§

CsgUnbounded

A top-level CSG solid is unbounded (a half-space not bounded by the combination it is in; see the csg module docs).

Fields

§solid: usize

Solid index (listing order).

Trait Implementations§

Source§

impl Clone for GeometryError

Source§

fn clone(&self) -> GeometryError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GeometryError

Source§

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

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

impl Display for GeometryError

Source§

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

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

impl Error for GeometryError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<GeometryError> for DynamicError

Source§

fn from(source: GeometryError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GeometryError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GeometryError

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V