From 6e8fcff3abbe9f416cd28dd1847bd82bbc791d5f Mon Sep 17 00:00:00 2001 From: kreso-t Date: Mon, 27 Aug 2018 19:18:05 +0200 Subject: [PATCH] Path Adaptive: fix for duplicate edge detection --- src/Mod/Path/PathScripts/PathAdaptive.py | 6 ++++-- src/Mod/Path/PathScripts/PathAdaptiveGui.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index af93e59cfb..496e657dd6 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -30,13 +30,15 @@ def connectEdges(edges): for edge in edges: p1 = edge.valueAt(edge.FirstParameter) p2 = edge.valueAt(edge.LastParameter) + m1 = edge.valueAt((edge.LastParameter+edge.LastParameter)/2) duplicate = False for ex in remaining: exp1 = ex.valueAt(ex.FirstParameter) exp2 = ex.valueAt(ex.LastParameter) - if IsEqualInXYPlane(exp1, p1) and IsEqualInXYPlane(exp2, p2): + exm1 = ex.valueAt((ex.FirstParameter + ex.LastParameter)/2) + if IsEqualInXYPlane(exp1, p1) and IsEqualInXYPlane(exp2, p2) and IsEqualInXYPlane(exm1, m1): duplicate = True - if IsEqualInXYPlane(exp1, p2) and IsEqualInXYPlane(exp2, p1): + if IsEqualInXYPlane(exp1, p2) and IsEqualInXYPlane(exp2, p1) and IsEqualInXYPlane(exm1, m1): duplicate = True if not duplicate: remaining.append(edge) diff --git a/src/Mod/Path/PathScripts/PathAdaptiveGui.py b/src/Mod/Path/PathScripts/PathAdaptiveGui.py index 523fc224ed..c770db291c 100644 --- a/src/Mod/Path/PathScripts/PathAdaptiveGui.py +++ b/src/Mod/Path/PathScripts/PathAdaptiveGui.py @@ -48,7 +48,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): #tolerance form.Tolerance = QtGui.QSlider(QtCore.Qt.Horizontal) - form.Tolerance.setMinimum(5) + form.Tolerance.setMinimum(2) form.Tolerance.setMaximum(15) form.Tolerance.setTickInterval(1) form.Tolerance.setValue(10)