pub enum FaceProfile {
Rectangle,
Taper(f64),
Triangle {
peak_offset: f64,
},
Trapezoid {
top_width: f64,
offset_x: f64,
},
Polygon(Vec<DVec2>),
}Expand description
The 2D profile shape of a terminal face, used by renderers to construct geometry.
Replaces the old taper: f64 field. Each variant describes the cross-sectional
outline of the face panel within the scope’s local XY plane:
- X runs from 0 (left edge) to
scope.size.x(right edge). - Y runs from 0 (bottom edge) to
scope.size.y(top edge).
The renderer extrudes this 2D outline along the local Z axis by scope.size.z
(which is 0 for flat face panels produced by Roof and Comp(Faces)).
Coordinate convention for Trapezoid and Triangle: values are normalized
(0.0 = left/bottom, 1.0 = right/top) so they are independent of the actual scope size.
The renderer scales them by scope.size.x before vertex generation.
Variants§
Rectangle
Full rectangular face — the default for walls, floors, and generic volumes.
Taper(f64)
Legacy tapered prism, equivalent to the old taper field.
t ∈ [0, 1]: 0 = box, 1 = full pyramid. The renderer maps this
to the existing build_tapered_cuboid path for backward compatibility.
Triangle
Triangular face: base at Y = 0 (full scope width), apex at Y = scope.size.y.
peak_offset ∈ [0, 1]: horizontal offset of the apex from the left edge,
normalized to the scope width. 0.5 = symmetric triangle (standard gable).
0.3 = apex shifted left (asymmetric, used by Saltbox gable ends).
Trapezoid
Trapezoidal face: rectangular base at Y = 0, narrower top edge at Y = scope.size.y.
Both values are normalized to the scope width (scope.size.x = 1.0):
top_width∈[0, 1]: width of the top edge as a fraction of the base width.offset_x∈[0, 1]: left indent of the top edge from the scope left.
Invariant: offset_x + top_width ≤ 1.0.
A symmetric trapezoid has offset_x = (1 - top_width) / 2.
Polygon(Vec<DVec2>)
Arbitrary convex or concave polygon, produced by the straight skeleton algorithm for complex (L-shaped, T-shaped, etc.) building footprints.
Vertices are in the scope’s local XZ (floor) plane, measured in world units from the scope origin. The renderer triangulates this polygon and extrudes it along the local Y axis by the roof pitch height.
Implementations§
Source§impl FaceProfile
impl FaceProfile
Sourcepub fn is_rectangle(&self) -> bool
pub fn is_rectangle(&self) -> bool
Returns true if the profile is the default Rectangle shape.
Sourcepub fn taper_coeff(&self) -> Option<f64>
pub fn taper_coeff(&self) -> Option<f64>
Returns the legacy taper coefficient if this profile was set by ShapeOp::Taper.
Trait Implementations§
Source§impl Clone for FaceProfile
impl Clone for FaceProfile
Source§fn clone(&self) -> FaceProfile
fn clone(&self) -> FaceProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FaceProfile
impl Debug for FaceProfile
Source§impl<'de> Deserialize<'de> for FaceProfile
impl<'de> Deserialize<'de> for FaceProfile
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 FaceProfile
impl PartialEq for FaceProfile
Source§impl Serialize for FaceProfile
impl Serialize for FaceProfile
impl StructuralPartialEq for FaceProfile
Auto Trait Implementations§
impl Freeze for FaceProfile
impl RefUnwindSafe for FaceProfile
impl Send for FaceProfile
impl Sync for FaceProfile
impl Unpin for FaceProfile
impl UnsafeUnpin for FaceProfile
impl UnwindSafe for FaceProfile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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