Skip to content

cvillagrasa/IfcOpenHouse

 
 

Repository files navigation

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 🚀🚀🚀.

About

Recreation of the original IfcOpenHouse with the IfcOpenShell Python API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.5%
  • Other 0.5%