#[non_exhaustive]
pub enum StructuralShape {
Pipe {
outer_radius: Length,
thickness: Length,
center_of_gravity: (Length, Length),
},
IBeam {
width: Length,
height: Length,
web_thickness: Length,
flange_thickness: Length,
center_of_gravity: (Length, Length),
},
BoxBeam {
width: Length,
height: Length,
thickness: Length,
center_of_gravity: (Length, Length),
},
Rod {
radius: Length,
center_of_gravity: (Length, Length),
},
Rectangle {
width: Length,
height: Length,
center_of_gravity: (Length, Length),
},
}
Expand description
This enum contains different structural shapes
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pipe
Fields
This is a pipe with an outer_radius and a thickness
IBeam
Fields
This is an I-Beam, with a width, height, web thickness, and flange thickness
BoxBeam
Fields
This is a box beam with a width, height, and thickness
Rod
Fields
This is a rod with a radius only
Rectangle
Fields
This is a solid rectangular with width and height
Implementations§
source§impl StructuralShape
impl StructuralShape
sourcepub fn new_rod(radius: f64) -> StructuralShape
pub fn new_rod(radius: f64) -> StructuralShape
Make a new rod without COG
let shape = StructuralShape::new_rod(2.0);
sourcepub fn new_pipe(radius: f64, thickness: f64) -> StructuralShape
pub fn new_pipe(radius: f64, thickness: f64) -> StructuralShape
Make a new pipe without COG
let shape = StructuralShape::new_pipe(2.0, 0.15);
sourcepub fn new_rectangle(height: f64, width: f64) -> StructuralShape
pub fn new_rectangle(height: f64, width: f64) -> StructuralShape
Make a new rectangle without COG
let shape = StructuralShape::new_rectangle(2.0, 2.0);
sourcepub fn new_boxbeam(height: f64, width: f64, thickness: f64) -> StructuralShape
pub fn new_boxbeam(height: f64, width: f64, thickness: f64) -> StructuralShape
Make a new boxbeam without COG
let shape = StructuralShape::new_boxbeam(2.0, 2.0, 0.15);
sourcepub fn new_ibeam(
height: f64,
width: f64,
web_thickness: f64,
flange_thickness: f64
) -> StructuralShape
pub fn new_ibeam( height: f64, width: f64, web_thickness: f64, flange_thickness: f64 ) -> StructuralShape
Make a new Ibeam without COG
let shape = StructuralShape::new_ibeam(2.0, 2.0, 0.15, 0.15);
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 structural shape around the x-axis
let shape = StructuralShape::new_rod(2.0);
let moi = shape.moi_x();
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 hte structural shape around the y-axis
let shape = StructuralShape::new_rod(2.0);
let area = shape.moi_y();
sourcepub fn polar_moi(
&self
) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
pub fn polar_moi( &self ) -> Quantity<ISQ<P4, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f64>, f64>
This function returns the polar moment of inertia of the composite shape about the origin.
let shape = StructuralShape::new_rod(2.0);
let area = shape.polar_moi();
sourcepub fn area(&self) -> Area
pub fn area(&self) -> Area
This function returns the cross-sectional area of the structural shape
let shape = StructuralShape::new_rod(2.0);
let area = shape.area();
sourcepub fn with_cog(&mut self, x: f64, y: f64) -> StructuralShape
pub fn with_cog(&mut self, x: f64, y: f64) -> StructuralShape
A function to set the center of gravity of a shape
let shape = StructuralShape::new_rod(2.0).with_cog(0.0, 0.0);
let moi = shape.moi_x();
Trait Implementations§
source§impl Clone for StructuralShape
impl Clone for StructuralShape
source§fn clone(&self) -> StructuralShape
fn clone(&self) -> StructuralShape
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more