Menu

beginner's question: reading all geometry for one space

Help
2015-03-30
2015-03-31
  • Lars O. Grobe

    Lars O. Grobe - 2015-03-30

    Hi all,

    I am all new to ifcopenshell, and currently I am trying to figure out how to parse IFC files space by space. What I want to do is to iterate through all space objects, and extract all geometry defining the boundaries of each space which I then will write out. How should I start such a project, is there an example for such filtering? I just know about the examples filtering by entity type, but not by groups.

    Thank you for an already great project - and for any help in advance :) Cheers,
    Lars.

     
  • Thomas Krijnen

    Thomas Krijnen - 2015-03-31

    Hi Lars,

    Are you interested in the bounding elements (say, the wall geometry) or the more abstract IfcRelSpaceBoundary surfaces? Are you using C++ or Python?

    Unfortunately you'll have to come with something yourself, no example for this yet. But it wouldn't be too hard. All the building blocks are there for you to assemble.

    If you open an IfcParse::IfcFile you can easily obtain a reference to the list of IfcSpaces. Start with the BoundedBy [1] attribute and descend further until you get to the elements you are interested in. Using the IfcGeom::create_brep_for_representation_and_product() function you can obtain an IfcGeom::BRepElement which represents the geometry for a certain building element. This you can triangulate and feed to the serializers in the ifcconvert folder.

    Also take a look at the source IfcGeomIterator.h which creates geometry while iterating over all building elements in the file.

    [1] http://www.buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcproductextension/lexical/ifcspace.htm

    Hope that helps,

    Kind regards,
    Thomas

     

Log in to post a comment.