pub struct RoofConfig {
pub roof_type: RoofType,
pub pitch: f64,
pub secondary_pitch: Option<f64>,
pub overhang: f64,
pub ridge_offset: f64,
pub fascia_depth: f64,
pub tier_height: Option<f64>,
}Expand description
Rich parametric configuration for the Roof operation.
All angular values are in degrees. Lengths are in world units. Optional fields default as described; see each field doc.
Fields§
§roof_type: RoofType§pitch: f64Primary pitch angle in degrees from horizontal. Must be in (0°, 90°).
secondary_pitch: Option<f64>Secondary pitch angle in degrees. Used by Gambrel (upper zone) and Mansard.
If None when required, defaults to pitch / 2.
overhang: f64Extra overhang beyond the scope footprint on each side. Default 0.0.
ridge_offset: f64Ridge offset for Saltbox: fraction [0, 1] of the scope depth (Z) where the
ridge is positioned from the front. Default 0.5 (symmetric / centred ridge).
fascia_depth: f64Thickness of the roof fascia edge in world units. Default 0.0 (flat panels).
tier_height: Option<f64>Normalised height at which the pitch break occurs for Gambrel, Mansard,
Jerkinhead, and DutchGable. 0.5 means the break is at half the eave-to-ridge
distance. None uses a type-specific default.
Implementations§
Source§impl RoofConfig
impl RoofConfig
Sourcepub fn new(roof_type: RoofType, pitch: f64) -> Self
pub fn new(roof_type: RoofType, pitch: f64) -> Self
Creates a minimal config for deterministic types (Pyramid, Shed, Gable, Hip, Flat, …).
Sourcepub fn secondary_pitch_or_default(&self) -> f64
pub fn secondary_pitch_or_default(&self) -> f64
Returns the secondary pitch, defaulting to pitch / 2 if unset.
Sourcepub fn tier_height_or(&self, default: f64) -> f64
pub fn tier_height_or(&self, default: f64) -> f64
Returns the tier height, defaulting to default if unset.
Trait Implementations§
Source§impl Clone for RoofConfig
impl Clone for RoofConfig
Source§fn clone(&self) -> RoofConfig
fn clone(&self) -> RoofConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RoofConfig
impl Debug for RoofConfig
Source§impl<'de> Deserialize<'de> for RoofConfig
impl<'de> Deserialize<'de> for RoofConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RoofConfig
impl PartialEq for RoofConfig
Source§impl Serialize for RoofConfig
impl Serialize for RoofConfig
impl StructuralPartialEq for RoofConfig
Auto Trait Implementations§
impl Freeze for RoofConfig
impl RefUnwindSafe for RoofConfig
impl Send for RoofConfig
impl Sync for RoofConfig
impl Unpin for RoofConfig
impl UnsafeUnpin for RoofConfig
impl UnwindSafe for RoofConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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