Professional Documents
Culture Documents
neondata
Tue Mar 05, 2013 1:19 pm
P
I have modified the gear macro in FreeCad0.13\Mod\PartDesign\Scripts in different ways
The Gui is modular and the gear body is now created as an extrusion of the circumference.
This is the first version that created a gear, so it is not cleaned up. Needs some further optimization.
Enjoy, if possible!
# Changes: NeonData
#
import FreeCAD, FreeCADGui, Part, Draft, math, MeshPart, Mesh
from PyQt4 import QtGui,QtCore
App=FreeCAD
Gui=FreeCADGui
def MakeCircle(Name, Radius, StartAngle, StopAngle):
bCircle = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",Name)
jmaustpc
Tue Mar 05, 2013 1:38 pm
P
Hi neondata
Obviously a work in progress, but I did indeed get a gear! And a few flat circular faces etc.
Jim
neondata
Re: involute gear generator preview
Tue Mar 05, 2013 5:49 pm
P
I made some changes, the gears look nice. For now.
As always: little things make a large difference. The teeth were unevenly spaced: reason: the rotational
angle = math.radians((tooth*360)/N)
After changing to
angle = math.radians((tooth*360.)/N)
This is the code so far. Creating larger number of teeth, the runtime is quite long. It should be better to
do the calculation completely in python and not to use the features to speed up the process.
# Changes: NeonData, 2013/03/5, still not good! but creates closed stl and step output.
# known issue: base diameter can be less than root diamet
er.
# input parameters should be changed to follow DIN, whate
ver that means.
#
# known issue: the hide() doesnt work if the number of teeth is 68, but macro can be re
started anyway (windowsXP professional, Vers FreeCad 0.13stable
NormandC
Wed Mar 06, 2013 2:13 am
P
Congrats, this gives a much nicer gear than the previous script which generated a billion faces on its top
But I wonder why the teeth must be made of small straight line segments instead of a true arc or curve?
And what if, instead of producing a very complex face to extrude, you started with a cylinder, created a
"tooth cut" and patterned it along the cylinder, would that make the gear script faster?
I have almost no python experience, see attached primitive and non-functional gear modeled in the GUI
Attachments
primitive_gear.fcstd
this is no way a real gear, just an example to show the suggested method of building the gear.
(35.33 KiB) Downloaded 82 times
jmaustpc
Wed Mar 06, 2013 3:18 am
P
Hi
It produced the following out put in red, so I thought it was an error message, but according to Google
Neue Berechnung......
Jim
neondata
Re: involute gear generator preview
Wed Mar 06, 2013 9:38 am
P
Hi,
I also was surprised that computation takes so long, that is the reason why I think about creating the
profile completely by program. But that will take time. I am not involved in gear shaping, so I just
streamlined the original software. The output in red is just to dump the internal values. It happens that
the base diameter is less than the root diameter, depending on input parameters. That is not realistic and
But whatever: it creates a nice gear, rather fast when teeth number is low, and you can output a step
which again can be the base for a fully specified gear with center bore etc. Works nicely, I printed one
jmaustpc
Wed Mar 06, 2013 10:49 am
P
“ neondata wrote:
eslavko
Thu Apr 11, 2013 8:56 am
P
I'm new to FreeCAD and can't start this script.
>>>
neondata
Thu Apr 11, 2013 9:04 am
P
When doing copy and paste it may happen that indentations are disturbed. Create a macro, paste to the
editor and run the macro, that's much saver and allows to debug without unnecessary problems. Also:
never mix tabs and blank for indentation, that sometimes happens when old code is modified
eslavko
Thu Apr 11, 2013 9:49 pm
P
Se where to get that macro/file. I see just on this page and can only copy/paste or what?
Display posts from previous: All posts Sort by Post time Ascending Go
Post Reply 2 3 4 5 … 13
130 posts 1