Skip to content

Commit

Permalink
Draft: Applied Werners patch
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Dec 3, 2016
1 parent 8fc41bd commit 365ebf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Draft/Draft.py
Expand Up @@ -3166,7 +3166,7 @@ def makeWires(objectslist):
else:
# turn to Draft line
e = objects[0].Shape.Edges[0]
if isinstance(e.Curve,Part.LineSegment):
if isinstance(e.Curve,(Part.LineSegment,Part.Line)):
result = turnToLine(objects[0])
if result: msg(translate("draft", "Found 1 linear object: converting to line\n"))

Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Draft/DraftGeomUtils.py
Expand Up @@ -105,7 +105,7 @@ def isPtOnEdge(pt,edge) :
def hasCurves(shape):
"hasCurve(shape): checks if the given shape has curves"
for e in shape.Edges:
if not isinstance(e.Curve,Part.LineSegment):
if not isinstance(e.Curve,(Part.LineSegment,Part.Line)):
return True
return False

Expand Down Expand Up @@ -159,9 +159,9 @@ def getQuad(face):

def areColinear(e1,e2):
"""areColinear(e1,e2): returns True if both edges are colinear"""
if not isinstance(e1.Curve,Part.LineSegment):
if not isinstance(e1.Curve,(Part.LineSegment,Part.Line)):
return False
if not isinstance(e2.Curve,Part.LineSegment):
if not isinstance(e2.Curve,(Part.LineSegment,Part.Line)):
return False
v1 = vec(e1)
v2 = vec(e2)
Expand All @@ -188,7 +188,7 @@ def hasOnlyWires(shape):
def geomType(edge):
"returns the type of geom this edge is based on"
try:
if (isinstance(edge.Curve,Part.LineSegment) or isinstance(edge.Curve,Part.Line)):
if isinstance(edge.Curve,(Part.LineSegment,Part.Line)):
return "Line"
elif isinstance(edge.Curve,Part.Circle):
return "Circle"
Expand Down

0 comments on commit 365ebf9

Please sign in to comment.