From 04a589c33b4f9530f6364d27c42a3fdd09c749c3 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 2 Dec 2016 02:51:15 -0800 Subject: [PATCH 1/2] Changed Part.Line to Part.LineSegment --- src/Mod/Path/PathScripts/PathGeom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathGeom.py b/src/Mod/Path/PathScripts/PathGeom.py index 450dba4cce..dda353efb8 100644 --- a/src/Mod/Path/PathScripts/PathGeom.py +++ b/src/Mod/Path/PathScripts/PathGeom.py @@ -117,7 +117,7 @@ class PathGeom: endPoint = cls.commandEndPoint(cmd, startPoint) if (cmd.Name in cls.CmdMoveStraight) or (cmd.Name in cls.CmdMoveFast): - return Part.Edge(Part.Line(startPoint, endPoint)) + return Part.Edge(Part.LineSegment(startPoint, endPoint)) if cmd.Name in cls.CmdMoveArc: center = startPoint + cls.commandEndPoint(cmd, Vector(0,0,0), 'I', 'J', 'K') From 4788666745f19b7593424779bdceb8b73142c92f Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 2 Dec 2016 04:42:22 -0800 Subject: [PATCH 2/2] More Line to LineSegment conversions. --- src/Mod/Path/PathScripts/PathUtils.py | 7 +++++-- src/Mod/Path/PathTests/PathTestUtils.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 949d60f9f5..3d4dee172c 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -63,6 +63,9 @@ def cleanedges(splines, precision): elif geomType(spline) == "Line": edges.append(spline) + elif geomType(spline) == "LineSegment": + edges.append(spline) + else: pass @@ -244,7 +247,7 @@ def reverseEdge(e): arcendpt = e.valueAt(e.LastParameter) arcofCirc = Part.ArcOfCircle(arcendpt, arcmid, arcstpt) newedge = arcofCirc.toShape() - elif geomType(e) == "Line": + elif geomType(e) == "LineSegment": stpt = e.valueAt(e.FirstParameter) endpt = e.valueAt(e.LastParameter) newedge = Part.makeLine(endpt, stpt) @@ -410,7 +413,7 @@ def SortPath(wire, Side, radius, clockwise, firstedge=None, SegLen=0.5): arclist = filterArcs(e) for a in arclist: edgelist.append(a) - elif geomType(e) == "Line": + elif geomType(e) == "LineSegment": edgelist.append(e) elif geomType(e) == "BSplineCurve" or \ geomType(e) == "BezierCurve" or \ diff --git a/src/Mod/Path/PathTests/PathTestUtils.py b/src/Mod/Path/PathTests/PathTestUtils.py index 35cc71bfda..30b56024ec 100644 --- a/src/Mod/Path/PathTests/PathTestUtils.py +++ b/src/Mod/Path/PathTests/PathTestUtils.py @@ -44,7 +44,7 @@ class PathTestBase(unittest.TestCase): def assertLine(self, edge, pt1, pt2): """Verify that edge is a line from pt1 to pt2.""" - self.assertIs(type(edge.Curve), Part.Line) + self.assertIs(type(edge.Curve), Part.LineSegment) self.assertCoincide(edge.Curve.StartPoint, pt1) self.assertCoincide(edge.Curve.EndPoint, pt2)