Enum structural_shapes::StructuralShape[][src]

#[non_exhaustive]pub enum StructuralShape {
    Pipe {
        outer_radius: f64,
        thickness: f64,
    },
    IBeam {
        width: f64,
        height: f64,
        web_thickness: f64,
        flange_thickness: f64,
    },
    BoxBeam {
        width: f64,
        height: f64,
        thickness: f64,
    },
    Rod {
        radius: f64,
    },
    Rectangle {
        width: f64,
        height: f64,
    },
}

This enum contains different structural shapes

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Pipe

This is a pipe with an outer_radius and a thickness

Fields of Pipe

outer_radius: f64

Outer radius of hte pipe

thickness: f64

Thickness of the pipe wall

IBeam

This is an I-Beam, with a width, height, web thickness, and flange thickness

Fields of IBeam

width: f64

Width of the beam

height: f64

Height of the beam

web_thickness: f64

Thickness of the web

flange_thickness: f64

Thickness of the flange

BoxBeam

This is a box beam with a width, height, and thickness

Fields of BoxBeam

width: f64

Width of the box beam

height: f64

Height of the box beam

thickness: f64

Thickness of the wall

Rod

This is a rod with a radius only

Fields of Rod

radius: f64

Radius of the road

Rectangle

This is a solid rectangular with width and height

Fields of Rectangle

width: f64

Width of the rectangle

height: f64

Height of the rectangle

Implementations

impl StructuralShape[src]

pub fn moi_x(&self) -> f64[src]

This function returns the moment of inertia of the structural shape around the x-axis

use structural_shapes::StructuralShape;
let shape = StructuralShape::Rod{radius: 2.0};
let area = shape.moi_x();

pub fn moi_y(&self) -> f64[src]

This function returns the moment of inertia of hte structural shape around the y-axis

use structural_shapes::StructuralShape;
let shape = StructuralShape::Rod{radius: 2.0};
let area = shape.moi_y();

pub fn area(&self) -> f64[src]

This function returns the cross-sectional area of the structural shape

use structural_shapes::StructuralShape;
let shape = StructuralShape::Rod{radius: 2.0};
let area = shape.area();

pub fn moi_x_d(&self, d: f64) -> f64[src]

This function returns the moment of intertia of the structural shape around the x-axis when displaced perpendicular to the axis by a distance d

use structural_shapes::StructuralShape;
let shape = StructuralShape::Rod{radius: 2.0};
let area = shape.moi_x_d(2.0);

pub fn moi_y_d(&self, d: f64) -> f64[src]

This function returns the moment of intertia of the structural shape around the y-axis when displaced perpendicular to the axis by a distance d

use structural_shapes::StructuralShape;
let shape = StructuralShape::Rod{radius: 2.0};
let area = shape.moi_y_d(2.0);

Trait Implementations

impl Clone for StructuralShape[src]

impl Copy for StructuralShape[src]

impl Debug for StructuralShape[src]

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.