This generator creates IFC4X3 models containing light entry areas based on coordinates provided in JSON format. It processes 3D triangle coordinates of light entry areas and light prisms (clear view and light incidence representations), groups them by spaces, and produces an informative geometric representation as an IFC file. The light entry areas and light prisms originate from automated compliance checks against Austrian building regulations for model-based digital building permits.
The script translates the triangular mesh data into complex IFC entities using IfcOpenShell, numpy, and shapely, resulting in IfcPolygonalFaceSet elements and IfcExtrudedAreaSolid representations for clear view and light incidence prisms. It maps property sets and quantity sets to elements representing these areas.
- Folder InputJSON: Contains the default input JSON geometries (e.g.,
LightEntryCoordinate-List.json). - Folder output: Recommended output path for generated IFC models.
- light-entry-model-generator.py: Main script to generate the IFC models.
- LightEntryModel.ifc: Correctly generated LightEntryModel for reference.
- requirements.txt: Text file containing the required dependencies.
All data files are licensed under CC BY 4.0, all software files are licensed under MIT License.
- Clone or download this repository
- Install Python
- Open Terminal in the project folder
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Linux/macOS:
source venv/bin/activate - Windows:
venv\Scripts\activate
- Linux/macOS:
- Install all dependencies:
pip install -r requirements.txt
Try the project with our example JSON file located at ./InputJSON/LightEntryCoordinate-List.json:
python light-entry-model-generator.pyResulting IFC model is written to the root directory as:
LightEntryModel.ifc
The default input and output paths can be overwritten either directly in the script or via command line arguments.
To override the input and output paths, you can edit the default settings in lines 12-13 in the main script light-entry-model-generator.py:
#Default settings
default_input_filename = "./InputJSON/LightEntryCoordinate-List.json"
default_output_filename = "LightEntryModel.ifc"python light-entry-model-generator.py -husage: light-entry-model-generator.py [-h] [-i INPUT_FILE] [-o OUTPUT_FILE]
Generate IFC Light Entry Models from JSON data.
options:
-h, --help show this help message and exit
-i INPUT_FILE, --input_file INPUT_FILE
Path to the input JSON file containing light entry coordinates.
-o OUTPUT_FILE, --output_file OUTPUT_FILE
Path to the output IFC file.
To run with custom paths, provide the arguments explicitly:
python light-entry-model-generator.py -i custom_input.json -o my_output.ifc