Sunday, November 4, 2012

Say Hi to IfcOpenHouse!

Up until now, most people have been using IfcOpenShell to read and import IFC files, but today we bring you a three-dimensional IFC building model that is entirely generated from lines of code, using IfcOpenShell. With the use of some of the helper classes that IfcOpenShell provides, some might even say that creating IFC files this way is easier than operating a full-fledged BIM authoring tool, but that would we somewhat of an overstatement.

IfcOpenHouse rests on a Nurbs-surface hilltop constructed in Open Cascade. The tight relation between IfcOpenShell and Open Cascade will in the future provide everything you need to write complex parametric shapes right to an IFC file. However, for now the surface had to be tessellated, as Ifc2x3 does not support Nurbs and IfcOpenShell is not yet smart enough to pick the correct way of representing arbitrary shapes from Open Cascade, therefore it resorts to a triangular surface model.

For the other building elements IfcExtrudedAreaSolids are used, IfcBooleanClippingResults with IfcHalfSpaceSolids are used for the walls under the slanted roof and IfcOpeningElements are used for the boolean subtractions for windows and door. The hierarchical structure of an IfcProject, IfcSite, IfcBuilding and IfcBuildingStorey is created as well. This way a model is obtained that can be directly imported into your favourite three-dimensional modelling package.

IfcOpenHouse rendered in Blender using IfcBlender, imported into Revit and opened in Solibri Model Viewer and Tekla BIMsight. 

If you know of an application that is unable to represent the generated model correctly, or have any other questions or remarks, drop us a line in the comments! You can download the generated IFC here (updated June, 2014), and take a look at the source code for generating the file over here.

Update November 10, 2012 IfcOpenHouse has been updated to import correctly into Autodesk AutoCAD Architecture 2013.

13 comments:

  1. Compliments for this! Great job!

    I noticed that the Timestamp is missing in the file.

    Also Autodesk Architecturals 2013 is generating an system Error:

    [DefaultDomain:Error]Failed to run EdmContextImp::Import
    [DefaultDomain:Error]EDM error code:11108, message:Error/warning during STEP File read operation.
    [DefaultDomain:Error]Error loading file C:\IFC\IfcOpenHouse - kopie.ifc into EDM
    [DefaultDomain:Error]Project is not loaded, probably caused by import cancellation.
    at Autodesk.Aec.Ifc.Interop.OpProject.Import()
    [DefaultDomain:Error]Object reference not set to an instance of an object.
    at Autodesk.Aec.Ifc.Interop.OpProject.Import()
    at Autodesk.Aec.Ifc.Interop.Controllers.OpImportController.DoImport()
    [DefaultDomain: ]IMPORT ENDED: 11/4/2012 9:54:46 PM


    Greetings, Hans, hhs@deBIMspecialist.nl

    ReplyDelete
  2. Truly amazing!!! Congratulations Thomas. Now I must test ASAP...

    ReplyDelete
  3. Thanks Hans, I will look into those issues. I already took me quite some effort to get things importing in Revit, so this is unfortunate, but a great exercise in IFC interoperability.

    Thanks Yorik, I am not sure to what extent this will work in Python, but we'll get there eventually.

    ReplyDelete
  4. I have a strange problem with this... It generated a +600 MB IFC file with garbage entered. I did a full re-compile from latest svn but the problem persists.
    Using XCode 4.5 on OSX Lion 10.7.5.

    I did got a few warnings when compiling everything, but not sure if that is related to it.

    Otherwise, this is a fantastic achievement and I hope to really start learning your library now. The IFC writing part was especially something I looked forward to.

    ReplyDelete
  5. Thanks for trying Stefan, sorry for the lack of testing on OSX, I will look into it asap.
    Look forward to seeing some of your experiments in the future.

    ReplyDelete
  6. The problem mentioned by Stefan of IfcOpenShell generating incorrect output for certain strings is now fixed in the repository.

    ReplyDelete
  7. Hi Thomas,
    really great job, I liked the most how you made the windows to be made of members and a plate element for the glass with different colors.

    For some reason DDS-CAD viewer didn't show the door at all, and the opening objects have been ignored.
    (https://dl.dropbox.com/u/9691311/ifcOpenHouse1.PNG)

    Another small note that the opening elements size should be adjusted to be equal to the walls thickness
    (https://dl.dropbox.com/u/9691311/ifcOpenHouse2.PNG) in case if someone wanted to calculate the net volume by subtracting the sum volume of all openings.

    I suggest for the next step to show how to add property sets or other kind of relations between object to present the real value of using IFC.

    Adding the spaces at the end will be the difficult part.


    ReplyDelete
  8. Hi Ali, thanks for you message. Are you still working on the IfcWebServer? Thanks for the screen-shots of the DDS viewer, I looked into them and sent them an e-mail. There are still some applications for which IfcOpenHouse poses some problems. I hope I can sort these things out.

    Interesting suggestion about making the width of the opening elements equal to the wall. Do you know whether that is a common way to calculate the volume of the wall? Because I have seen a lot of IFC files in which the opening elements extend slightly beyond the wall (although not as much as in IfcOpenHouse) it is a way of making sure that the geometry kernel does not run into precision issues that might occur if the opening faces coincide exactly with the faces of the wall.

    From the start already IfcOpenShell had somewhat of a bias towards the geometrical aspects of IFC, due to its use of Open Cascade probably. But in the next version I will add some property sets as well.

    For some of the topological questions, like the detection of internal spaces, seeing which walls are external, determining wall connectivity, containment relations, etc. I would actually like to see if I can use Open Cascade to find these programmatically.

    ReplyDelete
  9. Hi Ali, following up on the issue you reported with IfcOpenHouse in DDS-CAD Viewer, it appears this is known issue. You can circumvent this by enabling the use of Open Cascade within the DDS-CAD Viewer. For that go to Format > Ifc option... and under Advanced Ifc Graphics Handling tick Use OpenCASCADE. Open Cascade to the rescue! Apparently its use in AEC software is even more widespread than I thought, Tekla BIMsight for example also relies on Open Cascade for their IFC support.

    ReplyDelete
  10. Hi Thomas, sorry for my late replay, I just saw your messages now.
    I am still working on IfcWebServer on my free time, but i have been recently so busy so more or less I am trying at least to keep the server running.
    Maybe the best way to calculate the net volume of the walls as solid objects after subtracting the opening objects using boolean operations,something like what the Blender add-on "Measure Panel" does. OpenCASCADE has for sure functions to calculate the volume of meshes.

    ReplyDelete
  11. Thomas your my hero for working on this!
    I have to follow this more closely from now on..!

    ReplyDelete
  12. The link to the code that generated ifcopenhouse.ifc is broken. The link appears to be to be to "IfcOpenHouse.cpp" which is a C++ file I think; Is there a python version that does the same thing?

    ReplyDelete
    Replies
    1. Thanks, I've updated the link to https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/examples/IfcOpenHouse.cpp

      There is no Python version that does the same thing, but for example the generation of a single wall is outlined here: http://academy.ifcopenshell.org/creating-a-simple-wall-with-property-set-and-quantity-information/

      Hope that helps,

      Kind regards,
      Thomas

      Delete