pub struct CompositeShape {
pub shapes: Vec<(i8, StructuralShape)>,
}Expand description
A composite composed of multiple individual shapes
let x = CompositeShape::new()
.add(StructuralShape::new_rod(2.0).with_cog(2.0, 0.0))
.add(StructuralShape::new_rod(2.0).with_cog(-2.0, 0.0));Fields§
§shapes: Vec<(i8, StructuralShape)>Constituent shapes
Implementations§
Source§impl CompositeShape
impl CompositeShape
Sourcepub fn add(&mut self, new_shape: StructuralShape) -> Self
pub fn add(&mut self, new_shape: StructuralShape) -> Self
This function adds a new shape to the composite
Sourcepub fn sub(&mut self, new_shape: StructuralShape) -> Self
pub fn sub(&mut self, new_shape: StructuralShape) -> Self
This function subtracts a new shape to the composite
Sourcepub fn calculate_cog(&self) -> (Length, Length)
pub fn calculate_cog(&self) -> (Length, Length)
Calculate center of gravity and update COG of members
Sourcepub fn update_cog(&mut self)
pub fn update_cog(&mut self)
Shift structure to have cog at (0.0,0.0)
Sourcepub fn moi_x(&self) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
pub fn moi_x(&self) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
This function returns the moment of inertia of the composite shape around the x-axis
Sourcepub fn moi_y(&self) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
pub fn moi_y(&self) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
This function returns the moment of inertia of the composite shape around the y-axis
Trait Implementations§
Source§impl Clone for CompositeShape
impl Clone for CompositeShape
Source§fn clone(&self) -> CompositeShape
fn clone(&self) -> CompositeShape
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 moreSource§impl Debug for CompositeShape
impl Debug for CompositeShape
Auto Trait Implementations§
impl Freeze for CompositeShape
impl RefUnwindSafe for CompositeShape
impl Send for CompositeShape
impl Sync for CompositeShape
impl Unpin for CompositeShape
impl UnwindSafe for CompositeShape
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