Bounded HalfSpace Solid

Hi all,

I am using Open Cascade for an open source IFC geometry converter. IFC is a format very similar to STEP so with the use of Open Cascade most of the geometry interpretation is rather easy.

However, there is one type of geometry I can't seem to implement elegantly: a halfspace solid bounded by a polygonal boundary: http://buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcgeometricmodelresou...

There does not seem to be a direct counterpart in the Open Cascade classes? The way I implemented it now is by simply extruding the boundary, but this leads to all sorts of problems.

Does anybody have an idea how to construct this polygonal bounded halfspace?

Thanks in advance.

Kind regards,
Thomas
http://ifcopenshell.org
thomas@ifcopenshell.org

Thomas Krijnen's picture

Hi all,

I just stumbled on a way of creating an infinite solid, by means of the BRepPrimAPI_MakePrism which has a constructor to create an infinite prism from a face. I ended up implementing a more elaborate method, but for reference here is code to produce a polygonal bounded halfspace from a wire and a plane:

____________________________________

TopoDS_Wire the_boundary;
gp_Pln the_plane;
// ...
TopoDS_Shape prism = BRepPrimAPI_MakePrism(BRepBuilderAPI_MakeFace(the_boundary),gp_Vec(0,0,1),1,0,1);
gp_Pnt pnt = pln.Location().Translated(pln.Axis().Direction())
TopoDS_Shape halfspace = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
TopoDS_Shape bounded_halfspace = BRepAlgoAPI_Common(prism,halfspace);
____________________________________

Kind regards,
Thomas