From: azv Date: Wed, 4 Jul 2018 11:31:59 +0000 (+0300) Subject: Improve angle measurement X-Git-Tag: EDF_2018-1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3efb17b88659faa1dfbf5fa22daf4f754ecb4c52;p=modules%2Fshaper.git Improve angle measurement --- diff --git a/src/FeaturesPlugin/Test/TestMeasurementAngle.py b/src/FeaturesPlugin/Test/TestMeasurementAngle.py index d00f1c842..b3033467d 100644 --- a/src/FeaturesPlugin/Test/TestMeasurementAngle.py +++ b/src/FeaturesPlugin/Test/TestMeasurementAngle.py @@ -73,13 +73,13 @@ TOLERANCE = 1.e-6 # reference data REF_DATA = [("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchLine_6", [90]), - ("Extrusion_1_1/Generated_Face_5", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [45]), - ("Sketch_1/Edge-SketchCircle_1_2", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [0]), + ("Extrusion_1_1/Generated_Face_5", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [135]), + ("Sketch_1/Edge-SketchCircle_1_2", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [180]), ("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchCircle_1_2", []), ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", []), ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_4", [130]), ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_1", [140]), - ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [85.95645561, 95.19768874]) + ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [58.78794626, 95.19768874]) ] for ref in REF_DATA: diff --git a/src/GeomAPI/GeomAPI_Angle.cpp b/src/GeomAPI/GeomAPI_Angle.cpp index 97d45ee3e..c32a2ef16 100644 --- a/src/GeomAPI/GeomAPI_Angle.cpp +++ b/src/GeomAPI/GeomAPI_Angle.cpp @@ -59,11 +59,11 @@ GeomAPI_Angle::GeomAPI_Angle(const std::shared_ptr& theEdge1, GeomAPI_ProjectPointOnCurve aProj1(aPoint, aCurve1); if (aProj1.NbPoints() > 0) - aCurve1->D1(aProj1.Parameter(1), aP, anAngle->myDir1); + aCurve1->D1(aProj1.LowerDistanceParameter(), aP, anAngle->myDir1); GeomAPI_ProjectPointOnCurve aProj2(aPoint, aCurve2); if (aProj2.NbPoints() > 0) - aCurve2->D1(aProj2.Parameter(1), aP, anAngle->myDir2); + aCurve2->D1(aProj2.LowerDistanceParameter(), aP, anAngle->myDir2); setImpl(anAngle); }