From 27cff5ce85a9413f644bce924aa43957fcf24b79 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 1 Jan 2018 13:23:37 +0100 Subject: [PATCH] Sketcher: Match angle on lines representation match solver result --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 7db70ee842..bf88f0b09a 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -4708,6 +4708,10 @@ Restart: p0 = SbVec3f(x,y,0); } } + + range = Constr->getValue(); // WYSIWYG + startangle = atan2(dir1.y,dir1.x); + } else {//angle-via-point Base::Vector3d p = getSketchObject()->getSolvedSketch().getPoint(Constr->Third, Constr->ThirdPos); p0 = SbVec3f(p.x, p.y, 0); @@ -4715,11 +4719,12 @@ Restart: dir1.RotateZ(-M_PI/2);//convert to vector of tangency by rotating dir2 = getSketchObject()->getSolvedSketch().calculateNormalAtPoint(Constr->Second, p.x, p.y); dir2.RotateZ(-M_PI/2); + + startangle = atan2(dir1.y,dir1.x); + range = atan2(dir1.x*dir2.y-dir1.y*dir2.x, + dir1.x*dir2.x+dir1.y*dir2.y); } - startangle = atan2(dir1.y,dir1.x); - range = atan2(dir1.x*dir2.y-dir1.y*dir2.x, - dir1.x*dir2.x+dir1.y*dir2.y); endangle = startangle + range; } else if (Constr->First != Constraint::GeoUndef) {