Performance of boolean operations

I wrote a simple code that would make a few boolean operations. It takes a few minutes to complete, were a similar object in Catia is regenerated almost automatically. I was wondering if there is any known performance issues with the boolean operation routines, or maybe I am using them the wrong way.


TopoDS_Shape wing(double croot, double ctip, double span, double tipoffset, double xoffset, double yoffset, bool sym){
int i;
BRepBuilderAPI_MakePolygon afroot;
for (i=0; i afroot.Add( gp_Pnt(xoffset+croot*afl[i][0],croot*afl[i][1]/4.0,yoffset) );
TopoDS_Wire rwire = afroot.Wire();

BRepBuilderAPI_MakePolygon aftip;
for (i=0; i aftip.Add( gp_Pnt(xoffset+tipoffset+ctip*afl[i][0],ctip*afl[i][1]/4.0,yoffset+span) );
TopoDS_Wire twire = aftip.Wire();
BRepOffsetAPI_ThruSections generator(Standard_True,Standard_False);
return generator.Shape();


TopoDS_Shape wing1 = wing(100.0, 50.0, 100.0, 25.0,110.0,0.0,false);
TopoDS_Shape wing2 = wing(100.0, 50.0, -100.0, 25.0,110.0,0.0,false);

TopoDS_Shape wing = BRepAlgoAPI_Fuse(wing1, wing2);

Lee Sangsu's picture

The boolean operations of OCC sometimes can be very slow with some complex b-spline surfaces. And I think the shapes you made is the case. Thrusection or sweep operations make bspline surfaces, and in your case it has somewhat many faces of that kinds. So, the result can be quite slow.

In fact, recently it has improved about twice faster in OCC5.2 than in the previous versions upon request from my company. It is still not so fast enough, but in most cases we are concerned with it is acceptable.

I hope this helps you.

Sangsu Lee, MIDAS IT

Joan Puig's picture

If the problem is that I am using Thrusection how would you suggest I improve my code. After all, what I am trying to do is create a wing out of two airfoil sections. It seems like if I could force it to create lines instead of b-splines I would be ok.