From 427d3d48c29e86c33687657e175ef72da186634e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 20 Oct 2018 22:18:27 +0300 Subject: [PATCH] Fixing a notch distortion. User may assume a notch is not precisely position because of accuracy issue. To avoid this force search of "real intersection". --HG-- branch : develop --- src/libs/vpatterndb/vpiece.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index fb08f8578..31096bab3 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -316,6 +316,16 @@ bool FixNotchPoint(const QVector &seamAllowance, const QPointF ¬chBa } } } + else + { // Fixing distortion + QLineF axis = QLineF(notchBase, *notch); + axis.setLength(axis.length() + accuracyPointOnLine * 10); + const QVector points = VAbstractCurve::CurveIntersectLine(seamAllowance, axis); + if (points.size() == 1) + { + *notch = points.first(); + } + } return fixed; }