How to retrieve the Surface from the PCurve

Hi,
I use BRepBuilderAPI_MakeEdge(2dCurve,Surface) to create a Edge, and then display the Edge on 3D view. Whether can I retrive the Surface from the object which is Edge.

Sincerely
Angel

ekiroglu's picture

This maybe helpfull :

TopExp::MapShapesAndAncestors( const TopoDS_Shape& S,const TopAbs_ShapeEnum TS,const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M);

Best Regards,
Erki

angel's picture

Hi Erki,
Thank you for your reply, I also find the other way can do that, the code as following:
Handle(Geom_Surface) orgSur;
Handle(Geom2d_Curve) org2dCuv;
TopLoc_Location L;
Standard_Real First,Last;
BRep_Tool::CurveOnSurface(aEdge,org2dCuv,orgSur,L,First,Last);
if (!orgSur.IsNull())
{
TopoDS_Shape aShape=BRepBuilderAPI_MakeFace(orgSur);
Handle(AIS_Shape) AisShape=new AIS_Shape(aShape);
myCurrentIC->Display(AisShape);
}