pub enum GenusError {
NotClosedManifold {
boundary: usize,
non_manifold: usize,
},
NotOrientable {
characteristic: i64,
},
MultipleComponents {
components: usize,
characteristic: i64,
},
}Expand description
Why a genus could not be computed.
Variants§
NotClosedManifold
The mesh is not a closed two-manifold, so Euler’s formula does not apply.
Fields
NotOrientable
The Euler characteristic was odd, so no integer genus exists.
MultipleComponents
The mesh has several components, so a single genus does not describe it.
chi = 2c - 2g still holds for the whole surface, but the resulting
g is a total across components and is negative whenever c > g + 1
– a cube with eight spherical cavities has c = 9, chi = 18 and a
total genus of -8. Reporting that as a u32 is impossible, and
reporting 0 would be indistinguishable from a genuine sphere, so
this refuses and hands back what it measured.
Trait Implementations§
Source§impl Clone for GenusError
impl Clone for GenusError
Source§fn clone(&self) -> GenusError
fn clone(&self) -> GenusError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenusError
impl Debug for GenusError
Source§impl Display for GenusError
impl Display for GenusError
Source§impl Error for GenusError
impl Error for GenusError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for GenusError
impl PartialEq for GenusError
impl Eq for GenusError
impl StructuralPartialEq for GenusError
Auto Trait Implementations§
impl Freeze for GenusError
impl RefUnwindSafe for GenusError
impl Send for GenusError
impl Sync for GenusError
impl Unpin for GenusError
impl UnwindSafe for GenusError
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
Mutably borrows from an owned value. Read more