Spaces:
Sleeping
Sleeping
File size: 6,184 Bytes
51982d6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | # Structure Compliance Check
A Gradio web application and set of standalone Python tools for checking BIM/IFC models against structural and regulatory standards (Spanish Metropolitan Building Ordinances, EHE, DB SE-AE, CTE DB HE).
---
## Quick Start
### 1. Install dependencies
```bash
pip install ifcopenshell numpy gradio python-dotenv
```
### 2. Run the Gradio app
```bash
py reinforcement_check/app.py
```
Open the URL printed in the terminal (e.g. `http://127.0.0.1:7860`), upload an `.ifc` file, and click **Foundation Compliance Check**.
### 3. Run a single checker from the terminal
All checkers in `tools/` are standalone scripts. Run from the **project root**:
```bash
py tools/checker_foundation.py data/01_Duplex_Apartment.ifc
py tools/checker_beams.py data/01_Duplex_Apartment.ifc
py tools/checker_columns.py data/01_Duplex_Apartment.ifc
py tools/checker_slabs.py data/01_Duplex_Apartment.ifc
py tools/checker_walls.py data/01_Duplex_Apartment.ifc
```
---
## Project Structure
```
structure_compliance_check/
β
βββ reinforcement_check/ β Gradio web application
β βββ app.py β Main entry point β run this
β βββ requirements.txt β Python dependencies
β βββ src/
β βββ ifc_analyzer.py β IFC property analysis
β βββ report_generator.py β HTML/text report builder
β
βββ tools/ β Standalone compliance checkers
β βββ checker_foundation.py β Foundation checks (Art. 69, Art. 128, DB SE-AE)
β βββ checker_beams.py β Beam section checks (EHE / DB SE)
β βββ checker_columns.py β Column dimension check (EHE)
β βββ checker_slabs.py β Slab thickness check (EHE / DB SE)
β βββ checker_walls.py β Wall thickness + U-value checks (DB SE-F, CTE DB HE)
β βββ checker_reinforcement.py β Reinforcement checks
β βββ checker_accessibility.py β Accessibility checks (DB SUA)
β
βββ data/ β Sample IFC files for testing
β βββ 01_Duplex_Apartment.ifc
β βββ Ifc4_SampleHouse.ifc
β βββ ...
β
βββ beam_check/ β Legacy source module (beams/columns)
βββ walls_check/ β Legacy source module (walls)
βββ reinforcement_check/src/ β Legacy source module (slabs/foundations)
```
---
## Gradio App β Foundation Compliance
The app has two tabs:
| Tab | What it does |
|-----|-------------|
| **Foundation Compliance** | Runs 4 automated regulatory checks against uploaded IFC |
| **Analyze Properties** | Extracts raw properties (thickness, area, materials, loads) from IFC |
### Foundation Compliance checks
| Check | Regulation | Requirement |
|-------|-----------|------------|
| Slab Thickness | Art. 69 | β₯ 300 mm (150 mm concrete + 150 mm drainage) |
| Foundation Dimensions | Load Check | Footing area β₯ required area (load / bearing capacity) |
| Bearing Beam Section | DB SE-AE | Width Γ Depth β₯ 300 Γ 300 mm |
| Floor Capacity | Art. 128 | Shows max floors and how many can be added |
### Result badges
| Badge | Meaning |
|-------|---------|
| `PASS` | Element meets the requirement |
| `FAIL` | Element does not meet the requirement |
| `WARN` | Marginal β review recommended |
| `BLOCKED` | Data needed for the check is missing from the IFC model |
---
## CLI Checkers β All Tools
Each file in `tools/` is a self-contained script. Run any of them directly:
```bash
py tools/<checker_name>.py <path_to_ifc_file>
```
### checker_foundation.py
Checks foundation elements against Spanish Building Ordinances.
| Function | Regulation | Checks |
|----------|-----------|--------|
| `check_foundation_slab_thickness` | Art. 69 | IfcFooting + on-grade IfcSlab β₯ 300 mm |
| `check_foundation_dimensions` | Load Check | Footing LΓW vs required area from bearing capacity |
| `check_bearing_beam_section` | DB SE-AE | Bearing beam β₯ 300Γ300 mm at lowest storey |
| `check_floor_capacity` | Art. 128 | Max floors = bearing / floor load; addable floors |
### checker_beams.py
| Function | Regulation | Minimum |
|----------|-----------|---------|
| `check_beam_depth` | EHE / DB SE | β₯ 200 mm |
| `check_beam_width` | EHE / DB SE | β₯ 150 mm |
### checker_columns.py
| Function | Regulation | Minimum |
|----------|-----------|---------|
| `check_column_min_dimension` | EHE | β₯ 250 mm (smallest side) |
### checker_slabs.py
| Function | Regulation | Range |
|----------|-----------|-------|
| `check_slab_thickness` | EHE / DB SE | 100 β 200 mm |
### checker_walls.py
| Function | Regulation | Requirement |
|----------|-----------|------------|
| `check_wall_thickness` | DB SE-F / EHE | β₯ 100 mm |
| `check_wall_uvalue` | CTE DB HE | β€ 0.80 W/(mΒ²Β·K) |
| `check_wall_external_uvalue` | CTE DB HE | U-value must be defined for external walls |
---
## IFC Dimension Extraction
Checkers look for dimensions in this priority order:
1. **Quantity sets** β `Qto_FootingBaseQuantities`, `Qto_BeamBaseQuantities`, etc.
2. **Geometry** β `IfcExtrudedAreaSolid β IfcRectangleProfileDef`
3. **Property sets** β `Pset_WallCommon`, `PSet_Revit_Type_Dimensions`, etc.
4. **Element name** β parses patterns like `"900 x 300"` or `"150mm Slab on Grade"` (Revit naming convention)
5. **Material layers** β sums `IfcMaterialLayerSet` thicknesses
If none of these yield a value, the result is `BLOCKED` with a description of what was searched.
---
## Sample IFC Files
| File | Description |
|------|-------------|
| `01_Duplex_Apartment.ifc` | Residential duplex β footings, slabs, walls |
| `Ifc4_SampleHouse.ifc` | IFC4 sample house |
| `Ifc4_SampleHouse_1_Roof.ifc` | Roof-only subset |
| `Ifc4_SampleHouse_IfcWallStandardCase.ifc` | Wall-heavy model |
| `Ifc4_Revit_ARC_FireRatingAdded.ifc` | Revit export with fire ratings |
---
## Requirements
```
ifcopenshell>=0.8.4
numpy
gradio>=4.20
python-dotenv>=1.0.0
```
Install with:
```bash
pip install ifcopenshell numpy gradio python-dotenv
``` |