Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py3 fixes #16

Merged
merged 2 commits into from
Jul 22, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
py3: <> -> !=
  • Loading branch information
looooo committed Jul 21, 2017
commit d044e9e68e403402431547dd7d5f654a01554ef9
38 changes: 19 additions & 19 deletions SheetMetalUnfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, TheShape, f_idx):
self.index_unfold_list = [] # indexes needed for unfolding
for i in range(len (self.__Shape.Faces)):
#for i in range(len (self.f_list)):
# if i<>(f_idx):
# if i!=(f_idx):
self.index_list.append(i)
self.index_unfold_list.append(i)
self.f_list.append(self.__Shape.Faces[i])
Expand Down Expand Up @@ -368,14 +368,14 @@ def is_sheet_edge_face(self, ise_edge, tree_node): # ise_edge: IsSheetEdge_edge
if sf_edge.isSame(ise_edge):
the_index = i
break
if the_index <> None:
if the_index != None:
break

# Simple strategy applied: look if the connecting face has vertexes
# with sheet-thickness distance to the top face.
# fix me: this will fail with sharpened sheet edges with two faces
# between top and bottom.
if the_index <> None:
if the_index != None:
distVerts = 0
vertList = []
F_type = str(self.f_list[tree_node.idx].Surface)
Expand Down Expand Up @@ -605,10 +605,10 @@ def is_sheet_edge3(self, ise_edge, tree_node): # ise_edge: IsSheetEdge_edge
if sf_edge.isSame(ise_edge):
the_index = i
break
if the_index <> None:
if the_index != None:
break

if the_index <> None:
if the_index != None:
distVerts = 0
vertList = []
F_type = str(self.f_list[tree_node.idx].Surface)
Expand Down Expand Up @@ -992,10 +992,10 @@ def searchNode(self, theIdx, sNode):

for n_node in sNode.child_list:
nextSearch = self.searchNode(theIdx, n_node)
if nextSearch <> None:
if nextSearch != None:
result = nextSearch
break
if result<>None:
if result!=None:
SMLog("this is the result: ", result.idx)
else:
SMLog("this is the result: ", None)
Expand Down Expand Up @@ -1150,7 +1150,7 @@ def generateBendShell(self, bend_node):

t_idx = self.search_face(bend_edge, bend_node)
# Part.show(self.f_list[t_idx])
if t_idx <> None:
if t_idx != None:
topFace = self.f_list[t_idx].copy()
topFace.rotate(self.f_list[bend_node.idx].Surface.Center,bend_node.axis,math.degrees(bend_node.bend_angle))
topFace.translate(trans_vec)
Expand Down Expand Up @@ -1249,15 +1249,15 @@ def generateBendShell(self, bend_node):
next_idx = 1
if equal_vector(theEdge.Vertexes[1].Point, next_pnt):
next_idx = 0
if next_idx <> None:
if next_idx != None:
if self.isVertOpposite(theEdge.Vertexes[next_idx], bend_node):
nextEdge = theEdge.copy()
search_List.remove(i)
the_index = i
break
else:
next_idx = None
if the_index <> None:
if the_index != None:
break

#find the lastEdge
Expand All @@ -1269,15 +1269,15 @@ def generateBendShell(self, bend_node):
last_idx = 1
if equal_vector(theEdge.Vertexes[1].Point, start_pnt):
last_idx = 0
if last_idx <> None:
if last_idx != None:
if self.isVertOpposite(theEdge.Vertexes[last_idx], bend_node):
lastEdge = theEdge.copy()
search_List.remove(i)
the_index = i
break
else:
last_idx = None
if the_index <> None:
if the_index != None:
break

# find the middleEdge
Expand All @@ -1287,7 +1287,7 @@ def generateBendShell(self, bend_node):
last_idx = 1
if equal_vector(theEdge.Vertexes[1].Point, start_pnt):
last_idx = 0
if last_idx <> None:
if last_idx != None:
if self.isVertOpposite(theEdge.Vertexes[last_idx], bend_node):
lastEdge = theEdge.copy()
search_List.remove(i)
Expand Down Expand Up @@ -1354,7 +1354,7 @@ def makeSeamFace(self, sEdge, theNode):
next_idx = 1
if equal_vertex(theEdge.Vertexes[1], nextVert):
next_idx = 0
if next_idx <> None:
if next_idx != None:
if self.isVertOpposite(theEdge.Vertexes[next_idx], theNode):
nextEdge = theEdge.copy()
search_List.remove(i)
Expand All @@ -1363,7 +1363,7 @@ def makeSeamFace(self, sEdge, theNode):
break
else:
next_idx = None
if the_index <> None:
if the_index != None:
break

#find the lastEdge
Expand All @@ -1378,7 +1378,7 @@ def makeSeamFace(self, sEdge, theNode):
last_idx = 1
if equal_vertex(theEdge.Vertexes[1], startVert):
last_idx = 0
if last_idx <> None:
if last_idx != None:
SMLog("test for the last Edge")
if self.isVertOpposite(theEdge.Vertexes[last_idx], theNode):
lastEdge = theEdge.copy()
Expand All @@ -1388,7 +1388,7 @@ def makeSeamFace(self, sEdge, theNode):
break
else:
last_idx = None
if last_idx <> None:
if last_idx != None:
break

# find the middleEdge
Expand All @@ -1400,7 +1400,7 @@ def makeSeamFace(self, sEdge, theNode):
mid_idx = 1
if equal_vertex(theEdge.Vertexes[1], nextEdge.Vertexes[next_idx]):
mid_idx = 0
if mid_idx <> None:
if mid_idx != None:
if equal_vertex(theEdge.Vertexes[mid_idx], lastEdge.Vertexes[last_idx]):
midEdge = theEdge.copy()
#Part.show(midEdge)
Expand Down Expand Up @@ -1521,7 +1521,7 @@ def PerformUnfold():
showTime = time.clock()
SMLog("Show time: ", showTime - solidTime, " total time: ", showTime - startzeit)

if TheTree.error_code <> None:
if TheTree.error_code != None:
SMError("Error ", unfold_error[TheTree.error_code], " at Face", TheTree.failed_face_idx+1)
QtGui.QMessageBox.information(mw,"Error",unfold_error[TheTree.error_code])
else:
Expand Down