Skip to content
Permalink
Browse files

Merge pull request #359 from mlampert/Line2LineSegment

Path: Changed Part.Line to Part.LineSegment
  • Loading branch information...
wwmayer committed Dec 2, 2016
2 parents 261bc46 + 0a1a0b8 commit 9864684f1c3409ac15dabb94b0f5edae0c90b4f7
@@ -117,7 +117,7 @@ def edgeForCmd(cls, cmd, startPoint):

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')
@@ -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 \
@@ -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)

0 comments on commit 9864684

Please sign in to comment.
You can’t perform that action at this time.