IfcOpenHouse
More than 10 years ago, the original IfcOpenHouse π was created by Thomas Krijnen by using the IfcOpenShell library π. It consists of a single story building with a gable roof, sitting on top of a NURBS surface β°οΈ. It includes a footing π¦Ά, walls π§±π§± with openings π³οΈ for doors πͺ and windows πͺ, a roof πβ¦ but above all, it gives an overview about how to programmatically build a simple IFC model from scratch π©π½βπ».
Navigate through the following preview for yourself. Double click π±οΈ an element to gather entity info from the underlying IFC:
Check out the original blog post, as well as the C++ source if interested:
http://blog.ifcopenshell.org/2012/11/say-hi-to-ifcopenhouse.html
https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/examples/IfcOpenHouse.cpp
The current repository is an exercise to recreate that same model, but with the recent higher level IfcOpenShell Python API ππ. This same API is widely used today in the native IFC editing approach followed by BIM authoring software like BlenderBIM and FreeCAD, among others. At the end, thereβs also a visualization cell with IFC.js, the BIM toolkit π οΈ for JavaScript.
It is a basic tutorial, but some basic IFC and Python knowledge is required, as well as some basic trigonometry for the sizes and coordinates π©βπ. One of the goals is to show how powerful Jupyter πͺ Notebooks π can be πͺ as an experimentation playground. Note that this notebook uses nbdev directives to automate the production of a script and a Quarto website, as well as helping with Git-friendly Jupyter.
Getting started / local installation
These set of notebooks π may be conveniently browsed through their Quarto website π, or alternatively be run on your own end by cloning the repository. For the former, refer to the following section. For the latter, follow these installation instructions π.
Youβll need Mambaforge π installed in case you donβt have it already. Then, you may run the following commands to clone the repository and install all necessary dependencies β .
git clone https://github.com/cvillagrasa/IfcOpenHouse.git
mamba env create --file environment.yml
conda activate IfcOpenHouse
pip install -e .
Using the editable flag -e
, you will be able to use any further changes you make to the notebooks and/or Python modules immediately.
As an extra step, use dark mode π΅οΈββοΈ if you wish (see jupyter-themes for more info):
jt -t chesterish -T -N -kl
You may now launch the Jupyter πͺ Notebook π dashboard:
jupyter notebook
And thatβs it! you are now ready to locally open the notebook nbs/00_generation.ipynb
and start having fun π₯³.
Lastly, you may also want to edit the JavaScript code π©π½βπ» for the model preview by running npm i
from the viz
directory, and regenerating the bundle with npm run build_nb
.
Step-by-step tutorial / online
Alternatively, you may just start by browsing the contents firstly, and perhaps attempt to run it locally later. Just go to generation and youβll find an IfcOpenHouse generation online walkthrough πππ.