diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 16e73200f..2fef3af1e 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1497,7 +1497,9 @@ int Sketch::initMove(int geoId, PointPos pos) p1.y = &MoveParameters[3]; *p1.x = *center.x; *p1.y = *center.y; - GCSsys.addConstraintP2PCoincident(p1,center,-1); + int i=GCSsys.addConstraintP2PCoincident(p1,center,-1); + GCSsys.rescaleConstraint(i-1, 0.01); + GCSsys.rescaleConstraint(i, 0.01); } } else if (Geoms[geoId].type == Arc) { GCS::Point ¢er = Points[Geoms[geoId].midPointId]; @@ -1531,7 +1533,9 @@ int Sketch::initMove(int geoId, PointPos pos) p1.y = &MoveParameters[3]; *p1.x = *center.x; *p1.y = *center.y; - GCSsys.addConstraintP2PCoincident(p1,center,-1); + int i=GCSsys.addConstraintP2PCoincident(p1,center,-1); + GCSsys.rescaleConstraint(i-1, 0.01); + GCSsys.rescaleConstraint(i, 0.01); } } InitParameters = MoveParameters; diff --git a/src/Mod/Sketcher/App/freegcs/GCS.cpp b/src/Mod/Sketcher/App/freegcs/GCS.cpp index fb8c78f2a..e20a03eca 100644 --- a/src/Mod/Sketcher/App/freegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/freegcs/GCS.cpp @@ -403,6 +403,14 @@ int System::addConstraintP2PSymmetric(Point &p1, Point &p2, Line &l, int tagId) return addConstraintMidpointOnLine(p1, p2, l.p1, l.p2, tagId); } +void System::rescaleConstraint(int id, double coeff) +{ + if (id >= clist.size() || id < 0) + return; + if (clist[id]) + clist[id]->rescale(coeff); +} + void System::initSolution(VEC_pD ¶ms) { diff --git a/src/Mod/Sketcher/App/freegcs/GCS.h b/src/Mod/Sketcher/App/freegcs/GCS.h index ce30a3013..9e809c6c2 100644 --- a/src/Mod/Sketcher/App/freegcs/GCS.h +++ b/src/Mod/Sketcher/App/freegcs/GCS.h @@ -74,7 +74,7 @@ namespace GCS System(); System(std::vector clist_); ~System(); - + void clear(); void clearByTag(int tagId); @@ -124,6 +124,7 @@ namespace GCS int addConstraintEqualRadius(Circle &c1, Arc &a2, int tagId=0); int addConstraintEqualRadius(Arc &a1, Arc &a2, int tagId=0); int addConstraintP2PSymmetric(Point &p1, Point &p2, Line &l, int tagId=0); + void rescaleConstraint(int id, double coeff); void initSolution(VEC_pD ¶ms);