]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Select direction of symbols distribution
authorvsv <vsv@opencascade.com>
Mon, 17 Jul 2017 07:39:20 +0000 (10:39 +0300)
committervsv <vsv@opencascade.com>
Mon, 17 Jul 2017 07:39:20 +0000 (10:39 +0300)
src/SketcherPrs/SketcherPrs_PositionMgr.cpp

index 1dbe75116261420c424b26c43335b1889d0f8551..51771dcfab9b6b01852e5c56e0ea5e3ff60fc4b2 100644 (file)
@@ -100,7 +100,11 @@ gp_Vec getVector(ObjectPtr theShape, GeomDirPtr theDir, gp_Pnt theP)
       GeomPointPtr aPnt1 = aCurve->getPoint((aMidParam + aCurve->endParam()) / 2.);
       GeomPointPtr aPnt2 = aCurve->getPoint((aMidParam + aCurve->startParam()) / 2.);
 
-      aVec = gp_Vec(aPnt1->impl<gp_Pnt>(), aPnt2->impl<gp_Pnt>());
+      gp_Pnt aPn2 = aPnt2->impl<gp_Pnt>();
+      if (aPn2.IsEqual(theP, Precision::Confusion()))
+        aVec = gp_Vec(aPn2, aPnt1->impl<gp_Pnt>());
+      else
+        aVec = gp_Vec(aPnt1->impl<gp_Pnt>(), aPn2);
     }
   } else {
     aVec = gp_Vec(theDir->impl<gp_Dir>());