Get a Handle_Geom_Surface from a TopoDS::Face shape with the boundary information

Hi,
I get a Handle_Geom_Surface from a TopoDS::Face shape in the follow way

TopoDS_Face faceShape = TopoDS::Face(aSelectShape);
Handle_Geom_Surface surface = BRep_Tool::Surface(faceShape);

But the Surface I obtained don't contain the boundary information.
How can I add the boundary to the obtained surface?
In other words, I want to get a boundary surface.

Thanks in advance!

Rob Bachrach's picture

You probably want to create a BRepAdaptor_Surface from the face.

zhangzhigang824's picture

Hi Rob,

Thanks for your reply!

I want to get the intersection line of the two surface.
Are there any functions to solve the intersection line of two BRepAdaptor_Surface except for GeomAPI_IntSS?

thank you again!

Rob Bachrach's picture

I've never used it, but this looks promissing:

TopOpeBRep_FacesIntersector

zhangzhigang824's picture

Hi Rob,

Thanks very much for your help, and I have solved the problem under your help.
The follow is the code:

Handle(TColGeom_HSequenceOfCurve) sequenceOfCurve = new TColGeom_HSequenceOfCurve();
TopOpeBRep_FacesIntersector facesIntersector;
facesIntersector.Perform(FirstShape, SecondShape);
Handle_TopOpeBRep_HArray1OfLineInter array1OfLineInter = facesIntersector.Lines();
for (int i=1; i<=facesIntersector.NbLines(); i++)
{
TopOpeBRep_LineInter aLineInter = array1OfLineInter->Value(i);
Standard_Real firstPara, lastPara;
aLineInter.Bounds(firstPara, lastPara);
Handle_Geom_Curve insectionCurve = aLineInter.Curve(firstPara, lastPara);
sequenceOfCurve->Append(insectionCurve);
return sequenceOfCurve;
}

Thank you again!