// --- See GEOMImpl_ProjectionDriver.cxx
+ gp_XY LP, RP;
+ aProfile->GetLeftPoint(LP);
+ aProfile->GetRightPoint(RP);
+
TopoDS_Shape aShape = aGuideXY->GetShape();
gp_Pnt P1(thePoint.X(), thePoint.Y(), 0);
TopoDS_Shape aPoint = BRepBuilderAPI_MakeVertex(P1).Shape();
double distance = aProjXY.Modulus();
//DEBTRACE("distance to guideline " << distance);
+ gp_Vec2d aProjDir = aProjXY;
+ gp_Vec2d aProfileDir(LP, RP);
+ double aSign = 1.0;
+ if( aProfileDir.Dot(aProjDir) < 0 )
+ aSign = -1.0;
+
+ distance *= aSign;
+
// get delta altitude on section (supposed symmetric) from guideline distance (aParam)
double delta = 0;
int i1 = 0;