structural-shapes

Crates.iostructural-shapes
lib.rsstructural-shapes
version0.2.3
sourcesrc
created_at2021-02-04 13:16:25.843445
updated_at2023-02-18 22:53:21.51647
descriptionCommon structural shapes
homepagehttps://github.com/cmccomb/structural-shapes
repositoryhttps://github.com/cmccomb/structural-shapes
max_upload_size
id350503
size26,776
Chris McComb (cmccomb)

documentation

https://docs.rs/structural-shapes

README

build Crates.io docs.rs

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;
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);
Commit count: 23

cargo fmt