How do you create planar surfaces

That is, how would one create a circular plane surface or a triangular surface. I am trying to create faces of these types and need to define the underlying geometry.

The only planar surface I can create is just the Geom_RectangularTrimmedSurface.

Can anybody please let me know the different ways for creating planar surfaces with some example on how to create circular ones?

Thanks in advance.

Tim

Rob Bachrach's picture

Tim,

You cannot create a circular or triangular "surface". You can however, create a circular or triangular face that uses an underlying planar surface. To do this, create edges defining your shape (a single circular edge or 3 linear edges creating a triangle) usually using BRepBuilderAPI_MakeEdge. Then, create a closed wire from the edges. Finally, create a face from the wire. Since your face uses a planar surface, the easiest constructor would be:

BRepBuilderAPI_MakeFace
(const TopoDS_Wire& W,
const Standard_Boolean OnlyPlane = Standard_False);

Pass your wire and Standard_True for OnlyPlane.

For example, to create a circular face:
gp_Circ circ(gp::XOY(), 10);
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(circ);
TopoDS_Wire wire = BRepBuilderAPI_MakeWire(edge);
TopoDS_Face face = BRepBuilderAPI_MakeFace(wire, Standard_True);

timtim's picture

Great deal and Thanks!!!

-Wole

timtim's picture

Great deal and Thanks!!!

-Tim