Engineered by Richard Swika
Comments?
chainmaker@comcast.net.

Rick's Chain Maker is free tool for creating
depth maps representing 3 dimensional frames of
chain, in POVRAY (also FREE!)
You can generate just about any chain frame shape you will ever need,
at any resolution, by simply adjusting a few parameters. The depth
maps are ideal for use by Carvewright
and Sears Compucarve
CNC machines, and in reduced polygon 3D surface
modeling.
Just load this code into POVRAY then render the image.
Note,
for use with the CarveWright software, render .png files by entering
"Output_File_Type=N" on the POVRAY command line next to the resolution
pick list, or by adding this to your presets .ini file. Also, for best
results, use anti-aliasing (AA 0.3) or better when rendering.
|
|
|
|
Simple5x7Frame.pov |
|
The
output image is a gray scale depth map where the white level is
proportional to the height at each point. CNC machines can use this as
input to specify a precisely carved surface. Modelers can use this as
a bump map to add background detail without increasing scene
complexity.
There's actually 11 parameters you can adjust, but we'll just start out by using just 4 of them.
The first
thing you should learn is how to control the number of corners
the frame has by setting CornerCount, and
how many links of chain appear on the corners, by setting CornerLinkCount. For the straight sections, you
can specify two values, StraightLinkCountEven
and StraightLinkCountOdd
to be used alternately. The first straight section and every other even
straight section have StraightLinkCountEven
number of links. The second straight section and every other odd
straight section have StraightLinkCountOdd
number of links.
If you need a triangle frame, say 7 links x 7 links, with rounded corners of 3 links each, just set the CornerCount to 3, and decide how round you want the corners. In this example, I put 3 links on the corners and 7 links on each straight section:
|
|
|
|
Basic
7x7 TriFrame with Rounded Corners.pov
|
|
If you
need a pentagon with pointed corners, set the CornerCount to 5, and the CornerLinkCount
to 0. Set
StraightLinkCountEven and StraightLinkCountOdd to the same even value.
Make
sure you use an even value or you'll get a pentagon with ends that
don't mesh perfectly.
|
|
|
|
Pentagon.pov |
|
Since
chain maker uses full links of all the same size, it is possible to
specify a design that doesn't join up completely, leading to awkward
and
unbalanced looking results. Sometimes you have to adjust the link count
or other parameters to get a perfect mesh, if that is what you are
going for.
|
|
|
|
Pentagon that doesn't mesh.pov |
|
There are
three parameters to control the dimensions of the individual links,
including the overall length of the link, LinkLength, the
radius of the cuved section of the link (outside diameter), LinkRadius, and
the radius of the wire used to make the link, WireRadius. Here
is the same 5x7 picture frame as in the first example above, but with
a LinkLength
of 1.95,
as opposed to the default value of 1.5 used above.
If you are using the default value for a property, as in the examples
above, you can omit them from your .pov file.
|
|
|
|
You can adjust link dimensions.pov |
|
The next
two parameters, InitialTwist
and TwistDelta
are perhaps the most interesting and powerful. The first of these, InitialTwist
sets the starting twist angle of the first link. It default to 0, but other
values such as 30,
45, and 60 can offten produce interesting effects.
|
|
|
|
Offset5x7Frame.pov |
|
Up utill now, all of the examples have used a TwistDelta of 90 degrees. The means that each new link was rotated by 90 degrees, like an untwisted chain. To get the appearance of a twisted chain, you can use values for TwistDelta other than 90. If you want to get a perfect mesh, you may need to do some calculations or experimentation. Values like 15, 30, 45, 60, 75 often give interesting results, but it all depends on the number of links and corners. Twisted chain frames with rounded corners seem to work better then pointed corners, so for best results, try using a CornerLinkCount of 3 or more with TwistDeltas other than 90.
|
|
|
|
Twisted5x7Frame.pov |
|
If you walk
all the way around any of the above frames, you will
have rotated by 360 degrees, regardless of the number of corners. The
sum of all the corner angles is named the InteriorAngle and it defaults to
360 degrees. You make the chain cross over itself by making the InteriorAngle greater than 360. For example, if you
set the InteriorAngle to 720, you will make two complete rotations.
Then, as long as you use a Odd CornerCount,
you'll
get a star like shape.
|
|
|
|
Chain Start Power.pov |
|
Use a
non-zero CornerCount if you want rounded
tips.
|
|
|
|
Chain Flower Power.pov |
|
If you use an
Even CornerCount, you'll end up
traveling on the same path after the first revolution, so you can use TwistAngle to get multiple
strands of twisted chain for some more possibilities.
|
|
|
|
Chain Frame.pov |
|
Sometimes,
not twisting at all can lead to interesting results.
|
|
|
|
Spirograph.pov |
|
You can
transcend the limitations of real chain by entering values that cause
neighboring links to intersect, producing many interesting braids,
weaves and rope like effects.
|
|
|
|
Tight Chains.pov |
|
|
|
|
|
Maggot Frame.pov |
|
|
|
|
|
Putting it all Together.pov |
|
You can get some very alien and unexpected looking results.
|
|
|
|
Strange
Frame.pov |
|
When you aren't getting a complete 90 twist on the link, such as in the following example where TwistDelta is 0, it is useful to boost the exposure to be greater than 1. This scales the gradient representing depth.
|
|
|
|
A strange effect.pov |
|
|
|
|
|
Interesting Texture.pov |
|
If you keep increasing the exposure you will reach the point where gradient will cycle back to black, introducing even more interesting possibilities.
|
|
|
|
A strange effect.pov |
|
The chain maker macro attempts to auto scale the output for you, but sometimes whey you are doing unusually patterns, the image may be slightly under or oversized. In these cases you can adjust the Zoom parameter. If you make the Zoom greater than 1, you will magnify the image proportionally. If the image overflows the boundaries of the screen, use a Zoom value less than 1.
|
|
|
|
Basket Weave.pov |
|
|
|
|
|
Overexposed Basket Weave.pov |
|
|
|
|
|
Alien Opening.pov |
|
That should be enough to get you started if you think Chain Maker is for you. I have really have just scratched the surface of what is possible with procedural surface generation in POVRAY. If you come up with some neat patterns or discover some thing interesting using my Chain Maker, please send them to chainmaker@comcast.net.
Rick's Chain
Maker is the copyrighted intellectual property of Richard Swika. You
may use the output of Rick's Chain Maker in any way, but you
may not legally resell or distribute the Chain Maker source code or the
contents of this website without the express written permission of
Richard Swika. You may not claim authorship to the chain maker concept
or to be the original creator of the resulting artwork.
Thanks and
acknowledgments to the POVRAY team for making tools like Chain Maker
possible and free!
Much respect. Forward all donations to POVRAY.