Gears - generate gears for POV-Ray scenes

SYNOPSIS

gears [ -a? | -c radius | -h height | -n number | -r radius | -w width | 
   -H hub_radius | -s spoke_count | -f filename | -N object | -o output_format ] 

DESCRIPTION

Gears is a program for producing gears or sprocket-like objects for 3D rendering systems. It can create solid centers or spoked centers. Objects names can be user specified and consecutive executions can append to existing include files.

Currently only POV-Ray include files are supported as output formats.

The final object is centered about the origin and lies in the XY plane, extruded along the Z axis. No textures are provided.

OPTIONS

-c radius Radius of cutout in center of gear; default= 0 (ie. no cutout)
-h height Height of gear teeth; default = 0.1
-H hub_radius Radius of central hub (only valid if -c option is used); default = 0.0 (ie no central hub)
-n number Number of gear teeth in quadrant 1; default = 9
-r radius Radius of gear (not including teeth); defalut = 1.0
-s spoke_count Number of spokes to use when -c option is used; default = 2
-w width Width of gear (front to back); default = 0.1
-a Append to output file, if it already exists.
-f filename Filename to write output to (default: gears.inc).
-N object Name of the object (default: coil).
-o type Output format type. This can be one of the following:
  1. POV-Ray
Currently this option does not need to be specified since it defaults to POV-Ray.

EXAMPLE USAGE

Gears is rather simple to use. Lets try an example where all the options are specified.

We're creating a scene which requires a spoked gear. We know the gear needs to be 3.5 units across, from the tip of the tooth on the left to the tip of the tooth on the right. There can be any arbitrary number of teeth on the gear for this example and the teeth just need to be visible, but not huge. The spokes are basically crosshairs, ie there are 4 spokes, and the open space between the spokes is not defined. This means the "rim" around the edge of the gear between the teeth and the end of the spokes can be any size for this example. The gear must be relatively fat, lets say 2.5 units from front to back. We'll call this "mygear" and will put it in the file mygear.inc.

Based on this definition we've defined the following parameters:
-h 0.2 This is an arbitrary value for the teeth height.
-r 1.35 This is based on the total diameter of 3.5 minus the height of the teeth on both ends (which totals .4 units).
-n 10 This is completely arbirtrary. If you need gears to interlock with each other then the number of teeth should be the same on both gears.
-s 4 This is the number of spokes.
-H 0.3 Since we're going to use spokes, we should specify an inner hub into which the spokes converge.
-c 1.1 This is the radius of a cicular cutout from the center of the gear. The net effect will be a rim between the teeth and the spokes. This value should always be less then the radius specified with the \-r option
-w 2.5 This is the width, front to back, of the gear.
-f mygear.inc We want it in this include file.
-N mygear And finally, we need to call it this.

In this example we've only left off two options, the -a option (used to append the output to an existing file) and the -o option, which currently isn't necessary since the only format supported is POV-Ray. Specifying any other type will cause gears to tell you the type is invalid.

The command line would then look like this:

gears -h 0.2 -r 1.35 -n 10 -s 4 -H 0.3 -c 1.1 -w 2.5 -f mygear.inc -N mygear

Viola! Your gear is ready for inclusion in your scene file.

HOW DOES IT WORK

Gears uses a cylinder for the hub of the gear. If spokes are used then the cutout is a cylinder and the spokes are boxes unioned to the hub. The teeth are two sets of points: the points along the edge of the hub which make up the bottom edge of each tooth and the points which are the top of the tooth. Each tooth is made up of a set of triangles: One on the front and back of the tooth, and two for each side of the tooth (6 triangles total for each tooth). Theres really not all that much to it.

SEE ALSO

coils(1), genf(1)

BUGS

It was quick and dirty and if you do stupid things it breaks. So, don't do stupid things.

AUTHOR

Copyright 1996 by Michael J. Hammel <mjhammel@csn.net>

(clear space) Michael J. Hammel <mjhammel@csn.net>
(clear space) Created: June 7, 1996
Updated: June 7, 1996