
C H A I N  

chain.txt  - reference manual for Chain(), a POV-Ray macro.
Created by PM 2Ring July-August 2005.

The Chain() macro makes a catenary, the proper curve of a homogeneous chain. 
The main parameters are: the link object itself, the start and end points of the chain,
and the chain slackness. Other parameters allow some fine-tuning of the layout of the chain.
_______________________________________________________________________________ 

Chain(Link, Start, End, Slack, Overlap, Alternate, AltPhase, Twist, StartSkip, EndSkip, OddLinks)

Parameters: 

Link
The Link object. 
One link of the chain. The chain is a union of these links with their x-axes running along the chain. 
In other words, at the centre of each link, the x-axis of the link is tangential to the catenary. 
The Link object is used as-is, no scaling is applied.
 
Start
The Start point. 
The co-ordinates of the centre of the first link in the chain.

End
The End Point. 
The co-ordinates of the centre of the last link in the chain.

Slack 
The Slackness of the chain. 
Slack is calculated as the chain length divided by the straight-line distance between the Start and End points. 
Slack must be greater than 1. The length will be adjusted upwards internally to ensure a whole number of links. 

Overlap
The link Overlap. 
The link length is internally divided by the Overlap. With Overlap = 1, the links just touch end to end, 
so in a realistic chain Overlap will be around 1.5, depending on the thickness of the links. 

Alternate
Alternating 90 degree twist on the X-axis. 
With Alternate equal to 1, adjacent links are aligned to each other with the usual 90 degree X-axis twist seen 
in normal chains. With Alternate equal to 0, no twist is applied. Other values may be used for odd effects.

AltPhase 
The starting Phase of Alternation. 
Select whether odd or even links are given the Alternating twist on the X-axis. 
Only has effect if Alternate is non-zero.

Twist
Extra X-axis Twist on the whole chain. 
Twist is given in whole cycles, so a Twist of 1 causes the chain to be twisted by 360 degrees from start to finish. 
This Twist is in addition to any twist specified by Alternate.
 
StartSkip
The number of links to Skip at the Start of the chain. 
These links are simply deleted from the chain. This doesn't affect any of the other calculations.   

EndSkip
The number of links to Skip at End of the chain. 
These links are simply deleted from the chain. This doesn't affect any of the other calculations.   

OddLinks
Force the total number of Links in the chain to be Odd, for symmetry reasons.  

_______________________________________________________________________________ 

