Skip to content

Commit

Permalink
Draft: minor fix in Shapestring
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Sep 10, 2014
1 parent d1fb7fa commit 9af4df3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Mod/Draft/Draft.py
Expand Up @@ -4915,9 +4915,11 @@ def execute(self, obj):
def makeFaces(self, wireChar):
import Part
compFaces=[]
allEdges = []
wirelist=sorted(wireChar,key=(lambda shape: shape.BoundBox.DiagonalLength),reverse=True)
fixedwire = []
for w in wirelist:
allEdges.extend(w.Edges)
compEdges = Part.Compound(w.Edges)
compEdges = compEdges.connectEdgesToWires()
fixedwire.append(compEdges.Wires[0])
Expand Down Expand Up @@ -4953,13 +4955,18 @@ def makeFaces(self, wireChar):
sep_wirelist.append(w)
wirelist = sep_wirelist
sep_wirelist = []
face = Part.Face(wire2Face)
face.validate()
if face.Surface.Axis.z < 0.0:
face.reverse()
compFaces.append(face)
try:
face = Part.Face(wire2Face)
face.validate()
if face.Surface.Axis.z < 0.0:
face.reverse()
except:
stick = True
wirelist = []
else:
compFaces.append(face)
if stick:
ret = Part.Compound(fixedwire)
ret = Part.Compound(allEdges)
elif compFaces:
ret = Part.Compound(compFaces)
return ret
Expand Down

0 comments on commit 9af4df3

Please sign in to comment.