IfcOpenHouse

Recreation of the original IfcOpenHouse with the IfcOpenShell Python API

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 πŸš€πŸš€πŸš€.