Skip to main content

section_properties/
lib.rs

1//! # section-properties
2//!
3//! Rust crate for structural cross-section analysis: geometric properties,
4//! plastic classification, warping/torsion constants, stress analysis,
5//! and section-level FEM.
6//!
7//! For 2D beam/frame structural analysis, see the `structural-analysis` crate.
8//!
9//! # Quick start — section properties
10//!
11//! ```rust
12//! use section_properties::{Point, Polygon, Section, SectionProperties};
13//!
14//! // Build a rectangle 10 × 5
15//! let outer = Polygon::new(vec![
16//!     Point::new(0.0, 0.0),
17//!     Point::new(10.0, 0.0),
18//!     Point::new(10.0, 5.0),
19//!     Point::new(0.0, 5.0),
20//! ]);
21//! let section = Section::new(outer, Vec::new());
22//! let props = SectionProperties::from_section(&section);
23//!
24//! assert!((props.area - 50.0).abs() < 1e-10);
25//! assert!((props.centroid.x - 5.0).abs() < 1e-10);
26//! assert!((props.centroid.y - 2.5).abs() < 1e-10);
27//! ```
28//!
29//! # Module overview
30//!
31//! | Module                  | Purpose                                              |
32//! |-------------------------|------------------------------------------------------|
33//! | [`geometry`]            | Polygons, boolean ops, compound geometry             |
34//! | [`section`]             | Section (outer + holes), frame properties            |
35//! | [`section_properties`]  | Area, moments, principal axes, section moduli        |
36//! | [`composite`]           | Multi-material elastic transformed-section analysis  |
37//! | [`fea`]                 | FEM core: elements, solvers, numerical infrastructure|
38//! | [`plastic`]             | Plastic section analysis, warping, classification    |
39//! | [`material`]            | Isotropic linear-elastic material                    |
40//! | [`stress`]              | Cross-section stress analysis                        |
41//! | [`section_library`]     | Standard section shapes (I, channel, tube, …)        |
42//!
43//! # Error handling conventions
44//!
45//! * **Fallible constructors** use `try_new` / `new_validated` returning
46//!   `Result<Self, E>`.
47//! * **Fallible computations** use `try_*` returning `Result<T, E>` or
48//!   `Option<T>`.
49//! * **Panicking APIs** delegate to the `try_*` variant and `expect()` —
50//!   they document the panic condition in a `# Panics` section.
51
52pub mod cold_formed_analysis;
53pub mod composite;
54pub mod database;
55pub mod fea;
56pub mod fire;
57pub mod geometry;
58pub mod io;
59pub mod material;
60pub mod mesh;
61pub mod plastic;
62pub mod post;
63pub mod section;
64pub mod section_library;
65pub mod section_properties;
66pub mod stress;
67pub mod stress_fem;
68
69pub use crate::cold_formed_analysis::{
70    BucklingCurve, ColdFormedElement, ColdFormedSection, EdgeSupport, EffectiveSectionProperties,
71    EffectiveWidthParams, ElementReduction, Stiffener, StiffenerType,
72};
73pub use crate::database::{
74    SearchFilter, SearchResult, SectionDatabase, SectionEntry, build_standard_database,
75};
76pub use crate::fire::{
77    FireAnalysis, FireExposure, FireProtection, FireResistanceResult, MaterialPropertiesAtTemp,
78    ProtectionType, SectionFactor, TemperatureProfile, composite as fire_composite,
79};
80pub use crate::geometry::{
81    Axis, BoundaryExtrema, CompoundError, CompoundGeometry, Geometry, JoinStyle, Point, Polygon,
82    Transform,
83};
84pub use crate::io::{
85    CsvExportOptions, DxfColor, DxfExportOptions, ExportFormat, JsonMaterial, JsonSection,
86    SectionExporter, SectionImporter, SvgExportOptions, export_section_library, from_csv,
87    from_json, plot_centroids, section_from_composite, section_from_parametric, to_csv, to_dxf,
88    to_json, to_nastran, to_svg, to_vtk,
89};
90
91pub use crate::composite::{
92    ComponentAnalysis, CompositeAnalysisResult, CompositeComponent, CompositeError,
93    ElasticComposite,
94};
95pub use crate::fea::{
96    FemError, solver, solver::SelectionReason, solver::SolverCapabilities, solver::SolverError,
97    solver::SolverRegistry, solver::SolverSelection,
98};
99/// Alias for the interactive HTML viewer export.
100pub use crate::io::to_interactive_html as to_html;
101pub use crate::material::Material;
102pub use crate::mesh::{
103    FemCompositeAnalysis, FemGeometricProperties, FemSectionAnalysis, FemWarpingProperties, Mesh,
104    MeshParams, PropertyComparison, StressPlotData, StressPost,
105};
106pub use crate::plastic::warping_fem::warping_svg;
107pub use crate::plastic::{
108    CapacityCheck, ClassLimit, InteractionDiagram, InteractionPoint, LoadCase3D, PlasticAnalysis,
109    PlasticProperties, PlasticSection, SectionClass, SectionClassification, StressDistribution,
110    TorsionAnalysis, WarpingProperties, aisc360, classify_section, effective, en1993,
111};
112pub use crate::section::{FrameProperties, MaterialError, Section, TransformedFrameProperties};
113pub use crate::section_library::{CompositeSection, ParametricSection};
114pub use crate::section_properties::{
115    GeometricProperties, GyrationProperties, PrincipalProperties, SectionProperties,
116};
117pub use crate::stress::{
118    SectionLoads, StressAnalysis, StressAnalysisResult, StressAtPoint, YieldCheckResult,
119};