'''
Copyright (C) 2007 Aaron Spike (aaron @ ekips.org)
Copyright (C) 2007 Tavmjong Bah (tavmjong @ free.fr)
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
from math import *
import string
return (x, y)
def points_to_svgd(p):
f = p[0]
p = p[1:]
svgd = 'M%.5f,%.5f' % f
for x in p:
svgd += ' L%.5f,%.5f' % x
svgd += 'z'
return svgd
help="Number of teeth")
help="Circular Pitch (length of arc from one tooth to next)")
help="Pressure Angle (common values: 14.5, 20, 25 degrees)")
help="Diameter of central hole - 0.0 for no hole")
help="unit of measure for circular pitch and center diameter")
# print >>sys.stderr, "Teeth: %s\n" % teeth
# Pitch (circular pitch): Length of the arc from one tooth to the next)
# Pitch diameter: Diameter of pitch circle.
# Base Circle
# Diametrial pitch: Number of teeth per unit length.
# Addendum: Radial distance from pitch circle to outside circle.
# Outer Circle
# Tooth thickness: Tooth width along pitch circle.
# Undercut?
# Clearance: Radial distance between top of tooth on one gear to bottom of gap on another.
clearance = 0.0
# Dedendum: Radial distance from pitch circle to root diameter.
# Root diameter: Diameter of bottom of tooth spaces.
points = []
for c in centers:
# Angles
pitch1 = c - half_thick_angle
pitch2 = c + half_thick_angle
# Points
if root_radius > base_radius:
else:
# Embed gear in group to make animation easier:
# Translate group, Rotate path.
'transform':t }
# Create SVG Path for gear
if(centerdiameter > 0.0):
}
if __name__ == '__main__':
e = Gears()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99