Skip to content

Commit

Permalink
CD_A2plusupdater.py: rename functions with typos
Browse files Browse the repository at this point in the history
`attemt`->`attempt`
  • Loading branch information
luzpaz committed Mar 18, 2022
1 parent 8ca0c63 commit ce10230
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions CD_A2plusupdater.py
Expand Up @@ -138,7 +138,7 @@ def secondrun(self, newpart = False):
doc = FreeCAD.activeDocument()


if newpart == False:
if newpart is False:
newobj = None
CD_importpart.updateImportedParts(doc, True)
newobj = g.partobj
Expand Down Expand Up @@ -329,11 +329,11 @@ def findfeats_attempt1(self):
newfeat = g.dictOldNew.get(featname)
else:
if 'Face' in featname:
newfeat = self.findnewface_attemt1(dict)
newfeat = self.findnewface_attempt1(dict)
if 'Edge' in featname:
newfeat = self.findnewedge_attemt1(dict)
newfeat = self.findnewedge_attempt1(dict)
if 'Vertex' in featname:
newfeat = self.findnewvertex_attemt1(dict)
newfeat = self.findnewvertex_attempt1(dict)
if newfeat =='' or newfeat == 'No':
g.notfoundfeatures.append([dict.get('Name'),dict])
pass
Expand Down Expand Up @@ -388,10 +388,10 @@ def findfeats_attempt2(self):
newfeat = g.dictOldNew.get(featname)
else:
if 'Face' in featname:
newfeat = self.findnewface_attemt2(dict)
newfeat = self.findnewface_attempt2(dict)
if 'Edge' in featname:
newfeat = self.findnewedge_attemt2(dict)
if newfeat =='No' or newfeat == '':
newfeat = self.findnewedge_attempt2(dict)
if newfeat is 'No' or newfeat == '':
g.notfoundfeatures.append([dict.get('Name'),dict])
newfeat = 'None'
else:
Expand All @@ -401,13 +401,13 @@ def findfeats_attempt2(self):
self.swapfeature(newfeat,dict)


def findnewface_attemt1(self,dict):
#First attement to find a face. Perfect fit is area the same all points the ssame
def findnewface_attempt1(self,dict):
# First attempt to find a face. Perfect fit is area the same all points the same
face = ''
# newfeat = ''
# surftype = dict.get('surftype')
if dict.get('surftype') == 'Cylinder':
face = self.findCylinderattemt1(dict)
face = self.findCylinderattempt1(dict)
else:
for num in range(0,len(g.shape2.Faces)):
testdict = self.getfacebynum(num,g.shape2)
Expand All @@ -420,12 +420,12 @@ def findnewface_attemt1(self,dict):



def findnewface_attemt2(self,dict):
def findnewface_attempt2(self,dict):
face = ''
#second attempt ignors area looks for points
# second attempt ignores area; looks for points
face = ''
if dict.get('surftype') == 'Cylinder':
face = self.findCylinderattemt2(dict)
face = self.findCylinderattempt2(dict)


else:
Expand Down Expand Up @@ -480,8 +480,7 @@ def findnewface_attemt2(self,dict):
return(face)



def findCylinderattemt1(self,dict):
def findCylinderattempt1(self,dict):
face = ''
for num in g.cylfaces:
testdict = self.getfacebynum(num,g.shape2)
Expand All @@ -493,9 +492,8 @@ def findCylinderattemt1(self,dict):
return(face)



def findCylinderattemt2(self,dict):
#First attement to find a face. Perfect fit is area the same all points the ssame
def findCylinderattempt2(self,dict):
#First attempt to find a face. Perfect fit is area the same all points the same
face = ''
ver1 = dict.get('center')
for num in g.cylfaces:
Expand All @@ -507,10 +505,7 @@ def findCylinderattemt2(self,dict):
return(face)





def findnewedge_attemt1(self,dict):
def findnewedge_attempt1(self,dict):
edge = ''
if dict.get('curvetype') == 'circle':
center1 = dict.get('center')
Expand All @@ -527,7 +522,7 @@ def findnewedge_attemt1(self,dict):

else:
for num in g.notcylfaces:
testdict = self.getfacebynum(num,g.shape2)
testdict = self.getfacebynum(num,g.shape2)
if dict.get('length') == testdict.get('length')\
and dict.get('center') == testdict.get('center'):
edge ='Edge' + str(num +1)
Expand All @@ -536,7 +531,7 @@ def findnewedge_attemt1(self,dict):
return(edge)


def findnewedge_attemt2(self,dict):
def findnewedge_attempt2(self,dict):
edge = ''
if dict.get('curvetype') == 'circle':
center1 = dict.get('center')
Expand Down Expand Up @@ -580,7 +575,7 @@ def findnewedge_attemt2(self,dict):



def findnewvertex_attemt1(self,dict):
def findnewvertex_attempt1(self,dict):
vertex = ''
featname = dict.get('featname')
for num in range(0,len(g.shape2.Vertexes)):
Expand Down

0 comments on commit ce10230

Please sign in to comment.