About extending face by specifying some edges or wire.

Hi All,

Most CADs support to extend face by specifying some edges in the face. After reading through the occ doc, I only find a API GeomLib::ExtendSurfByLength. Yes, it works well for edges lied on ISO direction. However, this API is totally based on geometry but not topology. I wonder know whether occ supports to extend face by edges or wire. If it does not, can anyone give me some suggestions to extend face properly.

Thanks in advance.

-Cauchy Ding

Cauchy Ding's picture

Does any body know it? Any suggestion is welcome.

Svetlozar Kostadinov's picture

What do you mean "extend"? If you mean sweep along a path, what about using the topological function BRepPrimAPI_MakePrism? You can sweep an edge, wire, face or even solid along given vector.

This is a sample code from OCC50.chm documentation:

//creation of a finite, an infinite, and a semi-infinite solid using a face, a direction and a length.
TopoDS_Face F = ..; // The swept face
gp_Dir direc(0,0,1);
Standard_Real l = 10;
// create a vector from the direction and the length
gp_Vec v = direc;
v *= l;
TopoDS_Solid P1 = BRepPrimAPI_MakePrism(F,v);
// finite
TopoDS_Solid P2 = BRepPrimAPI_MakePrism(F,direc);
// infinite
TopoDS_Solid P3 = BRepPrimAPI_MakePrism(F,direc,Standard_False);
// semi-infinite

Sharjith Naramparambath's picture

I think you can retrieve the underlying surface of the topological object using BRepTool::Surface, extend it using Geomlib and again make a Topological surface (TopoDS_Face or TopoDS_Shell).

Hope this works!

N. Sharjith

Cauchy Ding's picture

Oh, maybe I explain this question not clearly enough. I record a demo and it shows the face extending module of solidworks. Here is the link address:

andi's picture

Maybe the class BRepOffsetAPI_MakeOffset or BRepOffsetAPI_MakeThickSolid will help you. The first I am using to offset the edges of a face. The second seems to do the same for the faces of a body (see in documentation)

Cauchy Ding's picture

Hi,Andreas. Thank you for your reply. But as u can see in the video, the offset object is not the wire, but some edge(s) of the face. BRepOffsetAPI_MakeOffset only receive wire.

Billy's picture

I assume by this thread that there is no method to do this in OCC.