#[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
InvalidPitch
The pitch was negative, NaN, or infinite.
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.
InvalidBreak
A Profile::Mansard’s break was negative, NaN, or infinite.
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
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
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.
Trait Implementations§
impl Copy for RoofError
Source§impl Error for RoofError
Available on crate feature std only.
impl Error for RoofError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()