coils [ -as? ] [ -r rotations ] [ -t tightness ] [ -w width ] [ -W width ] [ -f filename ] [ -N object ] [ -o output_format ]
The coils program produces an output file suitable for use with rendering programs that model coils or springs. Currently only POV-Ray include files are supported for output formats.
The final object is centered about the origin and the X axis. This means the left and right ends of the coil are equadistance along the X axis from the origin. The coordinates of both ends of the coil are provided in the comment section of the output file. No textures are provided.
-r rotations | Specifies the number of 360 degree rotations in the coil. |
-t tightness | Specifies the offset of end of rotation from start of rotation along rotation axis. |
-w radius | Specifies the radius of the coil strand (minor radius of torus). |
-W radius | Specifies the radius of a single rotation (major radius of torus). |
-s | Use the sturm option for all torii. |
-a | Append to output file, if it already exists. |
-f filename | Filename to write output to (default: coils.inc). |
-N object | Name of the object (default: coil). |
-o type | Output format type. This can be one of the following:
|
Suppose you want to create a coiled strand around a barrel, where each rotation of the coil touches its adjoining neighbor. Suprisingly, thats exactly why I wrote this little ditty. How would you do this? You need to know the following things:
We also want two of these coils, with unique names but in the same include file. The include file should be called "mycoils.inc". We'll need to run the coils command twice. The first invokation would be as follows:
coils -r 10 -w 1.6 -W 3.6 -t 3.2 -f mycoils.inc -N coil1
The next invokation needs to tell coils program to append to an existing file. We do this with the -a option:
coils -a -r 10 -w 1.6 -W 3.6 -t 3.2 -f mycoils.inc -N coil2
Viola! You now have two coils named coil1 and coil2 that can be used within your POV-Ray scene file.
It was quick and dirty and if you do stupid things it breaks. So, don't do stupid things.
The command line options use atof() to convert the input to a double. This only provides 6 digit precision unfortunately. I'm too lazy to convert this to a long double function so if you need greater precision you'll need to replace the atof() calls to your own version.
Torii are notorious for slowing the processing of an image. Although a bounding box around the coil helps speed processing, you should be aware that the coil itself will be quite slow to render, especially if you include a large number of rotations.