Skip to main content

PanelKind

Enum PanelKind 

Source
pub enum PanelKind {
    Slope {
        wall: EdgeId,
        band: u8,
    },
    Flat,
}
Expand description

What part of a roof a Panel is.

Variants§

§

Slope

A panel rising from one wall.

§Gables

Usually sloping, but not always. A wall given a limit of zero never moves, so it sweeps no plan area at all, and its face is degenerate — every corner sits on the wall’s own line. Stood up at z = height_at(offset) that degenerate face becomes a vertical triangle: a gable. The neighbouring walls’ corners slide along the frozen wall rather than over it, so the ridge runs out to it instead of hipping away.

It is the same panel with the same rule applied, so it gets no special variant. A consumer that wants to tell the two apart can: a gable’s footprint has zero area, and nothing else’s does. The roof example names its OBJ groups that way.

Fields

§wall: EdgeId

The wall it rises from.

This is the traceability a straight skeleton gives for free: no search, no nearest-neighbour query. The panel is the region that wall’s wavefront swept.

§band: u8

Which band of the Profile it belongs to, counting from the eaves. A Profile::Hip only ever has band 0; a Profile::Mansard has band 0 below the break and band 1 above.

§

Flat

The flat a truncated roof stops at, standing over the skeleton’s residual.

One of these per residual loop, wound like the input’s rings: counter-clockwise for a flat’s outline, clockwise for a hole in one. So a flat with a hole in it — a courtyard’s, say — is two Flat panels, and the winding is what says which is which.

That is deliberately the raw material rather than a finished mesh. A consumer that cannot express holes has to triangulate, and how is its own business: the crate hands over the loops and their winding, which is the part only it knows. The roof example shows one way, in about thirty lines.

Trait Implementations§

Source§

impl Clone for PanelKind

Source§

fn clone(&self) -> PanelKind

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 PanelKind

Source§

impl Debug for PanelKind

Source§

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

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

impl<'de> Deserialize<'de> for PanelKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for PanelKind

Source§

impl Hash for PanelKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PanelKind

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for PanelKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PanelKind

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.