Non-planar polygons

I need to be able to create a model built up from a large number of rectangular patches. These patches are non-planar. I can create a polygon using BRepBuilderAPI_MakePolygon but when I attempt to create a face using BRepBuilderAPI_MakeFace I get an error (BRepBuilderAPI_NotPlanar).

Does anyone know how I can create the face without resorting to splitting the rectangle into two triangles?

Even better, add the polygon to a shape to make a single surface?


Deelip's picture

I am faced with the same problem. Does anyone have a solution?

n-southall's picture

This is particularly annoying as some of the old versions of Cascade (pre- open source) allowed the use of non-planar polygons in BRepBuilderAPI_MakeFace. This worked fine, but from (I think) Version 3.0 non-planar polygons were not tolerated. I'm afraid to admit that for my 4-sided polygons I simply split them into two triangular faces, but it isn't very satisfactory.


Deelip's picture

I found a solution for a 4 sided non planar polygon (if I may call it that)

TColgp_Array2OfPnt Array(1,2,1,2);

Handle (Geom_BSplineSurface) pSurface = GeomAPI_PointsToBSplineSurface(Array);
Face = BRepBuilderAPI_MakeFace(pSurface);

This gives a smooth curved "rectangular" surface. Hope this helps.