Modeling a bounded halfspace solid

245 views
Skip to first unread message

thomas krijnen

unread,
Mar 3, 2012, 8:28:27 AM3/3/12
to oce-dev
Hi all,

Some of you might remember that I am working on an open source IFC
implementation called IfcOpenShell and use OCE for the interpretation
of the (STEP-like) geometry in IFC.

Most geometry in IFC has a counterpart OCC class, making the geometry
interpretation 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/ifcgeometricmodelresource/lexical/ifcpolygonalboundedhalfspace.htm

The way I implemented it now is by simply extruding the boundary, but
this leads to all sorts of problems. Does anybody have a better idea
how to construct this polygonal bounded halfspace?

Thanks in advance. Sorry for the slightly unrelated topic, I posted
the same question in the occ forums but got no reply there yet.

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


Thomas Paviot

unread,
Mar 3, 2012, 12:00:15 PM3/3/12
to oce...@googlegroups.com
2012/3/3 thomas krijnen <t.kr...@gmail.com>
Hi Thomas,

I could not access the url but looket at the IFC2x3 TC1 EXPRESS schema. What do you mean with "all sort of problems"? This information would perhaps help us in suggesting another modeling approach.

Thomas

thomas krijnen

unread,
Mar 4, 2012, 11:24:44 AM3/4/12
to oce-dev
Hi Thomas,

Thanks a lot for your comment :) The IfcPolygonalBoundedHalfSpace is
used to subtract from other solids.

Well, the first minor problem is that I have to specify a height for
the the extrusion of the boundary. At the time of creation of the half
space I do not yet know which other solids the subtraction will
operate on, so choosing a height is somewhat arbitrary. But that's my
problem, I can overcome that.

What happens a lot in the IFC files I process is that some of the
edges of the 'halfspace boundary' coincide with the faces of the other
solid. When I BRepAlgoAPI_Cut those solids, often BRepCheck_Analyzer
points out the resulting shape is invalid. Then if I triangulate the
resulting shape it is often a mix of faces of both operands.

But, in fact, perhaps the problem might be more general? That cutting
solids that 'share' (part of) a face leads to invalid results? Does
anybody have experience with that?

Thanks again.

Kind regards,
Thomas

On Mar 3, 6:00 pm, Thomas Paviot <tpav...@gmail.com> wrote:
> 2012/3/3 thomas krijnen <t.krij...@gmail.com>
>
>
>
>
>
>
>
>
>
> > Hi all,
>
> > Some of you might remember that I am working on an open source IFC
> > implementation called IfcOpenShell and use OCE for the interpretation
> > of the (STEP-like) geometry in IFC.
>
> > Most geometry in IFC has a counterpart OCC class, making the geometry
> > interpretation 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/ifcgeometricmodelre...

Roman Lygin

unread,
Mar 5, 2012, 1:08:18 PM3/5/12
to oce-dev
Hi Thomas,

Not sure if this will help but take a look at
BRepPrimAPI_MakeHalfSpace. Never used it myself and can assume
BRepCheck_Analyzer may complain about it (expecting finite size
geometries). I thought it was mentioned in some user's guides (likely
Modeling Algo) for BOPs.

Good luck.
Roman

Thomas Paviot

unread,
Mar 5, 2012, 11:37:44 PM3/5/12
to oce...@googlegroups.com
Hi Roman,

I didn't know about this class, thanks. From the CDL definition:
"""
class MakeHalfSpace from BRepPrimAPI  inherits MakeShape from BRepBuilderAPI

---Purpose: Describes functions to build half-spaces.
    -- A half-space is an infinite solid, limited by a surface. It
    -- is built from a face or a shell, which bounds it, and with
    -- a reference point, which specifies the side of the
    -- surface where the matter of the half-space is located.
    -- A half-space is a tool commonly used in topological
    -- operations to cut another shape.
    -- A MakeHalfSpace object provides a framework for:
    -- -   defining and implementing the construction of a half-space, and
    -- -   consulting the result.
"""

Sure Thomas K will know how to do with it.

Regards,

Thomas (P)

2012/3/5 Roman Lygin <roman...@gmail.com>

PLR

unread,
Mar 6, 2012, 8:27:51 AM3/6/12
to oce-dev
First, a little remark about the IFC 2.3 link; maybe you can/must use
the following from IFC 2.4
http://buildingsmart-tech.org/ifc/IFC2x4/rc3/html/schema/ifcgeometricmodelresource/lexical/ifchalfspacesolid.htm

Do you planned to do some CSG modeling with OCE/OCC ("half space
solids are only useful as operands in Boolean expressions")?

Best regards
Paul

On 3 mar, 14:28, thomas krijnen <t.krij...@gmail.com> wrote:
> Hi all,
>
> Some of you might remember that I am working on an open source IFC
> implementation called IfcOpenShell and use OCE for the interpretation
> of the (STEP-like) geometry in IFC.
>
> Most geometry in IFC has a counterpart OCC class, making the geometry
> interpretation 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/ifcgeometricmodelre...

Thomas Paviot

unread,
Mar 6, 2012, 9:42:54 AM3/6/12
to oce...@googlegroups.com
Hi Paul,

AFAIK the IFC2x4 schema is the latest release, and most of current CAD packages support the older 2x3 release. Importing/exporting architectural files from/to these softwares thus require to support IFC2x3.

Regards,

Thomas

2012/3/6 PLR <paul.l...@gmail.com>

thomas krijnen

unread,
Mar 7, 2012, 6:09:02 AM3/7/12
to oce-dev
Thanks for thinking with me here gentlemen, much appreciated.

Hi Roman, I indeed use BRepPrimAPI_MakeHalfSpace in my code to
construct the halfspace that is only bounded by a single face
(IfcHalfSpaceSolid). I did not realize it could construct a halfspace
from a TopoDS_Shell, this might be exactly what I am looking for for
my polygonal bounded halfspace. Although I must admit I am having a
hard time imagining exactly what a halfspace constructed from a (I
presume open) shell would look like.

Hi Paul, that indeed is the purpose. For example in IFC, halfspaces
are often used to define the a cutting volume for a wall running up to
a slanted roof. (The definition of them has not changed beteen 2x3 and
2x4, and 2x4 is mostly backwards compatible, concerning importing).

Well, thanks again, I will try to see how BRepPrimAPI_MakeHalfSpace
behaves when constructed from a shell and see whether it fits the
definition of the IfcPolygonalBoundedHalfSpace.

Kind regards,
Thomas

thomas krijnen

unread,
Mar 10, 2012, 8:11:34 AM3/10/12
to oce-dev
Hi all,

I just stumbled on another way of creating an infinite solid: The
BRepPrimAPI_MakePrism 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
Reply all
Reply to author
Forward
0 new messages