calcs/concrete-beam
Repository files (latest commit first)
Filename Latest commit message Latest commit date
smillmorel aa790c1be5 Normalize spacing before units across all calc sheets
Plain units already get a gap from the source whitespace, so drop the
leading space inside the string; keep it only on superscripted units
(in^2, in^3, in^4, ft^2). Also fix the generated concrete-beam figure
labels. Regenerate all affected PDFs.
2026-09-21 20:38:04 -04:00
..
assets Normalize spacing before units across all calc sheets 2026-09-21 20:38:04 -04:00
beam_section.py Normalize spacing before units across all calc sheets 2026-09-21 20:38:04 -04:00
calc.py Refine beam section figure and derive As from bars 2026-09-21 19:16:57 -04:00
concrete-beam.pdf Normalize spacing before units across all calc sheets 2026-09-21 20:38:04 -04:00
concrete-beam.typ Normalize spacing before units across all calc sheets 2026-09-21 20:38:04 -04:00
input.yaml Tidy concrete-beam sheet formulas and express h in feet 2026-09-21 20:11:51 -04:00
README.md Update concrete-beam example, section placement, and README 2026-09-21 19:35:38 -04:00
results.json Update concrete-beam example, section placement, and README 2026-09-21 19:35:38 -04:00
test_concrete_beam.py Refine beam section figure and derive As from bars 2026-09-21 19:16:57 -04:00

Concrete Beam

Simple-span rectangular reinforced concrete beam, checked per ACI 318 for flexure, minimum steel, and concrete shear under a uniform gravity load (1.2D + 1.6L).

Files

  • input.yaml — geometry, loads, materials, and reinforcement; units are carried in the values.
  • calc.py — computes the demands and capacities, writes results.json, and regenerates the cross-section figure.
  • beam_section.py — renders the cross-section as native Typst (assets/beam-section.typ), drawn to a fixed schematic cover.
  • test_concrete_beam.py — pytest checks of the demands, flexure, minimum steel, shear, reinforcement geometry, and the generated figure.
  • concrete-beam.typ — report; compiles to concrete-beam.pdf.

As is derived from the provided bars (n_bars, bar_size).

Usage

Edit input.yaml, then:

python3 calc.py                  # writes results.json and assets/beam-section.typ
python3 -m pytest                # checks the calculation and the generated figure
typst compile concrete-beam.typ  # builds concrete-beam.pdf

calc.py must be run before compiling so the figure matches the current inputs; the tests fail if assets/beam-section.typ is stale.

Requirements

Python 3 with pyyaml, pint, pytest; Typst.