#[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
This is a pipe with an outer_radius and a thickness
Fields
IBeam
This is an I-Beam, with a width, height, web thickness, and flange thickness
Fields
BoxBeam
This is a box beam with a width, height, and thickness
Fields
Rod
This is a rod with a radius only
Fields
Rectangle
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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more