From 669ce4061a49bd27f520841a168e92b7fc63a025 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 13 May 2024 18:51:13 +0300 Subject: [PATCH] Fix piece mirroring. --- src/app/share/collection/bugs/fold_line.val | 36 +- src/libs/vlayout/vabstractpiece.h | 139 +++- src/libs/vlayout/vlayoutpiece.cpp | 7 +- src/libs/vpatterndb/vpiece.cpp | 8 +- src/libs/vpatterndb/vpiecepath.cpp | 8 +- .../tools/piece/dialogseamallowance.cpp | 27 +- src/libs/vtools/tools/vtoolseamallowance.cpp | 8 +- .../input.json | 34 + .../output.json | 64 ++ .../input.json | 34 + .../output.json | 64 ++ .../input.json | 34 + .../output.json | 52 ++ .../input.json | 34 + .../output.json | 52 ++ .../input.json | 281 +++++++ .../output.json | 542 ++++++++++++++ .../input.json | 0 .../output.json | 26 +- .../input.json | 0 .../output.json | 26 +- .../input.json | 0 .../output.json | 26 +- .../input.json | 0 .../output.json | 14 +- .../share/full_seam_path_case_5/input.json | 352 +++++++++ .../share/full_seam_path_case_5/output.json | 698 ++++++++++++++++++ src/test/ValentinaTest/share/test_data.qrc | 28 +- src/test/ValentinaTest/tst_vabstractpiece.cpp | 86 ++- src/test/ValentinaTest/tst_vabstractpiece.h | 6 +- 30 files changed, 2546 insertions(+), 140 deletions(-) create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_1/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_1/output.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_2/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_2/output.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_3/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_3/output.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_4/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_4/output.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_5/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_allowance_path_case_5/output.json rename src/test/ValentinaTest/share/{full_path_case_1 => full_seam_path_case_1}/input.json (100%) rename src/test/ValentinaTest/share/{full_path_case_2 => full_seam_path_case_1}/output.json (65%) rename src/test/ValentinaTest/share/{full_path_case_2 => full_seam_path_case_2}/input.json (100%) rename src/test/ValentinaTest/share/{full_path_case_3 => full_seam_path_case_2}/output.json (64%) rename src/test/ValentinaTest/share/{full_path_case_3 => full_seam_path_case_3}/input.json (100%) rename src/test/ValentinaTest/share/{full_path_case_4 => full_seam_path_case_3}/output.json (64%) rename src/test/ValentinaTest/share/{full_path_case_4 => full_seam_path_case_4}/input.json (100%) rename src/test/ValentinaTest/share/{full_path_case_1 => full_seam_path_case_4}/output.json (80%) create mode 100644 src/test/ValentinaTest/share/full_seam_path_case_5/input.json create mode 100644 src/test/ValentinaTest/share/full_seam_path_case_5/output.json diff --git a/src/app/share/collection/bugs/fold_line.val b/src/app/share/collection/bugs/fold_line.val index 93247734a..97124bf8e 100644 --- a/src/app/share/collection/bugs/fold_line.val +++ b/src/app/share/collection/bugs/fold_line.val @@ -1,7 +1,7 @@ - - 0.9.4 + + 0.9.6 cm @@ -25,63 +25,63 @@ - - - - - - - - + + + + + + + +
- + - + - + - + - + - + - + - +
diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index afa4d174d..e8014e31f 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -37,10 +37,13 @@ #include #include +#include "../ifc/exception/vexception.h" +#include "../vgeometry/vabstractcurve.h" #include "../vgeometry/vgeometrydef.h" #include "../vgeometry/vgobject.h" #include "../vmisc/compatibility.h" #include "../vmisc/testpath.h" +#include "../vmisc/vabstractapplication.h" #include "vrawsapoint.h" #include "vsapoint.h" @@ -184,7 +187,12 @@ public: template static auto MirrorPath(const QVector &points, const QLineF &mirrorLine) -> QVector; - template static auto FullPath(const QVector &points, const QLineF &mirrorLine) -> QVector; + template + static auto FullSeamPath(const QVector &points, const QLineF &mirrorLine, const QString &pieceName) + -> QVector; + template + static auto FullSeamAllowancePath(const QVector &points, const QLineF &mirrorLine, const QString &pieceName) + -> QVector; template static auto MapVector(QVector points, const QTransform &matrix, bool mirror = false) -> QVector; @@ -859,7 +867,8 @@ inline auto VAbstractPiece::MirrorPath(const QVector //--------------------------------------------------------------------------------------------------------------------- template -inline auto VAbstractPiece::FullPath(const QVector &points, const QLineF &mirrorLine) -> QVector +inline auto VAbstractPiece::FullSeamPath(const QVector &points, const QLineF &mirrorLine, const QString &pieceName) + -> QVector { // DumpVector(points, QStringLiteral("input.json.XXXXXX")); // Uncomment for dumping test data @@ -873,62 +882,122 @@ inline auto VAbstractPiece::FullPath(const QVector &points, const QLineF &mir return points; } - // points = CorrectFullPathInput(points, mirrorLine); - - bool closedPath = (points.constFirst() == points.constLast()); - bool pathReady = false; QVector base; + base.reserve(points.size()); - if (VFuzzyComparePoints(points.constFirst(), mirrorLine.p2())) + if (VFuzzyComparePoints(points.constFirst(), mirrorLine.p1()) && + VFuzzyComparePoints(points.constLast(), mirrorLine.p2())) { - if (closedPath) - { - if (VFuzzyComparePoints(points.at(points.size() - 2), mirrorLine.p1())) - { - base = points; - base.removeLast(); - pathReady = true; - } - } - else - { - if (VFuzzyComparePoints(points.constLast(), mirrorLine.p1())) - { - base = points; - pathReady = true; - } - } + base = points; } - - if (!pathReady) + else { QVector sub1; QVector sub2; if (!VAbstractPiece::SubdividePath(points, mirrorLine.p1(), sub1, sub2)) { + const QString errorMsg = QObject::tr("Piece '%1'. Unable to generate full seam path.").arg(pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractApplication::warningMessageSignature + errorMsg; return points; } - QVector reversed = points; - std::reverse(reversed.begin(), reversed.end()); + sub2 += points.constFirst(); QVector sub3; QVector sub4; - if (!VAbstractPiece::SubdividePath(reversed, mirrorLine.p2(), sub3, sub4)) + if (!VAbstractPiece::SubdividePath(points, mirrorLine.p2(), sub3, sub4)) + { + const QString errorMsg = QObject::tr("Piece '%1'. Unable to generate full seam path.").arg(pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractApplication::warningMessageSignature + errorMsg; + return points; + } + + base = sub2 + sub3; + } + + QVector fullPath = MirrorPath(base, mirrorLine); + std::reverse(fullPath.begin(), fullPath.end()); + fullPath += base; + + // DumpVector(fullPath, QStringLiteral("output.json.XXXXXX")); // Uncomment for dumping test data + + return fullPath; +} + +//--------------------------------------------------------------------------------------------------------------------- +template +inline auto VAbstractPiece::FullSeamAllowancePath(const QVector &points, const QLineF &mirrorLine, + const QString &pieceName) -> QVector +{ + // DumpVector(points, QStringLiteral("input.json.XXXXXX")); // Uncomment for dumping test data + + if (mirrorLine.isNull()) + { + return points; + } + + if (points.size() <= 3) + { + return points; + } + + QVector base; + base.reserve(points.size()); + + QVector sub1; + QVector sub2; + if (!VAbstractPiece::SubdividePath(points, mirrorLine.p1(), sub1, sub2)) + { + const QString errorMsg = QObject::tr("Piece '%1'. Unable to generate full seam allowance path.").arg(pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractApplication::warningMessageSignature + errorMsg; + return points; + } + + QVector subPath; + CastTo(sub2, subPath); + if (VAbstractCurve::IsPointOnCurve(subPath, mirrorLine.p2())) + { + std::reverse(sub2.begin(), sub2.end()); + + QVector sub3; + QVector sub4; + if (!VAbstractPiece::SubdividePath(sub2, mirrorLine.p2(), sub3, sub4)) + { + const QString errorMsg = + QObject::tr("Piece '%1'. Unable to generate full seam allowance path.").arg(pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractApplication::warningMessageSignature + errorMsg; + return points; + } + + std::reverse(sub4.begin(), sub4.end()); + base = sub4; + } + else + { + std::reverse(sub1.begin(), sub1.end()); + + QVector sub3; + QVector sub4; + if (!VAbstractPiece::SubdividePath(sub1, mirrorLine.p2(), sub3, sub4)) { return points; } - base = sub3; - std::reverse(base.begin(), base.end()); - base += sub1; - pathReady = true; + std::reverse(sub4.begin(), sub4.end()); + + base = sub2 + sub4; } QVector fullPath = MirrorPath(base, mirrorLine); - std::reverse(fullPath.begin(), fullPath.end()); - fullPath += base; // DumpVector(fullPath, QStringLiteral("output.json.XXXXXX")); // Uncomment for dumping test data diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 56fd9bd99..b2fc869c5 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -790,7 +790,7 @@ auto VLayoutPiece::GetFullContourPoints() const -> QVector points.reserve(d->m_contour.size()); if (!d->m_seamMirrorLine.isNull() && IsShowFullPiece()) { - points = VAbstractPiece::FullPath(d->m_contour, d->m_seamMirrorLine); + points = VAbstractPiece::FullSeamPath(d->m_contour, d->m_seamMirrorLine, GetName()); points = CheckLoops(CorrectEquidistantPoints(points)); // A path can contains loops } else @@ -834,7 +834,7 @@ auto VLayoutPiece::GetFullSeamAllowancePoints() const -> QVector points.reserve(d->m_seamAllowance.size()); if (!d->m_seamAllowanceMirrorLine.isNull() && IsShowFullPiece()) { - points = VAbstractPiece::FullPath(d->m_seamAllowance, d->m_seamAllowanceMirrorLine); + points = VAbstractPiece::FullSeamAllowancePath(d->m_seamAllowance, d->m_seamAllowanceMirrorLine, GetName()); points = CheckLoops(CorrectEquidistantPoints(points)); // A path can contains loops } else @@ -1378,7 +1378,8 @@ auto VLayoutPiece::Diagonal() const -> qreal //--------------------------------------------------------------------------------------------------------------------- auto VLayoutPiece::FoldLine() const -> VFoldLine { - QLineF const foldLine = IsHideMainPath() ? GetSeamAllowanceMirrorLine() : GetSeamMirrorLine(); + QLineF foldLine = IsHideMainPath() ? GetSeamAllowanceMirrorLine() : GetSeamMirrorLine(); + Swap(foldLine); VFoldLine fLine(foldLine, GetFoldLineType()); fLine.SetLabelSvgFontSize(GetFoldLineSvgFontSize()); fLine.SetLabelFontItalic(IsFoldLineLabelFontItalic()); diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 6ab9d4ec3..d6432a848 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -203,7 +203,7 @@ auto VPiece::FullMainPathPoints(const VContainer *data) const -> QVector QVector quint32 nextIndex = 0; } - int prevIndex = index - 1; - if (prevIndex < 0) - { - prevIndex = uiTabPaths->listWidgetMainPath->count() - 1; - } - - const int next = FindNotExcludedNeighborNodeDown(uiTabPaths->listWidgetMainPath, nextIndex); - const int prev = FindNotExcludedNeighborNodeUp(uiTabPaths->listWidgetMainPath, prevIndex); - - if (next >= 0 && RowNode(uiTabPaths->listWidgetMainPath, next).GetId() == endPoint) - { - return startPoint; - } - - if (prev >= 0 && RowNode(uiTabPaths->listWidgetMainPath, prev).GetId() == endPoint) + if (const int next = FindNotExcludedNeighborNodeDown(uiTabPaths->listWidgetMainPath, nextIndex); + next >= 0 && RowNode(uiTabPaths->listWidgetMainPath, next).GetId() == endPoint) { return endPoint; } @@ -738,14 +725,14 @@ auto DialogSeamAllowance::GetMirrorLineEndPoint() const -> quint32 return endPoint; } - int nextIndex = index + 1; - if (nextIndex >= uiTabPaths->listWidgetMainPath->count()) + int prevIndex = index - 1; + if (prevIndex < 0) { - nextIndex = 0; + prevIndex = uiTabPaths->listWidgetMainPath->count() - 1; } - if (const int next = FindNotExcludedNeighborNodeDown(uiTabPaths->listWidgetMainPath, nextIndex); - next >= 0 && RowNode(uiTabPaths->listWidgetMainPath, next).GetId() == startPoint) + if (const int prev = FindNotExcludedNeighborNodeUp(uiTabPaths->listWidgetMainPath, prevIndex); + prev >= 0 && RowNode(uiTabPaths->listWidgetMainPath, prev).GetId() == startPoint) { return startPoint; } diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index f92924a0c..295e93d07 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -310,8 +310,8 @@ auto RenderPassmarks(const VPiece &detail, const VContainer *data) -> QPainterPa //--------------------------------------------------------------------------------------------------------------------- auto RenderFoldLine(const VPiece &detail, const VContainer *data) -> VFoldLine { - QLineF const foldLine = - detail.IsHideMainPath() ? detail.SeamAllowanceMirrorLine(data) : detail.SeamMirrorLine(data); + QLineF foldLine = detail.IsHideMainPath() ? detail.SeamAllowanceMirrorLine(data) : detail.SeamMirrorLine(data); + Swap(foldLine); VFoldLine fLine(foldLine, detail.GetFoldLineType()); fLine.SetLabelSvgFontSize(detail.GetFoldLineSvgFontSize()); fLine.SetLabelFontItalic(detail.IsFoldLineLabelFontItalic()); @@ -1845,8 +1845,8 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren) QFuture const futureMirrorLine = QtConcurrent::run( [this, detail]() { - QLineF const mirrorLine = detail.SeamAllowanceMirrorLine(getData()); - if (detail.IsShowFullPiece() && detail.IsShowMirrorLine() && !mirrorLine.isNull()) + if (QLineF const mirrorLine = detail.SeamAllowanceMirrorLine(getData()); + detail.IsShowFullPiece() && detail.IsShowMirrorLine() && !mirrorLine.isNull()) { QPainterPath path; path.moveTo(mirrorLine.p1()); diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/input.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/input.json new file mode 100644 index 000000000..56f26f166 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 409.41251753118934 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/output.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/output.json new file mode 100644 index 000000000..0044d8fb4 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_1/output.json @@ -0,0 +1,64 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.5038110236219 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 1014.9004168596568, + "y": 767.0031162575267 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 281.2274201018982, + "y": 1158.295381194997 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 281.2274201018982, + "y": 1158.295381194997 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551739, + "y": 616.3778267716527 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551569, + "y": 616.3778267716535 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.503811023622 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/input.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/input.json new file mode 100644 index 000000000..ca46380e8 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 409.41251753118934 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/output.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/output.json new file mode 100644 index 000000000..7cd4d38c5 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_2/output.json @@ -0,0 +1,64 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.5038110236219 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 1014.9004168596568, + "y": 767.0031162575267 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 1014.9004168596568, + "y": 767.0031162575267 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 281.2274201018982, + "y": 1158.295381194997 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551739, + "y": 616.3778267716527 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551569, + "y": 616.3778267716535 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.503811023622 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/input.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/input.json new file mode 100644 index 000000000..ef7a3da95 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 409.41251753118934 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/output.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/output.json new file mode 100644 index 000000000..7791b28bc --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_3/output.json @@ -0,0 +1,52 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.5038110236219 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 1014.9004168596568, + "y": 767.0031162575267 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 281.2274201018982, + "y": 1158.295381194997 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551739, + "y": 616.3778267716527 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551569, + "y": 616.3778267716535 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.503811023622 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/input.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/input.json new file mode 100644 index 000000000..ef7a3da95 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 409.41251753118934 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551455, + "y": 617.2865332792207 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/output.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/output.json new file mode 100644 index 000000000..7791b28bc --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_4/output.json @@ -0,0 +1,52 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.5038110236219 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 1014.9004168596568, + "y": 767.0031162575267 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 281.2274201018982, + "y": 1158.295381194997 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551739, + "y": 616.3778267716527 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551569, + "y": 616.3778267716535 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -7.795275590551179, + "y": 2.2045984251969912 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 2.204598425196849 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 823.7007874015749, + "y": 408.503811023622 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/input.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/input.json new file mode 100644 index 000000000..a65354798 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/input.json @@ -0,0 +1,281 @@ +{ + "vector": [ + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 36.9137007874006, + "y": 4616.695763770595 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 36.9137007874016, + "y": 605.2736038347447 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 41.9345098304893, + "y": 600.6562142168897 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 60.074661998136406, + "y": 582.4877296154799 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 77.58132867281772, + "y": 563.4953401212488 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 94.45423808036008, + "y": 543.7608453315845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 110.69345783012349, + "y": 523.3678493289809 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 126.29962358008767, + "y": 502.401412767764 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 141.2243150313326, + "y": 481.01902420937046 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 162.6018486002313, + "y": 448.12230410343193 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 188.83309438827675, + "y": 403.27052112932745 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 212.55557144260646, + "y": 358.1279033888063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 233.85741829671863, + "y": 313.3300935306681 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 252.79095513869876, + "y": 269.5883850848603 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 269.41490959522463, + "y": 227.61339019938063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 283.7930282321881, + "y": 188.11431602413887 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 295.9713210956858, + "y": 151.8629977462223 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 310.6058715635909, + "y": 104.23807090168894 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 322.8505580083743, + "y": 58.976756281736286 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 334.8640751080003, + "y": 10.054205359413189 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 588.9424711544196, + "y": 72.08289713668196 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 576.5312660411352, + "y": 134.14902340936058 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 529.6503386249901, + "y": 340.79913994234107 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 507.04557085310904, + "y": 445.7241324452602 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 491.9087432893767, + "y": 520.0041560459199 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 477.24721477055976, + "y": 596.7324533350654 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 463.64853581687305, + "y": 674.2374220280692 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 451.5126820023436, + "y": 751.8460863823228 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 441.40565057153174, + "y": 827.9744367453726 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 433.8278394035618, + "y": 901.3602999133718 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 430.214261148604, + "y": 953.5830694704541 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.7935054873125, + "y": 986.7905608539021 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.27246369363917, + "y": 1018.5722030466677 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.7046564198419, + "y": 1048.6689126996955 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 430.13280039213873, + "y": 1076.8775484094963 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 432.5866982659403, + "y": 1102.9819301312384 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 940.3811512782529, + "y": 4563.745989933869 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 870.3386547012424, + "y": 4571.863306074689 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 754.6269318040638, + "y": 4583.5473932901805 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 634.1134776917493, + "y": 4593.8396840990845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 509.4119225548849, + "y": 4602.472823743518 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 380.25191189642146, + "y": 4609.264635662396 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 246.6532532036761, + "y": 4614.003747576252 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 108.97446670748032, + "y": 4616.472813085256 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 36.9137007874006, + "y": 4616.695763770595 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/output.json b/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/output.json new file mode 100644 index 000000000..45d4fa8a9 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_allowance_path_case_5/output.json @@ -0,0 +1,542 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055121, + "y": 4616.693036243291 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -33.38391552637877, + "y": 4616.472813085256 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -171.06270202257454, + "y": 4614.003747576252 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -304.6613607153199, + "y": 4609.264635662396 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -433.82137137378334, + "y": 4602.472823743518 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -558.5229265106477, + "y": 4593.8396840990845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -679.0363806229623, + "y": 4583.5473932901805 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -794.7481035201408, + "y": 4571.863306074689 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -864.7906000971514, + "y": 4563.745989933869 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -356.99614708483875, + "y": 1102.9819301312384 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -354.5422492110372, + "y": 1076.8775484094963 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -353.11410523874036, + "y": 1048.6689126996955 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -352.6819125125376, + "y": 1018.5722030466677 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -353.2029543062109, + "y": 986.7905608539021 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -354.62370996750246, + "y": 953.5830694704541 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -358.2372882224603, + "y": 901.3602999133718 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -365.8150993904302, + "y": 827.9744367453726 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -375.92213082124204, + "y": 751.8460863823228 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -388.0579846357715, + "y": 674.2374220280692 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -401.6566635894582, + "y": 596.7324533350654 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -416.3181921082751, + "y": 520.0041560459199 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -431.4550196720075, + "y": 445.7241324452602 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -454.0597874438886, + "y": 340.79913994234107 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -500.9407148600336, + "y": 134.14902340936058 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -513.3519199733181, + "y": 72.08289713668196 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -259.27352392689875, + "y": 10.054205359413189 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -247.26000682727278, + "y": 58.976756281736286 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -235.01532038248934, + "y": 104.23807090168894 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -220.38076991458428, + "y": 151.8629977462223 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -208.20247705108653, + "y": 188.11431602413887 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -193.82435841412308, + "y": 227.61339019938063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -177.20040395759722, + "y": 269.5883850848603 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -158.2668671156171, + "y": 313.3300935306681 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -136.96502026150492, + "y": 358.1279033888063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -113.2425432071752, + "y": 403.27052112932745 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -87.01129741912976, + "y": 448.12230410343193 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -65.63376385023105, + "y": 481.01902420937046 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -50.70907239898612, + "y": 502.401412767764 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -35.102906649021946, + "y": 523.3678493289809 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -18.86368689925854, + "y": 543.7608453315845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -1.9907774917161731, + "y": 563.4953401212488 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 15.51588918296514, + "y": 582.4877296154799 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 33.65604135061225, + "y": 600.6562142168897 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.795275590550226, + "y": 604.4628631137784 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055132, + "y": 604.4628631137784 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 41.9345098304893, + "y": 600.6562142168897 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 60.074661998136406, + "y": 582.4877296154799 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 77.58132867281772, + "y": 563.4953401212488 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 94.45423808036008, + "y": 543.7608453315845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 110.69345783012349, + "y": 523.3678493289809 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 126.29962358008767, + "y": 502.401412767764 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 141.2243150313326, + "y": 481.01902420937046 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 162.6018486002313, + "y": 448.12230410343193 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 188.83309438827675, + "y": 403.27052112932745 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 212.55557144260646, + "y": 358.1279033888063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 233.85741829671863, + "y": 313.3300935306681 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 252.79095513869876, + "y": 269.5883850848603 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 269.41490959522463, + "y": 227.61339019938063 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 283.7930282321881, + "y": 188.11431602413887 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 295.9713210956858, + "y": 151.8629977462223 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 310.6058715635909, + "y": 104.23807090168894 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 322.8505580083743, + "y": 58.976756281736286 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 334.8640751080003, + "y": 10.054205359413189 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 588.9424711544196, + "y": 72.08289713668196 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 576.5312660411352, + "y": 134.14902340936058 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 529.6503386249901, + "y": 340.79913994234107 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 507.04557085310904, + "y": 445.7241324452602 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 491.9087432893767, + "y": 520.0041560459199 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 477.24721477055976, + "y": 596.7324533350654 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 463.64853581687305, + "y": 674.2374220280692 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 451.5126820023436, + "y": 751.8460863823228 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 441.40565057153174, + "y": 827.9744367453726 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 433.8278394035618, + "y": 901.3602999133718 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 430.214261148604, + "y": 953.5830694704541 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.7935054873125, + "y": 986.7905608539021 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.27246369363917, + "y": 1018.5722030466677 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 428.7046564198419, + "y": 1048.6689126996955 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 430.13280039213873, + "y": 1076.8775484094963 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 432.5866982659403, + "y": 1102.9819301312384 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 940.3811512782529, + "y": 4563.745989933869 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 870.3386547012424, + "y": 4571.863306074689 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 754.6269318040638, + "y": 4583.5473932901805 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 634.1134776917493, + "y": 4593.8396840990845 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 509.4119225548849, + "y": 4602.472823743518 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 380.25191189642146, + "y": 4609.264635662396 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 246.6532532036761, + "y": 4614.003747576252 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 108.97446670748032, + "y": 4616.472813085256 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055033, + "y": 4616.693036243291 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_path_case_1/input.json b/src/test/ValentinaTest/share/full_seam_path_case_1/input.json similarity index 100% rename from src/test/ValentinaTest/share/full_path_case_1/input.json rename to src/test/ValentinaTest/share/full_seam_path_case_1/input.json diff --git a/src/test/ValentinaTest/share/full_path_case_2/output.json b/src/test/ValentinaTest/share/full_seam_path_case_1/output.json similarity index 65% rename from src/test/ValentinaTest/share/full_path_case_2/output.json rename to src/test/ValentinaTest/share/full_seam_path_case_1/output.json index 5f4f6a589..17f6fd466 100644 --- a/src/test/ValentinaTest/share/full_path_case_2/output.json +++ b/src/test/ValentinaTest/share/full_seam_path_case_1/output.json @@ -3,26 +3,32 @@ { "turnPoint": true, "type": "VLayoutPoint", - "x": 785.9055118110238, - "y": 417.9526299212599 + "x": 785.9055118110235, + "y": 417.9526299212598 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 963.7656322371467, + "x": 963.7656322371464, "y": 751.4403557202411 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 296.79018063918437, - "y": 1107.160596572487 + "x": 296.79018063918403, + "y": 1107.1605965724868 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 29.999999999999886, - "y": 606.9290078740154 + "x": 296.79018063918403, + "y": 1107.1605965724868 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 29.99999999999966, + "y": 606.9290078740152 }, { "turnPoint": true, @@ -36,6 +42,12 @@ "x": 30, "y": 39.999874015748034 }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 30, + "y": 39.999874015748034 + }, { "turnPoint": true, "type": "VLayoutPoint", diff --git a/src/test/ValentinaTest/share/full_path_case_2/input.json b/src/test/ValentinaTest/share/full_seam_path_case_2/input.json similarity index 100% rename from src/test/ValentinaTest/share/full_path_case_2/input.json rename to src/test/ValentinaTest/share/full_seam_path_case_2/input.json diff --git a/src/test/ValentinaTest/share/full_path_case_3/output.json b/src/test/ValentinaTest/share/full_seam_path_case_2/output.json similarity index 64% rename from src/test/ValentinaTest/share/full_path_case_3/output.json rename to src/test/ValentinaTest/share/full_seam_path_case_2/output.json index 5f4f6a589..14c1d3785 100644 --- a/src/test/ValentinaTest/share/full_path_case_3/output.json +++ b/src/test/ValentinaTest/share/full_seam_path_case_2/output.json @@ -3,26 +3,32 @@ { "turnPoint": true, "type": "VLayoutPoint", - "x": 785.9055118110238, - "y": 417.9526299212599 + "x": 785.9055118110235, + "y": 417.9526299212598 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 963.7656322371467, + "x": 963.7656322371464, "y": 751.4403557202411 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 296.79018063918437, - "y": 1107.160596572487 + "x": 963.7656322371464, + "y": 751.4403557202411 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 29.999999999999886, - "y": 606.9290078740154 + "x": 296.79018063918403, + "y": 1107.1605965724868 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 29.99999999999966, + "y": 606.9290078740152 }, { "turnPoint": true, @@ -42,6 +48,12 @@ "x": 785.9055118110236, "y": 39.999874015748034 }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 785.9055118110236, + "y": 39.999874015748034 + }, { "turnPoint": true, "type": "VLayoutPoint", diff --git a/src/test/ValentinaTest/share/full_path_case_3/input.json b/src/test/ValentinaTest/share/full_seam_path_case_3/input.json similarity index 100% rename from src/test/ValentinaTest/share/full_path_case_3/input.json rename to src/test/ValentinaTest/share/full_seam_path_case_3/input.json diff --git a/src/test/ValentinaTest/share/full_path_case_4/output.json b/src/test/ValentinaTest/share/full_seam_path_case_3/output.json similarity index 64% rename from src/test/ValentinaTest/share/full_path_case_4/output.json rename to src/test/ValentinaTest/share/full_seam_path_case_3/output.json index 5f4f6a589..7b6afe5e0 100644 --- a/src/test/ValentinaTest/share/full_path_case_4/output.json +++ b/src/test/ValentinaTest/share/full_seam_path_case_3/output.json @@ -3,26 +3,32 @@ { "turnPoint": true, "type": "VLayoutPoint", - "x": 785.9055118110238, - "y": 417.9526299212599 + "x": 785.9055118110235, + "y": 417.9526299212598 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 963.7656322371467, + "x": 785.9055118110235, + "y": 417.9526299212598 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 963.7656322371464, "y": 751.4403557202411 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 296.79018063918437, - "y": 1107.160596572487 + "x": 296.79018063918403, + "y": 1107.1605965724868 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 29.999999999999886, - "y": 606.9290078740154 + "x": 29.99999999999966, + "y": 606.9290078740152 }, { "turnPoint": true, @@ -42,6 +48,12 @@ "x": 785.9055118110236, "y": 39.999874015748034 }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 785.9055118110236, + "y": 417.95262992125987 + }, { "turnPoint": true, "type": "VLayoutPoint", diff --git a/src/test/ValentinaTest/share/full_path_case_4/input.json b/src/test/ValentinaTest/share/full_seam_path_case_4/input.json similarity index 100% rename from src/test/ValentinaTest/share/full_path_case_4/input.json rename to src/test/ValentinaTest/share/full_seam_path_case_4/input.json diff --git a/src/test/ValentinaTest/share/full_path_case_1/output.json b/src/test/ValentinaTest/share/full_seam_path_case_4/output.json similarity index 80% rename from src/test/ValentinaTest/share/full_path_case_1/output.json rename to src/test/ValentinaTest/share/full_seam_path_case_4/output.json index 5f4f6a589..6aaa23fec 100644 --- a/src/test/ValentinaTest/share/full_path_case_1/output.json +++ b/src/test/ValentinaTest/share/full_seam_path_case_4/output.json @@ -3,26 +3,26 @@ { "turnPoint": true, "type": "VLayoutPoint", - "x": 785.9055118110238, - "y": 417.9526299212599 + "x": 785.9055118110235, + "y": 417.9526299212598 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 963.7656322371467, + "x": 963.7656322371464, "y": 751.4403557202411 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 296.79018063918437, - "y": 1107.160596572487 + "x": 296.79018063918403, + "y": 1107.1605965724868 }, { "turnPoint": true, "type": "VLayoutPoint", - "x": 29.999999999999886, - "y": 606.9290078740154 + "x": 29.99999999999966, + "y": 606.9290078740152 }, { "turnPoint": true, diff --git a/src/test/ValentinaTest/share/full_seam_path_case_5/input.json b/src/test/ValentinaTest/share/full_seam_path_case_5/input.json new file mode 100644 index 000000000..1c699bf76 --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_path_case_5/input.json @@ -0,0 +1,352 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055022, + "y": 4578.897637795276 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.795275590551185, + "y": 655.1181102362208 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.795275590551185, + "y": 655.1181102362208 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 48.11330733562335, + "y": 646.3220281769442 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 68.11159807829985, + "y": 627.9305898135977 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 87.35366813525626, + "y": 608.6584662780207 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 105.84963596342732, + "y": 588.5928174830145 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 123.60962001974778, + "y": 567.8208033413807 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 140.64373876115238, + "y": 546.4295837659206 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 156.96211064457586, + "y": 524.5063186694358 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 172.574854126953, + "y": 502.1381679647278 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 194.77809175544016, + "y": 467.97081692977804 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 221.89122979713324, + "y": 421.6111208246406 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 246.36398645946633, + "y": 375.0407607170372 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 268.2773093979174, + "y": 328.9570159093795 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 287.71214626796444, + "y": 284.0571657040797 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 304.7494447250854, + "y": 241.03848940354942 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 319.47015242475845, + "y": 200.59826631020076 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 331.9552170224613, + "y": 163.43377572644556 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 346.9222153445892, + "y": 114.72697043462362 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 359.44985779391016, + "y": 68.4197359536168 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 362.56773204621277, + "y": 55.722841229721126 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 362.56773204621277, + "y": 55.722841229721126 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 544.7753249914322, + "y": 100.20556309093837 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 544.7753249914322, + "y": 100.20556309093837 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 539.5648027495536, + "y": 126.26241481961382 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 519.8790703368991, + "y": 213.06174513618444 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 492.7920303327728, + "y": 332.4356498334462 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 470.09816651287895, + "y": 437.7634685605543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 454.87483032055127, + "y": 512.4561664338988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 440.1238659323592, + "y": 589.6373967459333 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 426.36142861541464, + "y": 668.0504681285502 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 414.1036736368294, + "y": 746.4386892136426 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 403.8667562637154, + "y": 823.545368633103 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 396.1668317631845, + "y": 898.1138150188241 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 392.4747978817294, + "y": 951.4704108870988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 391.01147584881875, + "y": 985.6728111470543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 390.47273937180427, + "y": 1018.5337642540146 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 390.923107859075, + "y": 1049.896183786966 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 392.4271007190198, + "y": 1079.602983324896 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 395.04923736002786, + "y": 1107.4970764467905 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 396.8503937007874, + "y": 1120.6299212598428 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 396.8503937007874, + "y": 1120.6299212598428 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 459.40177523139084, + "y": 1546.82826956488 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 486.84309077894795, + "y": 1733.8016516949633 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 517.0285378812608, + "y": 1939.4723720380553 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 582.887695195398, + "y": 2388.2084891502564 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 897.3304676210354, + "y": 4530.686950398792 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 897.3304676210354, + "y": 4530.686950398792 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 865.9876323817209, + "y": 4534.319312390735 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 750.831165530308, + "y": 4545.943204489453 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 631.2007507013604, + "y": 4556.1555925219345 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 507.11424597834866, + "y": 4564.746151974763 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 378.5895094447428, + "y": 4571.504558334514 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 245.64439918401308, + "y": 4576.220487087769 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 108.29677327962963, + "y": 4578.683613721105 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055022, + "y": 4578.897637795276 + } + ] +} diff --git a/src/test/ValentinaTest/share/full_seam_path_case_5/output.json b/src/test/ValentinaTest/share/full_seam_path_case_5/output.json new file mode 100644 index 000000000..3cb18912c --- /dev/null +++ b/src/test/ValentinaTest/share/full_seam_path_case_5/output.json @@ -0,0 +1,698 @@ +{ + "vector": [ + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559054951, + "y": 4578.897637795276 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559054951, + "y": 4578.897637795276 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559054951, + "y": 4578.897637795276 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -32.706222098529906, + "y": 4578.683613721105 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -170.05384800291336, + "y": 4576.220487087769 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -302.9989582636431, + "y": 4571.504558334514 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -431.52369479724894, + "y": 4564.746151974763 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -555.6101995202607, + "y": 4556.1555925219345 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -675.2406143492083, + "y": 4545.943204489453 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -790.3970812006212, + "y": 4534.319312390735 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -821.7399164399357, + "y": 4530.686950398792 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -821.7399164399357, + "y": 4530.686950398792 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -507.2971440142983, + "y": 2388.2084891502564 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -441.4379867001611, + "y": 1939.4723720380553 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -411.2525395978482, + "y": 1733.8016516949633 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -383.8112240502911, + "y": 1546.82826956488 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -321.25984251968765, + "y": 1120.6299212598428 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -321.25984251968765, + "y": 1120.6299212598428 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -319.45868617892813, + "y": 1107.4970764467905 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -316.83654953792006, + "y": 1079.602983324896 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -315.3325566779753, + "y": 1049.896183786966 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -314.88218819070454, + "y": 1018.5337642540146 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -315.420924667719, + "y": 985.6728111470543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -316.88424670062966, + "y": 951.4704108870988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -320.5762805820848, + "y": 898.1138150188241 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -328.27620508261566, + "y": 823.545368633103 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -338.5131224557297, + "y": 746.4386892136426 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -350.7708774343149, + "y": 668.0504681285502 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -364.53331475125947, + "y": 589.6373967459333 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -379.28427913945154, + "y": 512.4561664338988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -394.5076153317792, + "y": 437.7634685605543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -417.2014791516731, + "y": 332.4356498334462 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -444.28851915579935, + "y": 213.06174513618444 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -463.97425156845384, + "y": 126.26241481961382 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -469.18477381033244, + "y": 100.20556309093837 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -469.18477381033244, + "y": 100.20556309093837 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": -286.97718086511304, + "y": 55.722841229721126 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": -286.97718086511304, + "y": 55.722841229721126 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -283.8593066128104, + "y": 68.4197359536168 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -271.33166416348945, + "y": 114.72697043462362 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -256.36466584136156, + "y": 163.43377572644556 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -243.87960124365873, + "y": 200.59826631020076 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -229.1588935439857, + "y": 241.03848940354942 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -212.12159508686472, + "y": 284.0571657040797 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -192.68675821681768, + "y": 328.9570159093795 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -170.7734352783666, + "y": 375.0407607170372 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -146.3006786160335, + "y": 421.6111208246406 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -119.18754057434043, + "y": 467.97081692977804 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -96.98430294585327, + "y": 502.1381679647278 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -81.37155946347613, + "y": 524.5063186694358 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -65.05318758005265, + "y": 546.4295837659206 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -48.01906883864805, + "y": 567.8208033413807 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -30.25908478232759, + "y": 588.5928174830145 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": -11.76311695415653, + "y": 608.6584662780207 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 7.478953102799878, + "y": 627.9305898135977 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 27.47724384547638, + "y": 646.3220281769442 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559054854, + "y": 655.1181102362208 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.795275590551185, + "y": 655.1181102362208 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 48.11330733562335, + "y": 646.3220281769442 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 68.11159807829985, + "y": 627.9305898135977 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 87.35366813525626, + "y": 608.6584662780207 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 105.84963596342732, + "y": 588.5928174830145 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 123.60962001974778, + "y": 567.8208033413807 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 140.64373876115238, + "y": 546.4295837659206 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 156.96211064457586, + "y": 524.5063186694358 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 172.574854126953, + "y": 502.1381679647278 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 194.77809175544016, + "y": 467.97081692977804 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 221.89122979713324, + "y": 421.6111208246406 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 246.36398645946633, + "y": 375.0407607170372 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 268.2773093979174, + "y": 328.9570159093795 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 287.71214626796444, + "y": 284.0571657040797 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 304.7494447250854, + "y": 241.03848940354942 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 319.47015242475845, + "y": 200.59826631020076 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 331.9552170224613, + "y": 163.43377572644556 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 346.9222153445892, + "y": 114.72697043462362 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 359.44985779391016, + "y": 68.4197359536168 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 362.56773204621277, + "y": 55.722841229721126 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 362.56773204621277, + "y": 55.722841229721126 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 544.7753249914322, + "y": 100.20556309093837 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 544.7753249914322, + "y": 100.20556309093837 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 539.5648027495536, + "y": 126.26241481961382 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 519.8790703368991, + "y": 213.06174513618444 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 492.7920303327728, + "y": 332.4356498334462 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 470.09816651287895, + "y": 437.7634685605543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 454.87483032055127, + "y": 512.4561664338988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 440.1238659323592, + "y": 589.6373967459333 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 426.36142861541464, + "y": 668.0504681285502 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 414.1036736368294, + "y": 746.4386892136426 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 403.8667562637154, + "y": 823.545368633103 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 396.1668317631845, + "y": 898.1138150188241 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 392.4747978817294, + "y": 951.4704108870988 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 391.01147584881875, + "y": 985.6728111470543 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 390.47273937180427, + "y": 1018.5337642540146 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 390.923107859075, + "y": 1049.896183786966 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 392.4271007190198, + "y": 1079.602983324896 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 395.04923736002786, + "y": 1107.4970764467905 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 396.8503937007874, + "y": 1120.6299212598428 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 396.8503937007874, + "y": 1120.6299212598428 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 459.40177523139084, + "y": 1546.82826956488 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 486.84309077894795, + "y": 1733.8016516949633 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 517.0285378812608, + "y": 1939.4723720380553 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 582.887695195398, + "y": 2388.2084891502564 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 897.3304676210354, + "y": 4530.686950398792 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 897.3304676210354, + "y": 4530.686950398792 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 865.9876323817209, + "y": 4534.319312390735 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 750.831165530308, + "y": 4545.943204489453 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 631.2007507013604, + "y": 4556.1555925219345 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 507.11424597834866, + "y": 4564.746151974763 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 378.5895094447428, + "y": 4571.504558334514 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 245.64439918401308, + "y": 4576.220487087769 + }, + { + "curvePoint": true, + "type": "VLayoutPoint", + "x": 108.29677327962963, + "y": 4578.683613721105 + }, + { + "curvePoint": true, + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055022, + "y": 4578.897637795276 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055022, + "y": 4578.897637795276 + }, + { + "turnPoint": true, + "type": "VLayoutPoint", + "x": 37.79527559055022, + "y": 4578.897637795276 + } + ] +} diff --git a/src/test/ValentinaTest/share/test_data.qrc b/src/test/ValentinaTest/share/test_data.qrc index 461b2707a..ed3437bd4 100644 --- a/src/test/ValentinaTest/share/test_data.qrc +++ b/src/test/ValentinaTest/share/test_data.qrc @@ -172,15 +172,27 @@ incorrect_notch/passmarkShape.json incorrect_notch/rotatedSeamAllowance.json incorrect_notch/seamAllowance.json - full_path_case_1/output.json - full_path_case_1/input.json - full_path_case_2/output.json - full_path_case_2/input.json - full_path_case_3/output.json - full_path_case_3/input.json - full_path_case_4/output.json - full_path_case_4/input.json + full_seam_path_case_1/output.json + full_seam_path_case_1/input.json + full_seam_path_case_2/output.json + full_seam_path_case_2/input.json + full_seam_path_case_3/output.json + full_seam_path_case_3/input.json + full_seam_path_case_4/output.json + full_seam_path_case_4/input.json + full_seam_allowance_path_case_1/output.json + full_seam_allowance_path_case_1/input.json + full_seam_allowance_path_case_2/output.json + full_seam_allowance_path_case_2/input.json + full_seam_allowance_path_case_3/output.json + full_seam_allowance_path_case_3/input.json + full_seam_allowance_path_case_4/output.json + full_seam_allowance_path_case_4/input.json 25L_Knitting_Bag/input.json 25L_Knitting_Bag/output.json + full_seam_path_case_5/output.json + full_seam_path_case_5/input.json + full_seam_allowance_path_case_5/output.json + full_seam_allowance_path_case_5/input.json diff --git a/src/test/ValentinaTest/tst_vabstractpiece.cpp b/src/test/ValentinaTest/tst_vabstractpiece.cpp index eea5b97bf..5256882f7 100644 --- a/src/test/ValentinaTest/tst_vabstractpiece.cpp +++ b/src/test/ValentinaTest/tst_vabstractpiece.cpp @@ -1274,7 +1274,7 @@ void TST_VAbstractPiece::IsAllowanceValid() const } //--------------------------------------------------------------------------------------------------------------------- -void TST_VAbstractPiece::TestFullPath_data() const +void TST_VAbstractPiece::TestFullSeamPath_data() const { QTest::addColumn>("base"); QTest::addColumn>("fullPath"); @@ -1288,32 +1288,90 @@ void TST_VAbstractPiece::TestFullPath_data() const QTest::newRow(title) << basePoints << fullPathPoints << mirrorLine; }; - QLineF const mirrorLine(QPointF(785.9055118110236, 417.95262992125987), - QPointF(29.9999999999999, 606.9290078740157)); + QLineF mirrorLine(QPointF(29.9999999999999, 606.9290078740157), QPointF(785.9055118110236, 417.95262992125987)); - // See file src/app/share/collection/fold_line.val - ASSERT_TEST_CASE("Piece full path. Case 1", QStringLiteral("://full_path_case_1/input.json"), - QStringLiteral("://full_path_case_1/output.json"), mirrorLine); + // See file src/app/share/collection/bugs/fold_line.val + ASSERT_TEST_CASE("Piece full path. Case 1", QStringLiteral("://full_seam_path_case_1/input.json"), + QStringLiteral("://full_seam_path_case_1/output.json"), mirrorLine); - ASSERT_TEST_CASE("Piece full path. Case 2", QStringLiteral("://full_path_case_2/input.json"), - QStringLiteral("://full_path_case_2/output.json"), mirrorLine); + ASSERT_TEST_CASE("Piece full path. Case 2", QStringLiteral("://full_seam_path_case_2/input.json"), + QStringLiteral("://full_seam_path_case_2/output.json"), mirrorLine); - ASSERT_TEST_CASE("Piece full path. Case 3", QStringLiteral("://full_path_case_3/input.json"), - QStringLiteral("://full_path_case_3/output.json"), mirrorLine); + ASSERT_TEST_CASE("Piece full path. Case 3", QStringLiteral("://full_seam_path_case_3/input.json"), + QStringLiteral("://full_seam_path_case_3/output.json"), mirrorLine); - ASSERT_TEST_CASE("Piece full path. Case 4", QStringLiteral("://full_path_case_4/input.json"), - QStringLiteral("://full_path_case_4/output.json"), mirrorLine); + ASSERT_TEST_CASE("Piece full path. Case 4", QStringLiteral("://full_seam_path_case_4/input.json"), + QStringLiteral("://full_seam_path_case_4/output.json"), mirrorLine); + + // See file valentina_private_collection/bugs/full_piece/Basic_Darted_Bodice_Block.val (private collection) + mirrorLine = QLineF(QPointF(37.795275590551185, 655.1181102362208), QPointF(37.79527559055022, 4578.897637795276)); + + ASSERT_TEST_CASE("Basic Darted Bodice Block", QStringLiteral("://full_seam_path_case_5/input.json"), + QStringLiteral("://full_seam_path_case_5/output.json"), mirrorLine); } //--------------------------------------------------------------------------------------------------------------------- -void TST_VAbstractPiece::TestFullPath() const +void TST_VAbstractPiece::TestFullSeamPath() const { QFETCH(QVector, base); QFETCH(QVector, fullPath); QFETCH(QLineF, mirrorLine); QVector res; - CastTo(VAbstractPiece::FullPath(base, mirrorLine), res); + CastTo(VAbstractPiece::FullSeamPath(base, mirrorLine, QStringLiteral("Test")), res); + + QVector expected; + CastTo(fullPath, expected); + + ComparePaths(res, expected); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_VAbstractPiece::TestFullSeamAllowancePath_data() const +{ + QTest::addColumn>("base"); + QTest::addColumn>("fullPath"); + QTest::addColumn("mirrorLine"); + + auto ASSERT_TEST_CASE = + [](const char *title, const QString &base, const QString &fullPath, const QLineF &mirrorLine) + { + QVector const basePoints = AbstractTest::VectorFromJson(base); + QVector const fullPathPoints = AbstractTest::VectorFromJson(fullPath); + QTest::newRow(title) << basePoints << fullPathPoints << mirrorLine; + }; + + QLineF mirrorLine(QPointF(-7.795275590551569, 616.3778267716535), QPointF(823.7007874015749, 408.503811023622)); + + // See file src/app/share/collection/bugs/fold_line.val + ASSERT_TEST_CASE("Piece full path. Case 1", QStringLiteral("://full_seam_allowance_path_case_1/input.json"), + QStringLiteral("://full_seam_allowance_path_case_1/output.json"), mirrorLine); + + ASSERT_TEST_CASE("Piece full path. Case 2", QStringLiteral("://full_seam_allowance_path_case_2/input.json"), + QStringLiteral("://full_seam_allowance_path_case_2/output.json"), mirrorLine); + + ASSERT_TEST_CASE("Piece full path. Case 3", QStringLiteral("://full_seam_allowance_path_case_3/input.json"), + QStringLiteral("://full_seam_allowance_path_case_3/output.json"), mirrorLine); + + ASSERT_TEST_CASE("Piece full path. Case 4", QStringLiteral("://full_seam_allowance_path_case_4/input.json"), + QStringLiteral("://full_seam_allowance_path_case_4/output.json"), mirrorLine); + + // See file valentina_private_collection/bugs/full_piece/Basic_Darted_Bodice_Block.val (private collection) + mirrorLine = QLineF(QPointF(37.79527559055132, 604.4628631137784), QPointF(37.79527559055033, 4616.693036243291)); + + ASSERT_TEST_CASE("Basic Darted Bodice Block", QStringLiteral("://full_seam_allowance_path_case_5/input.json"), + QStringLiteral("://full_seam_allowance_path_case_5/output.json"), mirrorLine); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_VAbstractPiece::TestFullSeamAllowancePath() const +{ + QFETCH(QVector, base); + QFETCH(QVector, fullPath); + QFETCH(QLineF, mirrorLine); + + QVector res; + CastTo(VAbstractPiece::FullSeamAllowancePath(base, mirrorLine, QStringLiteral("Test")), res); QVector expected; CastTo(fullPath, expected); diff --git a/src/test/ValentinaTest/tst_vabstractpiece.h b/src/test/ValentinaTest/tst_vabstractpiece.h index 950829d30..8f6a75756 100644 --- a/src/test/ValentinaTest/tst_vabstractpiece.h +++ b/src/test/ValentinaTest/tst_vabstractpiece.h @@ -66,8 +66,10 @@ private slots: void PossibleInfiniteClearLoops() const; void IsAllowanceValid_data() const; void IsAllowanceValid() const; - void TestFullPath_data() const; - void TestFullPath() const; + void TestFullSeamPath_data() const; + void TestFullSeamPath() const; + void TestFullSeamAllowancePath_data() const; + void TestFullSeamAllowancePath() const; private: auto InputPointsCase3() const -> QVector;