Skip to main content

FaceProfile

Enum FaceProfile 

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

Fields

§peak_offset: f64
§

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.

Fields

§top_width: f64
§offset_x: f64
§

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

Source

pub fn is_rectangle(&self) -> bool

Returns true if the profile is the default Rectangle shape.

Source

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

Source§

fn clone(&self) -> FaceProfile

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 Debug for FaceProfile

Source§

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

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

impl<'de> Deserialize<'de> for FaceProfile

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 PartialEq for FaceProfile

Source§

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

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 FaceProfile

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V