pub struct LinearExtrusion {
pub profile: Vec<[f64; 2]>,
pub sweep_vec: [f64; 3],
}Expand description
A shape extruded linearly along a vector — a prism swept volume.
The base polygon is defined in the XY plane and the extrusion direction
is given by sweep_vec.
Fields§
§profile: Vec<[f64; 2]>2-D profile points (X, Y components).
sweep_vec: [f64; 3]Extrusion vector in 3-D space.
Implementations§
Source§impl LinearExtrusion
impl LinearExtrusion
Sourcepub fn profile_area(&self) -> f64
pub fn profile_area(&self) -> f64
Area of the 2-D profile using the shoelace formula.
Sourcepub fn profile_perimeter(&self) -> f64
pub fn profile_perimeter(&self) -> f64
Perimeter of the 2-D profile.
Sourcepub fn surface_area(&self) -> f64
pub fn surface_area(&self) -> f64
Surface area of the extruded prism.
= 2 * profile_area + perimeter * extrusion_length
Trait Implementations§
Source§impl Clone for LinearExtrusion
impl Clone for LinearExtrusion
Source§fn clone(&self) -> LinearExtrusion
fn clone(&self) -> LinearExtrusion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LinearExtrusion
impl RefUnwindSafe for LinearExtrusion
impl Send for LinearExtrusion
impl Sync for LinearExtrusion
impl Unpin for LinearExtrusion
impl UnsafeUnpin for LinearExtrusion
impl UnwindSafe for LinearExtrusion
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.