Skip to content

Commit

Permalink
More Line to LineSegment conversions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Dec 2, 2016
1 parent 26263c4 commit 0a1a0b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Path/PathScripts/PathUtils.py
Expand Up @@ -63,6 +63,9 @@ def cleanedges(splines, precision):
elif geomType(spline) == "Line":
edges.append(spline)

elif geomType(spline) == "LineSegment":
edges.append(spline)

else:
pass

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathTests/PathTestUtils.py
Expand Up @@ -44,7 +44,7 @@ def assertCoincide(self, pt1, pt2):

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)

Expand Down

0 comments on commit 0a1a0b8

Please sign in to comment.