Struct structural_shapes::CompositeShape[][src]

pub struct CompositeShape {
    pub shapes: Vec<(i8, StructuralShape)>,
}

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]

impl Debug for CompositeShape[src]

impl Default for CompositeShape[src]

Implement default

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.