exterior-shell 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- exterior_shell-1.2.0/.gitignore +14 -0
- exterior_shell-1.2.0/LICENSE +21 -0
- exterior_shell-1.2.0/PKG-INFO +207 -0
- exterior_shell-1.2.0/PRD.md +511 -0
- exterior_shell-1.2.0/README.md +175 -0
- exterior_shell-1.2.0/_gen_screenshot.py +25 -0
- exterior_shell-1.2.0/_take_screenshot.py +23 -0
- exterior_shell-1.2.0/exterior_shell/__init__.py +3 -0
- exterior_shell-1.2.0/exterior_shell/ai/__init__.py +1 -0
- exterior_shell-1.2.0/exterior_shell/cli.py +387 -0
- exterior_shell-1.2.0/exterior_shell/core/__init__.py +1 -0
- exterior_shell-1.2.0/exterior_shell/core/assembler.py +137 -0
- exterior_shell-1.2.0/exterior_shell/core/classifier.py +210 -0
- exterior_shell-1.2.0/exterior_shell/core/models.py +190 -0
- exterior_shell-1.2.0/exterior_shell/core/parser.py +211 -0
- exterior_shell-1.2.0/exterior_shell/export/__init__.py +1 -0
- exterior_shell-1.2.0/exterior_shell/export/footprint.py +190 -0
- exterior_shell-1.2.0/exterior_shell/export/stripped_ifc.py +218 -0
- exterior_shell-1.2.0/exterior_shell/utils/__init__.py +1 -0
- exterior_shell-1.2.0/linkedin-diagram.html +422 -0
- exterior_shell-1.2.0/linkedin-diagram.png +0 -0
- exterior_shell-1.2.0/linkedin-diagram_gemini.png +0 -0
- exterior_shell-1.2.0/pyproject.toml +56 -0
- exterior_shell-1.2.0/tests/fixtures/check_header.py +59 -0
- exterior_shell-1.2.0/tests/fixtures/test_bigger_building.ifc +147722 -0
- exterior_shell-1.2.0/tests/fixtures/test_bigger_building_shell.elements.csv +736 -0
- exterior_shell-1.2.0/tests/fixtures/test_building.ifc +298 -0
- exterior_shell-1.2.0/tests/test_cli.py +156 -0
- exterior_shell-1.2.0/tests/test_core.py +245 -0
- exterior_shell-1.2.0/tests/test_stripped_ifc.py +226 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Asem Daaboul
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: exterior-shell
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Extract lightweight exterior shells from BIM models (IFC). Produces stripped IFC and 2D footprints with elevation for GIS use.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Asem-D/exterior-shell
|
|
6
|
+
Project-URL: Repository, https://github.com/Asem-D/exterior-shell
|
|
7
|
+
Project-URL: Issues, https://github.com/Asem-D/exterior-shell/issues
|
|
8
|
+
Author-email: Asem Daaboul <asem.daaboul@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: bim,building-envelope,exterior-shell,footprint,gis,ifc,ifcopenshell
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: click>=8.0
|
|
24
|
+
Requires-Dist: ifcopenshell>=0.7.0
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: shapely>=2.0
|
|
27
|
+
Provides-Extra: ai
|
|
28
|
+
Requires-Dist: openai>=1.0; extra == 'ai'
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# exterior-shell
|
|
34
|
+
|
|
35
|
+
Extract lightweight exterior shells from BIM models (IFC) for GIS and visualization workflows.
|
|
36
|
+
|
|
37
|
+
`exterior-shell` reads an IFC file, classifies elements as exterior/interior using a rule-based engine, and produces:
|
|
38
|
+
|
|
39
|
+
- **Stripped IFC** (.ifc) with interior elements removed, preserving a structurally valid IFC file
|
|
40
|
+
- **2D Footprint** (.geojson) with base elevation, height, and area attributes for GIS extrusion
|
|
41
|
+
|
|
42
|
+
Optional AI-assisted classification handles ambiguous elements (walls, columns, slabs) that rule-based logic alone can't resolve.
|
|
43
|
+
|
|
44
|
+
## Why
|
|
45
|
+
|
|
46
|
+
GIS teams don't ask for BIM models. They receive them. Architecture practices export IFC files and hand them off, and the GIS analyst is left with 500MB of pipes, HVAC, and furniture when they need just the building envelope for a web map or spatial analysis.
|
|
47
|
+
|
|
48
|
+
| Approach | Stripped IFC | GIS Footprint | Cost |
|
|
49
|
+
|----------|:---:|:---:|:---:|
|
|
50
|
+
| **exterior-shell** | ✅ | ✅ With elevation | Free |
|
|
51
|
+
| IfcEnvelopeExtractor (TU Delft) | ❌ (CityJSON) | ❌ (CityJSON) | Free |
|
|
52
|
+
| ArcGIS Pro Building Layer | ❌ No standalone output | ❌ | ArcGIS Pro license |
|
|
53
|
+
| FME (IFC Connector) | ❌ | Via translation | $4K+/yr |
|
|
54
|
+
| IfcConvert `--exterior-only` | ❌ Mesh only | ❌ | Free |
|
|
55
|
+
| Manual Revit/ArchiCAD cleanup | ❌ | ❌ | Hours per model |
|
|
56
|
+
|
|
57
|
+
`exterior-shell` does one thing: clean exterior shell, lightweight output, under 30 seconds. The output is a structurally valid IFC file that any BIM or GIS tool can read, plus an optional GeoJSON footprint ready for ArcGIS Pro, QGIS, or web maps.
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install exterior-shell
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or from source:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/Asem-D/exterior-shell.git
|
|
69
|
+
cd exterior-shell
|
|
70
|
+
pip install -e .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Requirements
|
|
74
|
+
|
|
75
|
+
- Python 3.10+
|
|
76
|
+
- ifcopenshell, shapely, numpy, click
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
### Extract exterior shell (default)
|
|
81
|
+
|
|
82
|
+
Produces a stripped IFC file with interior elements removed:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
exterior-shell extract building.ifc
|
|
86
|
+
# Output: building_stripped.ifc + building.report.md
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Extract with 2D footprint
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
exterior-shell extract building.ifc --footprint
|
|
93
|
+
# Output: building_stripped.ifc + building_footprint.geojson + building.report.md
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The footprint GeoJSON includes `base_elevation`, `height`, `min_elevation`, `max_elevation`, and `area` properties. Load it in ArcGIS Pro or QGIS and extrude by the `height` attribute, or use it directly in web maps (MapLibre, CesiumJS).
|
|
97
|
+
|
|
98
|
+
### Stripped IFC only (no GIS output)
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
exterior-shell extract building.ifc --no-stripped-ifc --footprint
|
|
102
|
+
# Output: building_footprint.geojson only
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Other options
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
exterior-shell extract building.ifc --ai # AI-assisted classification
|
|
109
|
+
exterior-shell extract building.ifc --crs EPSG:3857 # Footprint in Web Mercator
|
|
110
|
+
exterior-shell extract building.ifc --keep-interior # Include interior-facing faces
|
|
111
|
+
exterior-shell extract building.ifc --no-report # Skip report generation
|
|
112
|
+
exterior-shell extract building.ifc --json-stats # Machine-readable output
|
|
113
|
+
exterior-shell info building.ifc # Inspect IFC file
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## How It Works
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
IFC File
|
|
120
|
+
│
|
|
121
|
+
├─ Parse ─── ifcopenshell extracts elements, geometry, spatial hierarchy
|
|
122
|
+
│
|
|
123
|
+
├─ Classify ─ Rule-based engine assigns EXTERIOR / INTERIOR / AMBIGUOUS
|
|
124
|
+
│ │
|
|
125
|
+
│ └─ [--ai] Vision model reclassifies ambiguous elements from rendered views
|
|
126
|
+
│
|
|
127
|
+
├─ Assemble ─ Merge exterior faces, remove hidden interior-facing geometry
|
|
128
|
+
│
|
|
129
|
+
└─ Export
|
|
130
|
+
├─ Stripped IFC (.ifc) ─ structurally valid IFC with interiors removed
|
|
131
|
+
├─ Footprint (.geojson) ─ 2D outline with base_elevation and height
|
|
132
|
+
└─ Report (.md) ─ extraction summary with element counts
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Classification Rules
|
|
136
|
+
|
|
137
|
+
| Category | Elements | Action |
|
|
138
|
+
|----------|----------|--------|
|
|
139
|
+
| Always exterior | IfcRoof, IfcWindow, IfcDoor, IfcCurtainWall, IfcChimney | Keep |
|
|
140
|
+
| Always interior | IfcSpace, IfcFurnishingElement, IfcCovering, IfcBuildingStorey | Remove |
|
|
141
|
+
| Ambiguous | IfcWall, IfcColumn, IfcBeam, IfcSlab (floor), IfcStair, IfcRailing | Default to exterior (conservative); use `--ai` to resolve |
|
|
142
|
+
|
|
143
|
+
## Performance
|
|
144
|
+
|
|
145
|
+
Tested on real-world IFC models:
|
|
146
|
+
|
|
147
|
+
| Model | Elements | Extraction Time | Stripped IFC Size | Size Reduction |
|
|
148
|
+
|-------|----------|----------------|-------------------|---------------|
|
|
149
|
+
| Test house | 14 | <2s | ~200 KB | ~78% |
|
|
150
|
+
| Office building | 1,190 | ~26s | 7,036 KB | 33.2% |
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install -e ".[dev]"
|
|
156
|
+
pytest tests/ -v
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Project Structure
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
exterior_shell/
|
|
163
|
+
├── cli.py # Click CLI entry point
|
|
164
|
+
├── core/
|
|
165
|
+
│ ├── parser.py # IFC parsing with ifcopenshell
|
|
166
|
+
│ ├── classifier.py # Rule-based classification engine
|
|
167
|
+
│ ├── assembler.py # Geometry assembly + face deduplication
|
|
168
|
+
│ └── models.py # Data classes (Element, Classification, Shell)
|
|
169
|
+
├── ai/
|
|
170
|
+
│ └── ... # Vision model classification (Phase 2)
|
|
171
|
+
├── export/
|
|
172
|
+
│ ├── stripped_ifc.py # Stripped IFC export (remove interior elements)
|
|
173
|
+
│ └── footprint.py # 2D footprint GeoJSON with elevation attributes
|
|
174
|
+
└── utils/
|
|
175
|
+
└── ... # Geometry helpers, I/O utilities
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Prior Art
|
|
179
|
+
|
|
180
|
+
This problem has been approached from different angles:
|
|
181
|
+
|
|
182
|
+
- **IfcEnvelopeExtractor** (TU Delft): Academic-grade tool outputting CityJSON, STEP, and OBJ with full LoD coverage (LOD0 through LOD5). Built on the Biljecki et al. LoD framework. Different output ecosystem from exterior-shell. If you're building 3D city models with CityJSON, that's the tool. [GitHub](https://github.com/tudelft3d/IFC_BuildingEnvExtractor)
|
|
183
|
+
- **IfcConvert** (`--exterior-only`): Open-source, extracts exterior shell as mesh. No structurally valid IFC output, no GIS attributes.
|
|
184
|
+
- **Esri ExteriorShell**: Built into ArcGIS Pro. Automatic sublayer extraction when loading IFC/RVT. Often misses roofs, ground floors, and includes interior geometry.
|
|
185
|
+
|
|
186
|
+
exterior-shell targets a narrower niche: GIS practitioners who need a clean stripped IFC plus a GeoJSON footprint with elevation attributes, with zero heavy GIS dependencies.
|
|
187
|
+
|
|
188
|
+
## Roadmap
|
|
189
|
+
|
|
190
|
+
- **v1.2** (current) - Stripped IFC + 2D footprint output, rule-based extraction
|
|
191
|
+
- **v1.3** - AI-assisted classification for ambiguous elements (multi-view rendering + vision API)
|
|
192
|
+
- **v1.4** - Provenance metadata: link output features to IFC GlobalIds, record extraction parameters, validate spatial consistency with source shell
|
|
193
|
+
- **v2.0** - Revit direct integration (.rvt), 3D Tiles export, LOD generation
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT
|
|
198
|
+
|
|
199
|
+
## Acknowledgments
|
|
200
|
+
|
|
201
|
+
Built with [ifcopenshell](https://github.com/IfcOpenShell/IfcOpenShell) and [Shapely](https://shapely.readthedocs.io/).
|
|
202
|
+
|
|
203
|
+
Inspired by the daily pain of GIS teams who receive BIM models they didn't ask for and need just the envelope.
|
|
204
|
+
|
|
205
|
+
## Trademarks
|
|
206
|
+
|
|
207
|
+
ArcGIS is a registered trademark of Esri. This project is not affiliated with or endorsed by Esri.
|