Skip to main content

RoofError

Enum RoofError 

Source
#[non_exhaustive]
pub enum RoofError { InvalidPitch { pitch: f32, }, UnwalkableFace { wall: EdgeId, }, InvalidBreak { break_offset: f32, }, UnevenLimits { node: NodeId, stopped_at: f32, reaches: f32, }, BreakSplitsPanel { wall: EdgeId, crossings: usize, }, HeightOverflow { node: NodeId, height: f32, }, }
Expand description

Why a roof could not be raised.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidPitch

The pitch was negative, NaN, or infinite.

Fields

§pitch: f32

The value supplied.

§

UnwalkableFace

A wall’s face could not be walked, so its panel has no outline.

Should not happen for a skeleton of a valid polygon, constrained or not.

Fields

§wall: EdgeId

The wall whose panel could not be outlined.

§

InvalidBreak

A Profile::Mansard’s break was negative, NaN, or infinite.

Fields

§break_offset: f32

The value supplied.

§

UnevenLimits

The skeleton’s edges stopped partway, at different distances, so there is no roof over it.

A roof’s height is a function of Node::offset, and that only works while offset means distance from the wall. On a plain skeleton it always does. On a skeleton_constrained it is really the wavefront’s time, which is the same thing only until something stops early: an edge that halted at 3 is 3 away from its face forever, however long the clock runs on.

What is allowed follows from that, and it is more than it first looks:

  • No limits, or limits that never bind. A plain hip roof.
  • One uniform limit. Every edge stops together, at the top, so nothing stops early and the roof is a hip truncated to a flat.
  • A limit of zero, mixed freely with either of the above. A wall that never moves sweeps nothing, so it has no sloping panel to be inconsistent about: its face is degenerate in plan, and stands up as a vertical gable. The neighbouring walls’ corners slide along it, so the ridge runs out to it. See PanelKind::Slope.

What is refused is an edge stopping at some distance in between, while others go further. That edge has a real sloping panel, and its far corners would sit at their offset’s height while being only limit from the wall — so the panel would want to end lower than its neighbour’s, and the surface between them would have to tear. There is no roof to return, so this says so rather than inventing one.

Fields

§node: NodeId

A node where an edge stopped before the rest of the roof did.

§stopped_at: f32

The offset it stopped at.

§reaches: f32

The offset the rest of the roof reaches.

§

BreakSplitsPanel

A Profile::Mansard’s break left a wall’s face in pieces that could not be closed back up into coherent panels.

The break is a straight line across a face, so it normally splits it into a lower piece and an upper one — and a face whose wavefront was split apart by two reflex vertices into several lower and upper pieces is handled too, each piece emitted as its own panel. This is the safety net for the geometry that is left: a face the break meets in a way that does not resolve into closed pieces, which should not arise for the face of a valid polygon. Refused rather than returned bent or self-touching.

Fields

§wall: EdgeId

The wall whose panel the break could not cleanly cut.

§crossings: usize

How many loose ends the break left on the face’s outline. An odd count is the tell — a closed outline must cross a line an even number of times.

§

HeightOverflow

A vertex would stand higher than i16 can hold.

The plan is too wide for this pitch. Lower the pitch, or scale the plan down. This is reported rather than saturated: a silently flattened ridge is a wrong roof, not an approximate one.

Fields

§node: NodeId

The offending node.

§height: f32

The height it wanted.

Trait Implementations§

Source§

impl Clone for RoofError

Source§

fn clone(&self) -> RoofError

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 Copy for RoofError

Source§

impl Debug for RoofError

Source§

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

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

impl Display for RoofError

Source§

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

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

impl Error for RoofError

Available on crate feature std only.
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 PartialEq for RoofError

Source§

fn eq(&self, other: &RoofError) -> 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 RoofError

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> 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.