Fix seam allowance bug.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-17 11:00:04 +02:00
parent cf5afffd60
commit 4237456228

View File

@ -447,10 +447,30 @@ QVector<QPointF> VAbstractPiece::EkvPoint(const VSAPoint &p1Line1, const VSAPoin
} }
else else
{ {
const QLineF bigEdge = ParallelLine(bigLine1.p2(), bigLine2.p1(), localWidth ); const qreal result1 = PointPosition(CrosPoint, QLineF(p1Line1, p2Line1));
points.append(bigEdge.p1()); const qreal result2 = PointPosition(CrosPoint, QLineF(p2Line2, p1Line2));
points.append(bigEdge.p2());
return points; if (result1 <=0 && result2 <= 0)
{
if (line.length() >= localWidth)
{
points.append(CrosPoint);
return points;
}
else
{
line.setLength(localWidth);
points.append(line.p2());
return points;
}
}
else
{
const QLineF bigEdge = ParallelLine(bigLine1.p2(), bigLine2.p1(), localWidth );
points.append(bigEdge.p1());
points.append(bigEdge.p2());
return points;
}
} }
} }
break; break;