Project a Curve on Surface

Hi Guys

I have problem to project a Curve on a Surface
and this is my code

can anyone give me a hand? Tell me what I did wrong?

Thanks in advance

if(myCurve.IsNull())
{
Handle(Geom_Curve) aCuv=BRep_Tool::Curve(myEdge,First,Last);
myCurve= GeomProjLib::Curve2d(aCuv,First,Last,mySurface,pTo2);

if(myCurve.IsNull())
{
aCuv=GeomProjLib::Project(aCuv,mySurface);
First=aCuv->FirstParameter();
Last=aCuv->LastParameter();
myCurve= GeomProjLib::Curve2d(aCuv,First,Last,mySurface,pTo2);
}
}

Udo's picture

Can you provide some more details. It would be helpfull if you show the variable definition.