Crate structural_shapes[−][src]
Expand description
About
This package provides utilities for a variety of different structural shapes. Currently, the following are included:
- Rods
- Rectangular bars
- Pipes
- Box Beams
- I-Beams
- Composite Shapes
Usage
Here are some basic examples of usage
use structural_shapes::{StructuralShape, length, point};
let x = StructuralShape::Rod{
radius: length(1.0),
center_of_gravity: point(0.0, 1.0)
};
println!("cross sectional area: {:?}", x.area().value);
println!("moment of inertia: {:?}", x.moi_x().value);
You can also create composite shapes that are composed of more than one primitive:
use structural_shapes::{CompositeShape, StructuralShape, point, length};
let mut x = CompositeShape::new()
.add(StructuralShape::Rod {
radius: length(2.0),
center_of_gravity: point(2.0, 0.0),
})
.add(StructuralShape::Rod {
radius: length(2.0),
center_of_gravity: point(-2.0, 0.0),
});
println!("cross sectional area: {:?}", x.area().value);
println!("moment of inertia: {:?}", x.moi_x().value);
Structs
A composite composed of multiple individual shapes
Enums
This enum contains different structural shapes