| Crates.io | structural-shapes |
| lib.rs | structural-shapes |
| version | 0.2.3 |
| created_at | 2021-02-04 13:16:25.843445+00 |
| updated_at | 2023-02-18 22:53:21.51647+00 |
| description | Common structural shapes |
| homepage | https://github.com/cmccomb/structural-shapes |
| repository | https://github.com/cmccomb/structural-shapes |
| max_upload_size | |
| id | 350503 |
| size | 26,776 |
This package provides utilities for a variety of different structural shapes. Currently, the following are included:
Here are some basic examples of usage
use structural_shapes::StructuralShape;
let x = StructuralShape::new_rod(1.0).with_cog(0.0, 1.0);
println!("cross sectional area: {:?}", x.area().value);
println!("area moment of inertia: {:?}", x.moi_x().value);
println!("polar moment of inertia: {:?}", x.polar_moi().value);
You can also create composite shapes that are composed of more than one primitive:
use structural_shapes::{CompositeShape, StructuralShape};
let x = CompositeShape::new()
.add(StructuralShape::new_rod(2.0).with_cog(2.0, 0.0))
.add(StructuralShape::new_rod(2.0).with_cog(-2.0, 0.0));
println!("cross sectional area: {:?}", x.area().value);
println!("area moment of inertia: {:?}", x.moi_x().value);
println!("polar moment of inertia: {:?}", x.polar_moi().value);