This commit is contained in:
looooo
2018-03-27 10:05:20 +02:00
parent 2d803e15e5
commit ae5c393b6f
2 changed files with 17 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ A gear module for FreeCAD > 0.16
---------------------------
![gear](examples/spiral.png)
![gear1](examples/animated_spiral.gif)
## supported gear-types:
- cylindric involute
@@ -49,4 +50,4 @@ A gear module for FreeCAD > 0.16
* go to the gear workbench
* create new document
* create a gear (click on gear symbol)
* change parameters
* change parameters

View File

@@ -1,6 +1,9 @@
# script for bevel-gear animation
from PySide import QtGui, QtCore
import FreeCADGui as Gui
import numpy as np
import imageio
doc = App.ActiveDocument
g2 = doc.Common
@@ -8,6 +11,17 @@ g1 = doc.Common001
timer = QtCore.QTimer()
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():
def update(*args):
print("time")
delta_phi = 0.005
@@ -15,4 +29,4 @@ def update(*args):
g2.Placement.Rotation.Angle -= delta_phi
timer.timeout.connect(update)
timer.start()
timer.start()