From 3e8249a0e6f40b2aae9cbed30d74edade791c69a Mon Sep 17 00:00:00 2001 From: looooo Date: Wed, 21 Jun 2017 11:25:30 +0200 Subject: [PATCH] py3: fix some simple incompapilities issue 0000995 --- src/Mod/Arch/importDAE.py | 2 +- src/Mod/OpenSCAD/importCSG.py | 20 ++++++++++---------- src/Mod/Part/CompoundTools/CompoundFilter.py | 2 +- src/Mod/Path/PathScripts/PathKurveUtils.py | 2 +- src/Mod/Path/PathScripts/phillips_post.py | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Mod/Arch/importDAE.py b/src/Mod/Arch/importDAE.py index 4f34282276..e1fa4bd679 100644 --- a/src/Mod/Arch/importDAE.py +++ b/src/Mod/Arch/importDAE.py @@ -183,7 +183,7 @@ def export(exportList,filename,tessellation=1): ver = FreeCAD.Version() appli = "FreeCAD v" + ver[0] + "." + ver[1] + " build" + ver[2] + "\n" cont.authoring_tool = appli - print author,appli + print(author, appli) colmesh.assetInfo.contributors.append(cont) colmesh.assetInfo.unitname = "meter" colmesh.assetInfo.unitmeter = 1.0 diff --git a/src/Mod/OpenSCAD/importCSG.py b/src/Mod/OpenSCAD/importCSG.py index fc6163e5e4..1afec9f01c 100644 --- a/src/Mod/OpenSCAD/importCSG.py +++ b/src/Mod/OpenSCAD/importCSG.py @@ -1012,8 +1012,8 @@ def p_circle_action(p) : 'circle_action : circle LPAREN keywordargument_list RPAREN SEMICOL' if printverbose: print("Circle : "+str(p[3])) r = float(p[3]['r']) - # Avoid zero radius - if r == 0 : r = 0.00001 + # Avoid zero radius + if r == 0 : r = 0.00001 n = int(p[3]['$fn']) fnmax = FreeCAD.ParamGet(\ "User parameter:BaseApp/Preferences/Mod/OpenSCAD").\ @@ -1146,19 +1146,19 @@ def p_polyhedron_action(p) : v.append(FreeCAD.Vector(float(i[0]),float(i[1]),float(i[2]))) if printverbose: print(v) - print ("Polyhedron "+p[9]) + print ("Polyhedron "+p[9]) print (p[12]) faces_list = [] mypolyhed = doc.addObject('Part::Feature',p[1]) for i in p[12] : if printverbose: print(i) - v2 = FreeCAD.Vector - pp =[v2(v[k]) for k in i] - # Add first point to end of list to close polygon - pp.append(pp[0]) - print pp - w = Part.makePolygon(pp) - f = Part.Face(w) + v2 = FreeCAD.Vector + pp =[v2(v[k]) for k in i] + # Add first point to end of list to close polygon + pp.append(pp[0]) + print(pp) + w = Part.makePolygon(pp) + f = Part.Face(w) #f = make_face(v[int(i[0])],v[int(i[1])],v[int(i[2])]) faces_list.append(f) shell=Part.makeShell(faces_list) diff --git a/src/Mod/Part/CompoundTools/CompoundFilter.py b/src/Mod/Part/CompoundTools/CompoundFilter.py index 584d0855cb..45ff8b5342 100644 --- a/src/Mod/Part/CompoundTools/CompoundFilter.py +++ b/src/Mod/Part/CompoundTools/CompoundFilter.py @@ -156,7 +156,7 @@ class _CompoundFilter: scale = obj.Base.Shape.BoundBox.DiagonalLength / math.sqrt(3) / math.sqrt(len(shps)) if scale < DistConfusion * 100: scale = 1.0 - print scale + print(scale) obj.Shape = getNullShapeShape(scale) raise ValueError('Nothing passes through the filter') # Feeding empty compounds to FreeCAD seems to cause rendering issues, otherwise it would have been a good idea to output nothing. diff --git a/src/Mod/Path/PathScripts/PathKurveUtils.py b/src/Mod/Path/PathScripts/PathKurveUtils.py index f355c4f2a6..8790dc4931 100644 --- a/src/Mod/Path/PathScripts/PathKurveUtils.py +++ b/src/Mod/Path/PathScripts/PathKurveUtils.py @@ -146,7 +146,7 @@ def profile(curve, side_of_line, radius=1.0, vertfeed=0.0, horizfeed=0.0, offset print("in profile: 151") offset_curve = area.Curve(curve) if offset_curve.getNumVertices() <= 1: - raise Exception, "Sketch has no elements!" + raise Exception("Sketch has no elements!") if side_of_line == "On": use_CRC = False diff --git a/src/Mod/Path/PathScripts/phillips_post.py b/src/Mod/Path/PathScripts/phillips_post.py index f121516fdf..bcfc907a58 100644 --- a/src/Mod/Path/PathScripts/phillips_post.py +++ b/src/Mod/Path/PathScripts/phillips_post.py @@ -324,7 +324,7 @@ def export(selection, filename, argstring): gobjects = [] for g in selection[0].Group: - if g.Name <> 'Machine': # filtering out gcode home position from Machine object + if g.Name != 'Machine': # filtering out gcode home position from Machine object gobjects.append(g) for obj in gobjects: