VERSION 7
DEMOINIT
ORIG 10.000 0.000 0.000
PARAMETER display labelscale 10
PARAMETER display description-fontsize 144
STRAIGHT 1 0 0 0 0 DEMO 2
	E 23.086096 1.459535 254.675892
	E 72.500000 15.000000 74.675892
	END
STRAIGHT 2 0 0 0 0 DEMO 2
	E 1.770859 28.642902 189.520022
	E 5.625000 51.625000 9.520022
	END
REDRAW
RESET
MESSAGE
Now we will create a helix in the corner of the layout connected to 2 tracks.
END
STEP
COMMAND Helix
PARAMETER helix radius 18.000
PARAMETER helix turns 1
PARAMETER helix elev 0.0
PARAMETER helix angSep 0.0
PARAMETER helix grade 0.0
PARAMETER helix vertSep 1.0
PARAMETER helix vertSep 0.0
MESSAGE
_________________________________________

We will be creating a helix with a Elevation Difference of 12", Grade of 1.5% and limit the Vertical Separation to at least 2".
END
STEP
MESSAGE
_________________________________________

First set the Elevation Difference to 12"
END
STEP
PARAMETER helix elev 12.0
BIGPAUSE
BIGPAUSE
MESSAGE
_________________________________________

Next set the Vertical Separation to 2"
Notice how this causes the number of Turns to be set to 6
END
STEP
PARAMETER helix vertSep 2.0
STEP
MESSAGE
_________________________________________

Next set the Grade to 1.5%
Notice how this causes the Radius to change.
END
STEP
PARAMETER helix grade 1.5
MESSAGE
_________________________________________

Setting these values changes the Radius to 21.2" and the number of Turns to 6.
END
STEP
MESSAGE
_________________________________________

Now we specify the Angular Separation between the enterance and exit to the helix.

Note: this will decrease the Radius slightly.
END
STEP
PARAMETER helix angSep 90.0
BIGPAUSE
MESSAGE
_________________________________________

Next we can fine tune the helix by decreasing the Radius to 15".
Note the change to the Grade.
END
STEP
PARAMETER helix radius 15.0
BIGPAUSE
MESSAGE
_________________________________________

Lastly change the Vertical Separation to 2.5".  The number of Turns will change to 4 and the grade increase to almost 3%.

Note: the Vertical Separation will be increased.  This value is the Elevation Difference (12.0) divided by the total number of turns.  The total number of turns is 4.25: 4 whole Turns plus a quarter turn for the Angular Separation.
END
STEP
PARAMETER helix vertSep 2.5
MESSAGE
=========================================
END
STEP
CLEAR
MESSAGE
Now that the helix parameters are set we can place the helix on the layout.
END
MOUSE 2 15.375 20.500
MOUSE 3 15.375 20.500
MOUSE 3 16.000 16.000
STEP
MOUSE 4 16.000 16.000
PARAMETER display labelenable 1
COMMAND MoveLabel
MOUSE 2 16.000 16.000
MOUSE 4 16.000 16.000
RESET
MESSAGE
_________________________________________

Next, join the 2 straight tracks to the helix in the same way we join to a circle.
END
STEP
COMMAND JoinTrack
MOUSE 2 1.875 30.000
MOUSE 4 1.875 30.000
MOUSE 2 1.000 17.375
MOUSE 3 1.000 17.250
MOUSE 3 1.000 17.000
MOUSE 3 1.000 17.000
MOUSE 3 1.000 16.750
MOUSE 3 1.000 16.500
MOUSE 3 1.125 16.500
MOUSE 3 1.125 16.375
MOUSE 3 1.125 16.250
MOUSE 4 1.125 16.250
MOUSE 2 28.125 3.000
MOUSE 4 28.125 3.000
MOUSE 2 16.500 1.000
MOUSE 3 16.500 1.000
MOUSE 3 16.375 1.000
MOUSE 3 16.125 1.000
MOUSE 3 16.125 0.875
MOUSE 3 16.000 0.875
MOUSE 3 16.000 0.875
MOUSE 3 15.875 0.875
MOUSE 3 15.625 0.875
MOUSE 3 15.500 1.000
MOUSE 3 15.375 1.000
MOUSE 4 15.375 1.000
MESSAGE
_________________________________________

Notice that the length has increased because we have more than 4 turns in the helix.  It is closer to 4.25 turns.
END
STEP
COMMAND Elevation
PARAMETER elev mode 0
PARAMETER elev value 0.000
PARAMETER elev station 
MESSAGE
_________________________________________

Next, we assign elevations to the 2 End-Points of the helix.  This will determine the grade and separation between the helix coils.

Note: we could set the elevations anywhere along the connecting tracks instead.  XTrackCAD treats a helix as a single length of track for elevations.
END
STEP
MOUSE 2 15.125 1.125
MOUSE 4 15.125 1.125
PARAMETER elev mode 1
PARAMETER elev value 1.000000
BIGPAUSE
MOUSE 2 1.250 16.000
MOUSE 4 1.250 16.000
PARAMETER elev mode 1
PARAMETER elev value 13.000000
PARAMETER elev ok
BIGPAUSE
RESET
REDRAW
MESSAGE
_________________________________________

We have set the elevations to 1" and 13" to produce a grade of 3.0% with 2.8" between coils.

You can use the <Describe> command to change the number of Turns or the Elevations at either end of the Helix.  This will affect the Grade and Vertical Separation.
END
STEP
MESSAGE
_________________________________________

The helix description can be moved by the <Move Label> command.
END
PARAMETER display labelenable 1
COMMAND MoveLabel
MOUSE 2 15.875 16.125
MOUSE 3 16.125 6.250
MOUSE 4 16.125 6.250
MESSAGE
=========================================
END
REGRESSION START 10 - helix
STRAIGHT 1 0 0 0 0 DEMO 2
	T4 5 25.749076 2.189249 254.675892 0 0.0 0.0 0.0 0.0 0 0 0 1.000000 
	E4 72.500000 15.000000 74.675892 0 0.0 0.0 0.0 0.0 0 0 0 1.000000 
	END
STRAIGHT 2 0 0 0 0 DEMO 2
	T4 4 2.583150 33.486562 189.520022 0 0.0 0.0 0.0 0.0 0 0 0 13.000000 
	E4 5.625000 51.625000 9.520022 0 0.0 0.0 0.0 0.0 0 0 0 13.000000 
	END
CURVE 3 0 0 0 0 DEMO 2 16.000000 16.000000 0 15.000000 4 0.125000 -9.750000
	T4 5 15.375542 1.013004 92.385944 9 0.000000 0.000000 1.000000 1.000000 1 1 0 7.000000 
	T4 4 1.002118 16.252065 0.962864 9 0.000000 0.000000 13.000000 13.000000 1 1 0 7.000000 
	END
CURVE 4 0 0 0 0 DEMO 2 116.974302 14.302953 0 115.988562 0 0.000000 0.000000
	T4 3 1.002118 16.252065 180.962864 9 0.000000 0.000000 13.000000 13.000000 1 1 0 13.000000 
	T4 2 2.583150 33.486562 9.520022 0 0.0 0.0 0.0 0.0 0 0 0 13.000000 
	END
CURVE 5 0 0 0 0 DEMO 2 16.787253 34.894082 0 33.910476 0 0.000000 0.000000
	T4 1 25.749076 2.189249 74.675892 0 0.0 0.0 0.0 0.0 0 0 0 1.000000 
	T4 3 15.375542 1.013004 272.385944 9 0.000000 0.000000 1.000000 1.000000 1 1 0 1.000000 
	END
REGRESSION END
STEP
CLEAR
