Struct structural_shapes::CompositeShape [−][src]
A composite composed of multiple individual shapes
let x = CompositeShape::new() .add(StructuralShape::Rod { radius: 2.0, center_of_gravity: (2.0, 0.0) }) .add(StructuralShape::Rod { radius: 2.0, center_of_gravity: (-2.0, 0.0) });
Fields
shapes: Vec<(i8, StructuralShape)>Constituent shapes
Implementations
impl CompositeShape[src]
pub fn new() -> Self[src]
This creates a new composite shape, identical to default
pub fn add(&mut self, new_shape: StructuralShape) -> Self[src]
This function adds a new shape to the composite
pub fn sub(&mut self, new_shape: StructuralShape) -> Self[src]
This function subtracts a new shape to the composite
pub fn calculate_cog(&self) -> (f64, f64)[src]
Calculate center of gravity and update COG of members
pub fn update_cog(&mut self)[src]
Shift structure to have cog at (0.0,0.0)
pub fn moi_x(&self) -> f64[src]
This function returns the moment of inertia of the composite shape around the x-axis
pub fn moi_y(&self) -> f64[src]
This function returns the moment of inertia of the composite shape around the y-axis
pub fn area(&self) -> f64[src]
This function returns the area of the composite shape
Trait Implementations
impl Clone for CompositeShape[src]
fn clone(&self) -> CompositeShape[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for CompositeShape[src]
impl Default for CompositeShape[src]
Implement default
Auto Trait Implementations
impl RefUnwindSafe for CompositeShape
impl Send for CompositeShape
impl Sync for CompositeShape
impl Unpin for CompositeShape
impl UnwindSafe for CompositeShape
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,