Correct way of handling IfcPolygonalBoundedHalfSpace.

Hello Experts,

I develop IFC Importer and would like to ask for the legitimate algorithm in terms of IFC standards for handling IfcPolygonalBoundedHalfSpace. Is it allowed to extrude PolygonalBoundary into directions of positive and negative Z axis defined by the Position attribute?

Currently my software does extrusion only into direction of positive Z. So the resulting geometry depends on placement of Position coordinate system. More over the result can be changed if I edit IFC file and move coordinate system along its Z axis. I have example of IFC file with incorrect (this is my guess) Z component of coordinate system’s placement which makes my importer produce wrong geometry.
Other viewers produce desired shape of geometry. Also some of them do not react on changing Z component of ‘Position’ coordinate system no matter which values I set to the IFC file. That is why I think they do extrusion into both directions. If my importer does extrusion into negative Z direction I also get correct results. But it is not allowed by specification.

I have pictures which describe use case very well, but I cannot attach them because my account is limited.

So I am wondering if my IFC file contains correct coordinates? If it does and my Importer handles it incorrectly then please suggest the right algorithm for evaluating the resulting IfcPolygonalBoundedHalfSpace’s solid.

The parent type has the attribute that governs the direction of the mass:

AgreementFlag: IfcBoolean: The agreement flag is TRUE if the normal to the BaseSurface points away from the material of the IfcHalfSpaceSolid. Otherwise it is FALSE.

Yes, it is clear how to find out which half space should be used. It is not clear how to correctly limit this half space with help of ‘PolygonalBoundary’ if boundary is located inside the half space.
Do I need to extrude ‘PolygonalBoundary’ only into positive Z direction or I need to do it into negative Z as well?

If ‘PolygonalBoundary’ is located outside the half space it is enough to do extrusion only into one direction. In this case extruded body will bound entire half space starting from the very beginning(half space plane) to the infinity.