Hi,
I would like to know if there is a tutorial on how to create gears in Inkscape (I am still using 0.42, but would like to update as soon as I have the new Ubuntu release installed). At the Inkscape web site I only found several links to Youtube videos, but none of those was what I was looking for.
TIA,
Claus
Claus Cyrny wrote:
Hi,
I would like to know if there is a tutorial on how to create gears in Inkscape (I am still using 0.42, but would like to update as soon as I have the new Ubuntu release installed). At the Inkscape web site I only found several links to Youtube videos, but none of those was what I was looking for.
TIA,
Claus
Real involute gears? or just artisticly pleasing gears?
You can make simple gearish shapes by combining a star and two circles with boolean operations. See attached svg.
I wrote a python script to generate gears that are somewhat more mathematically correct, but it still lacks the proper involute curve for the tooth profiles. See the attached python script.
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape. I've written a little toy program for generating gears with proper involute tooth profiles. These gears still lack the proper undercutting or addendum modifications for gears with small numbers of teeth. See http://lib2geom.sourceforge.net/ and http://lib2geom.svn.sourceforge.net/viewvc/lib2geom/lib2geom/trunk/src/toys/...
Aaron Spike
import sys from math import *
PHI = radians(20)#float(input("pressure angle")) PC = 10#float(input("Circular Pitch (module)"))
def involute_intersect_angle(Rb, R): Rb, R = float(Rb), float(R) return (sqrt(R**2 - Rb**2) / (Rb)) - (acos(Rb / R))
def point_on_circle(radius, angle): x = radius * cos(angle) y = radius * sin(angle) return (x, y)
def points_to_svgd(p): f = p[0] p = p[1:] svgd = 'M%s,%s' % f for x in p: svgd += 'L%s,%s' % x svgd += 'z' return svgd
def gear(N,phi=PHI,Pc=PC): #Pitch Circle D = N * Pc / pi R = D / 2.0
#Diametrial pitch Pd = N / D
#Base Circle Db = D * cos(phi) Rb = Db / 2.0
#Addendum a = 1.0 / Pd
#Outside Circle Ro = R + a Do = 2 * Ro
#Tooth thickness T = (pi * D) / (2 * N)
#undercut? U = (2 / (sin(phi) ** 2)) needs_undercut = N < U sys.stderr.write("N:%s R:%s Rb:%s\n" % (N,R,Rb))
#Clearance c = 0.0 #Dedendum b = a + c
#Root Circle Rr = R - b Dr = 2 * Rr
two_pi = 2 * pi half_thick_angle = two_pi / (4 * N) pitch_to_base_angle = involute_intersect_angle(Rb, R) pitch_to_outer_angle = involute_intersect_angle(Rb, Ro) - pitch_to_base_angle
#print degrees(half_thick_angle),degrees(pitch_to_base_angle),degrees(pitch_to_outer_angle) centers = [(x * two_pi / N) for x in range(N)]
points = []
for c in centers: #angles pitch1 = c - half_thick_angle base1 = pitch1 - pitch_to_base_angle outer1 = pitch1 + pitch_to_outer_angle
pitch2 = c + half_thick_angle base2 = pitch2 + pitch_to_base_angle outer2 = pitch2 - pitch_to_outer_angle
#points b1 = point_on_circle(Rb, base1) p1 = point_on_circle(R, pitch1) o1 = point_on_circle(Ro, outer1) o2 = point_on_circle(Ro, outer2) p2 = point_on_circle(R, pitch2) b2 = point_on_circle(Rb, base2)
if Rr >= Rb: pitch_to_root_angle = pitch_to_base_angle - involute_intersect_angle(Rb, Rr) root1 = pitch1 - pitch_to_root_angle root2 = pitch2 + pitch_to_root_angle r1 = point_on_circle(Rr, root1) r2 = point_on_circle(Rr, root2) p_tmp = [r1,p1,o1,o2,p2,r2] else: r1 = point_on_circle(Rr, base1) r2 = point_on_circle(Rr, base2) p_tmp = [r1,b1,p1,o1,o2,p2,b2,r2]
points.extend(p_tmp)
svgd = points_to_svgd(points)
svg = """ <g> <circle style="fill:none;stroke:green;" r="%s" /> <circle style="fill:none;stroke:green;" r="%s" /> <circle style="fill:none;stroke:red;" r="%s" /> <circle style="fill:none;stroke:blue;" r="%s" /> <path style="fill:gray;fill-opacity:0.5;stroke:black;" d="%s"/> </g> """ % (Ro, Rr, R, Rb, svgd)
return svg
print "<svg>\n" for teeth in [15,25,50]: print gear(teeth) print "</svg>\n"
Hi Aaron,
many thanks for your tips. I'll look into the stuff you attached to your email.
Claus
Aaron Spike wrote:
Claus Cyrny wrote:
Hi,
I would like to know if there is a tutorial on how to create gears in Inkscape (I am still using 0.42, but would like to update as soon as I have the new Ubuntu release installed). At the Inkscape web site I only found several links to Youtube videos, but none of those was what I was looking for.
TIA,
Claus
Real involute gears? or just artisticly pleasing gears?
You can make simple gearish shapes by combining a star and two circles with boolean operations. See attached svg.
I wrote a python script to generate gears that are somewhat more mathematically correct, but it still lacks the proper involute curve for the tooth profiles. See the attached python script.
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape.
try attached file
Claus Cyrny wrote:
Hi Aaron,
many thanks for your tips. I'll look into the stuff you attached to your email.
Claus
Aaron Spike wrote:
Claus Cyrny wrote:
Hi,
I would like to know if there is a tutorial on how to create gears in Inkscape (I am still using 0.42, but would like to update as soon as I have the new Ubuntu release installed). At the Inkscape web site I only found several links to Youtube videos, but none of those was what I was looking for.
TIA,
Claus
Real involute gears? or just artisticly pleasing gears?
You can make simple gearish shapes by combining a star and two circles with boolean operations. See attached svg.
I wrote a python script to generate gears that are somewhat more mathematically correct, but it still lacks the proper involute curve for the tooth profiles. See the attached python script.
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape.
-- Home Page: http://home.arcor.de/ccyrny/ (Photographs) Photo gallery @ depo consulting: http://www.depoconsulting.com/gallery/clauscyrny.htm "Djangology" (my Django Reinhardt site; in German): http://home.arcor.de/ccyrny/djangology/
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D...
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Wed, 2007-01-03 at 07:22 -0600, Aaron Spike wrote:
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape. I've written a little toy program for generating gears with proper involute tooth profiles. These gears still lack the proper undercutting or addendum modifications for gears with small numbers of teeth.
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See:
http://tavmjong.free.fr/INKSCAPE/DRAWINGS/clock_plain.svg
The animation is a resource hog... especially with Firefox 3. Firefox 2, Opera, and Batik aren't as bad. I learned a few new things about browser support for fonts and text on a path from this exercise:
* Firefox always uses the same Sans Serif font for all text.
* Opera 9 makes a mess of text on paths if the text is shifted.
Saving a file as plain SVG removes the onload("Start(evt") line required for animation. Guess I'll have to file a bug report on that.
Tav
The animation is a resource hog... especially with Firefox 3. Firefox 2, Opera, and Batik aren't as bad. I learned a few new things about browser support for fonts and text on a path from this exercise:
Hey! I never knew SVG could be animated. Nice clock Tav! Works okay on FF 1.5 on Kubuntu Dapper. Oh - there are no fonts, no type, at all. In firefox. Still to open in 'scape.
/d
Hey! I never knew SVG could be animated. Nice clock Tav!
SVG can be animated: see
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Web-Animation.html
Inkscape does not yet support animation. You must add the animation by hand and use a web browser that supports SVG or a standalone program like Batik to see the animation. After you have added the animation you can still edit the drawings with Inkscape which is very convenient.
Tav
Tav,
Very nice!
Phil.
On Fri, 2007-01-05 at 14:31 +0100, Tavmjong Bah wrote:
On Wed, 2007-01-03 at 07:22 -0600, Aaron Spike wrote:
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape. I've written a little toy program for generating gears with proper involute tooth profiles. These gears still lack the proper undercutting or addendum modifications for gears with small numbers of teeth.
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See:
http://tavmjong.free.fr/INKSCAPE/DRAWINGS/clock_plain.svg
The animation is a resource hog... especially with Firefox 3. Firefox 2, Opera, and Batik aren't as bad. I learned a few new things about browser support for fonts and text on a path from this exercise:
Firefox always uses the same Sans Serif font for all text.
Opera 9 makes a mess of text on paths if the text is shifted.
Saving a file as plain SVG removes the onload("Start(evt") line required for animation. Guess I'll have to file a bug report on that.
Tav
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See: http://tavmjong.free.fr/INKSCAPE/DRAWINGS/clock_plain.svg
This is absolutely one of the loveliest things I've seen in SVG land in a long time .. well done!
The animation is a resource hog... especially with Firefox 3. Firefox 2, Opera, and Batik aren't as bad. I learned a few new things about browser support for fonts and text on a path from this exercise:
Works great in Safari 2.0.4 (powerbook G4) btw ..
Tavmjong Bah wrote:
On Wed, 2007-01-03 at 07:22 -0600, Aaron Spike wrote:
And lastly if the tooth profiles are important to you, please check out lib2geom. lib2geom is a 2d geometry toolkit being developed for use in inkscape. I've written a little toy program for generating gears with proper involute tooth profiles. These gears still lack the proper undercutting or addendum modifications for gears with small numbers of teeth.
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See:
Wow! This is absolutely what I am looking for (although not animated). Actually I got inspired to make gears when taking a look at gallery section http://www.xara.com/gallery/ of the web site of Xara Xtreme http://www.xaraxtreme.com/, which is as to my understanding being developed with the Inkscape team. This detailed clock is really amazing, and I wonder if this isn't possible using Inkscape.
Thanks,
Claus
On Fri, 2007-01-05 at 15:05 +0100, Claus Cyrny wrote:
Actually I got inspired to make gears when taking a look at gallery section of the web site of Xara Xtreme, which is as to my understanding being developed with the Inkscape team.
Well, the idea was that there would be some sort of collaboration with us, but it hasn't really materialized.
-mental
On Sat, 2007-01-06 at 17:18 -0500, MenTaLguY wrote:
On Fri, 2007-01-05 at 15:05 +0100, Claus Cyrny wrote:
Actually I got inspired to make gears when taking a look at gallery section of the web site of Xara Xtreme, which is as to my understanding being developed with the Inkscape team.
Well, the idea was that there would be some sort of collaboration with us, but it hasn't really materialized.
-mental
Yah, you guys can push with the Xara folks about this more. The last news I saw said Xara LX has slowed to a halt and that the community wasn't so happy because suggestions and code haven't been committed by the community...
Jon
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Tavmjong Bah wrote:
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See:
WOW!
Aaron Spike
Tavmjong Bah wrote:
Playing with gears looked like too much fun to ignore. I've used Aaron's python routine to make some gears that I have animated for a clock. See:
My god is this real? It even shows the right time! (yes I was so shocked in awe that I did not realise this only after a minute or so :D) I wonder ... why again does Inkscape not have a simple dialog to add a script like this to an svg file? :P
Inspiring! Very inspiring!! Thanks a lot :D
Johan Engelen
Version update a control:
http://colibre.com.br/bin/view/Aurium/ClockSVG
.ValessioBrito
2007/1/5, Tavmjong Bah <tavmjong@...206...>:
On Wed, 2007-01-03 at 07:22 -0600, Aaron Spike wrote:
On 1/5/07, Tavmjong Bah <tavmjong@...206...> wrote:
Inspiring. Can we have this file for share/examples please? :)
On 1/6/07, bulia byak <buliabyak@...155...> wrote:
On 1/5/07, Tavmjong Bah <tavmjong@...206...> wrote:
Very cool.
Works in Opera 9.10/XP; I'll have to wait until I get home in a few days to test it in Opera 9.10/Ubuntu...
Brian
participants (13)
-
unknown@example.com
-
Aaron Spike
-
Benjamin Huot
-
Brian Burger
-
bulia byak
-
Claus Cyrny
-
Donn
-
Jay Vaughan
-
Jon Phillips
-
MenTaLguY
-
Phil Rhoades
-
Tavmjong Bah
-
ValessioBrito