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
```