fix pep8 errors

This commit is contained in:
looooo
2020-01-05 23:58:01 +01:00
parent dddb6c5bc4
commit 76d30e022e
2 changed files with 10 additions and 37 deletions

View File

@@ -1,11 +1,12 @@
# script for bevel-gear animation
from PySide import QtGui, QtCore
import FreeCADGui as Gui
import FreeCAD as app
import FreeCADGui as gui
import numpy as np
import imageio
doc = App.ActiveDocument
doc = app.ActiveDocument
g2 = doc.Common
g1 = doc.Common001
@@ -15,12 +16,9 @@ def make_pics():
n = 30
for i in range(n):
phi = np.pi * 2 / 30 / n
g1.Placement.Rotation.Angle += phi * 2
g2.Placement.Rotation.Angle -= phi
Gui.activeDocument().activeView().saveImage('/home/lo/Schreibtisch/animated_gear/gear_{}.png'.format(i) ,300,300,'Current')
def make_animated_gif():
g1.Placement.Rotation.Angle += phi * 2
g2.Placement.Rotation.Angle -= phi
gui.activeDocument().activeView().saveImage('/home/lo/Schreibtisch/animated_gear/gear_{}.png'.format(i) ,300,300,'Current')
def update(*args):
print("time")

View File

@@ -36,10 +36,10 @@ from Part import BSplineCurve, Shape, Wire, Face, makePolygon, \
show, makePolygon, makeHelix, makeShell, makeSolid
__all__ = ["involute_gear",
"cycloide_gear",
"bevel_gear",
"involute_gear_rack",
__all__ = ["InvoluteGear",
"CycloideGear",
"BevelGear",
"InvoluteGearRack",
"ViewProviderGear"]
@@ -548,31 +548,6 @@ class BevelGear(object):
new_phi = np.sqrt(np.linalg.norm(point)) * phi
return rotation3D(new_phi)(point)
def create_teeth(self, pts, pos, teeth):
w1 = []
pts = [pt * pos for pt in pts]
rotated_pts = scaled_points
rot = rotation3D(- 2 * i * np.pi / teeth)
for i in range(teeth - 1):
rotated_pts = map(rot, rotated_pts)
pts.append(np.array([pts[-1][-1], rotated_pts[0][0]]))
pts += rotated_pts
s = Wire(Shape(w1).Edges)
wi = []
for i in range(teeth):
rot = App.Matrix()
rot.rotateZ(2 * i * np.pi / teeth)
tooth_rot = s.transformGeometry(rot)
if i != 0:
pt_0 = wi[-1].Edges[-1].Vertexes[0].Point
pt_1 = tooth_rot.Edges[0].Vertexes[-1].Point
wi.append(Wire([Line(pt_0, pt_1).toShape()]))
wi.append(tooth_rot)
pt_0 = wi[-1].Edges[-1].Vertexes[0].Point
pt_1 = wi[0].Edges[0].Vertexes[-1].Point
wi.append(Wire([Line(pt_0, pt_1).toShape()]))
return(Wire(wi))
def __getstate__(self):
return None