Fixed Issue #33.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-02 20:09:55 +02:00
parent 5388285b63
commit ee11cc2e93

View file

@ -64,13 +64,14 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
const qreal &length) const qreal &length)
{ {
QLineF line = QLineF(p1Line, p2Line); QLineF line = QLineF(p1Line, p2Line);
qreal toolLength = length;
qreal dist = line.length(); qreal dist = line.length();
if (dist>length) if (dist>toolLength)
{ {
qDebug()<<"A3П2="<<toMM(length)<<"А30П ="<<toMM(dist); qWarning()<<"Correction of length in shoulder point tool. Parameter length too small.";
throw "Не можу знайти точку плеча. Довжина А3П2 < А3П."; toolLength = dist;
} }
if (fabs(dist - length) < 0.1) if (qFuzzyCompare(dist, toolLength))
{ {
return line.p2(); return line.p2();
} }
@ -79,7 +80,7 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
{ {
line.setLength(line.length()+step); line.setLength(line.length()+step);
QLineF line2 = QLineF(pShoulder, line.p2()); QLineF line2 = QLineF(pShoulder, line.p2());
if (line2.length()>=length) if (line2.length()>=toolLength)
{ {
return line.p2(); return line.p2();
} }