Menu

Get geometry of IfcBuildingElementProxy

2021-03-10
2021-03-11
  • SourceForge

    SourceForge - 2021-03-10

    I have multiple standard formed bricks in an IFC file of the type IfcBuildingElementProxy. While I already managed to extract their positions from the IFC file, I now struggle to get the geometry (lenght, height, width) from the file. I know that there are 2 ways to get the geometry:

    1. parse trough the representation attributes of the bricks and try to write a code, that calculates the geometry. This method is really exhausting, as IFC files tend to work with a lot of references. I won't go this path.

    2. get the geometry using a engine like ifcopenshell and opencascade. I know how to cast the bricks into a TopoDS object, but struggle to find the right methods to get the geometry.

    import ifcopenshell
    
    bricklist = ifc_file.by_type('IfcBuildingElementProxy') 
    
    for brick in bricklist:
            shape = ifcopenshell.geom.create_shape(settings, brick).geometry
            shape.methodtogetXYZgeometrics???
    
     
    • Thomas Krijnen

      Thomas Krijnen - 2021-03-11

      Yes ultimately then you're doing some form of geometric reconstruction since the geometric input parameters are not preserved. Coincedently I just wrote something similar in C++, you can reproduce that using PythonOCC if you wish.

      https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/serializers/SvgSerializer.cpp#L381

      Note that this assumes an axis aligned box (but you can also pick reference axes from the edges).

       

Log in to post a comment.