Find the surface where a given curve is

Hello,

I have a TopoDS_Edge which
is on a surface (I now it, because I got this edge by
projecting another one onto
the surface).

So I have this TopoDS_Edge and
a list of TopoDS_Face, and I want to get the TopoDS_Face where the curve lies.

Do you know any way to test it ? I tried to use CurveOnSurface(aFace,aCurve,...)
but it does not work
(it returns TRUE even if the curve is not on the given face !)

Thx,

FF

m-aronsson's picture

I have no idea, looking at the documentation CurveOnSurface should work, it's possible that it's a bug I am not sure, any one else knows about this ?

Mikael

angel's picture

Hi,
Maybe you can try these two way,

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

Second,
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);
}