From 54219f151ca958608686644a5e72a024afc85711 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 19 Nov 2017 03:07:36 +0800 Subject: [PATCH] Path.Area: handle empty wires during sorting --- src/Mod/Path/App/Area.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index da7b3971e5..b9972f1ff9 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -2535,13 +2535,18 @@ struct ShapeInfo{ std::list sortWires(const gp_Pnt &pstart, gp_Pnt &pend, double min_dist, double max_dist, gp_Pnt *pentry) { + std::list wires; + if(myWires.empty() || - pstart.SquareDistance(myStartPt)>Precision::SquareConfusion()) + pstart.SquareDistance(myStartPt)>Precision::SquareConfusion()) + { nearest(pstart); + if(myWires.empty()) + return wires; + } if(pentry) *pentry = myBestPt; - std::list wires; if(min_dist < 0.01) min_dist = 0.01; while(true) {