Rail3D*

 User Name: Password: Remember me next time.

A pair of scripts adapted from Mark Hodson's 10 Degree Points, allowing the user to specify the point geometry in the form of Crossing Rate and Curve Radius. The Crossing Rate is the reciprocal of the angle of the rails when they cross, in radians - a rate of "8" corresponds to an angle of "1/8 radians". The Curve Radius is the radius of the curve used for the points. The scripts could be modified to take a crossing angle in degrees, or a set of scripts of specific geometries could be made.

The following tables give some prototypical values for geometries.

`Radius  Rate  km/h  mph190     7     35    20250     8.25  40    25300     9     45    30500     12    60    40800     15    75    451200    18.5  85    50`
`Radius  Rate   km/h  mph141     7      30    20184     7      30    20246     9.25   40    25332     10.75  50    30645     15     65    40981     18.5   80    501264    21     95    601650    24     115   703000    32.365 145   90`

Right Hand

`// Script to create a custom right hand pointInit(){  node mNode=Document.GetCurrentNode();  node Node1=mNode.GetConnectedNode(0,0);  node Node2=mNode.GetConnectedNode(1,0);  float x=mNode.GetX();  float y=mNode.GetY();  float z=mNode.GetZ();  float alpha=mNode.GetAlpha();  float xb=Node2.GetX();  if(xb==0)  // Which way to go?  {    alpha=3.1417+alpha;  }  float angleInput=InputFloat("Crossing Angle, 1 in x");  float radius=InputFloat("Curve Radius, m");    float angle=1.0/angleInput;  // Some useful(?) numbers  float gauge=1.435;  // Std gauge++  float TrackSpace=Document.GetLineSpacing();    // Hypotenuse to Adjacent  float length=(gauge/tan(angle))*2.0;  float alpha2=alpha+angle;  // Calc position of furthest end  float x2=x+(length*sin(alpha));  float y2=y+(length*cos(alpha));  // Centre  float xc=x+((length/2.0)*sin(alpha));  float yc=y+((length/2.0)*cos(alpha));  // Calc position of left leg  float x3=xc+((length/2.0)*sin(alpha2));  float y3=yc+((length/2.0)*cos(alpha2));  // Calc position of right leg  float x4=xc-((length/2.0)*sin(alpha2));  float y4=yc-((length/2.0)*cos(alpha2));  // Extensions for required track spacing  float remainingSpace=(TrackSpace/2.0)-gauge;  float SpaceLength=remainingSpace/tan(angle);  x2=x2+(SpaceLength*sin(alpha));  y2=y2+(SpaceLength*cos(alpha));  x3=x3+(SpaceLength*sin(alpha2));  y3=y3+(SpaceLength*cos(alpha2));  // Build links  Document.BuildLink(x,y,z,x2,y2,z);  Document.BuildLink(x4,y4,z,x3,y3,z);  Document.BuildLink(x,y,z,x3,y3,z);  Document.DeleteNode(x4,y4);  // Calc position from new ends  float xs=x2+(SpaceLength*sin(alpha));  float ys=y2+(SpaceLength*cos(alpha));  Document.BuildLink(x2,y2,z,xs,ys,z);  xs=x3+(SpaceLength*sin(alpha2));  ys=y3+(SpaceLength*cos(alpha2));  Document.BuildLink(x3,y3,z,xs,ys,z);}`

Left Hand

`// Script to create a custom lefthand pointInit(){  node mNode=Document.GetCurrentNode();  node Node1=mNode.GetConnectedNode(0,0);  node Node2=mNode.GetConnectedNode(1,0);  float x=mNode.GetX();  float y=mNode.GetY();  float z=mNode.GetZ();  float alpha=mNode.GetAlpha();  float xb=Node2.GetX();  if(xb==0)  // Which way to go?  {    alpha=3.1417+alpha;  }  float angleInput=InputFloat("Crossing Angle, 1 in x");  float radius=InputFloat("Curve Radius, m");    float angle=1.0/angleInput;  // Some useful(?) numbers  float gauge=1.435;  // Std gauge++  float TrackSpace=Document.GetLineSpacing();    // Hypotenuse to Adjacent  float length=(gauge/tan(angle))*2.0;  float alpha2=alpha-angle;  // Calc position of furthest end  float x2=x+(length*sin(alpha));  float y2=y+(length*cos(alpha));  // Centre  float xc=x+((length/2.0)*sin(alpha));  float yc=y+((length/2.0)*cos(alpha));  // Calc position of left leg  float x3=xc+((length/2.0)*sin(alpha2));  float y3=yc+((length/2.0)*cos(alpha2));  // Calc position of right leg  float x4=xc-((length/2.0)*sin(alpha2));  float y4=yc-((length/2.0)*cos(alpha2));  // Extensions for required track spacing  float remainingSpace=(TrackSpace/2.0)-gauge;  float SpaceLength=remainingSpace/tan(angle);  x2=x2+(SpaceLength*sin(alpha));  y2=y2+(SpaceLength*cos(alpha));  x3=x3+(SpaceLength*sin(alpha2));  y3=y3+(SpaceLength*cos(alpha2));  // Build links  Document.BuildLink(x,y,z,x2,y2,z);  Document.BuildLink(x4,y4,z,x3,y3,z);  Document.BuildLink(x,y,z,x3,y3,z);  Document.DeleteNode(x4,y4);  // Calc position from new ends  float xs=x2+(SpaceLength*sin(alpha));  float ys=y2+(SpaceLength*cos(alpha));  Document.BuildLink(x2,y2,z,xs,ys,z);  xs=x3+(SpaceLength*sin(alpha2));  ys=y3+(SpaceLength*cos(alpha2));  Document.BuildLink(x3,y3,z,xs,ys,z);}`
// Script to create a custom right hand point

Init()
{
node mNode=Document.GetCurrentNode();
node Node1=mNode.GetConnectedNode(0,0);
node Node2=mNode.GetConnectedNode(1,0);

float x=mNode.GetX();
float y=mNode.GetY();
float z=mNode.GetZ();
float alpha=mNode.GetAlpha();

float xb=Node2.GetX();

if(xb==0)  // Which way to go?
{
alpha=3.1417+alpha;
}

float angleInput=InputFloat("Crossing Angle, 1 in x");

float angle=1.0/angleInput;

// Some useful(?) numbers
float gauge=1.435;  // Std gauge++
float TrackSpace=Document.GetLineSpacing();

float length=(gauge/tan(angle))*2.0;

float alpha2=alpha+angle;

// Calc position of furthest end
float x2=x+(length*sin(alpha));
float y2=y+(length*cos(alpha));

// Centre
float xc=x+((length/2.0)*sin(alpha));
float yc=y+((length/2.0)*cos(alpha));

// Calc position of left leg
float x3=xc+((length/2.0)*sin(alpha2));
float y3=yc+((length/2.0)*cos(alpha2));

// Calc position of right leg
float x4=xc-((length/2.0)*sin(alpha2));
float y4=yc-((length/2.0)*cos(alpha2));

// Extensions for required track spacing
float remainingSpace=(TrackSpace/2.0)-gauge;
float SpaceLength=remainingSpace/tan(angle);

x2=x2+(SpaceLength*sin(alpha));
y2=y2+(SpaceLength*cos(alpha));

x3=x3+(SpaceLength*sin(alpha2));
y3=y3+(SpaceLength*cos(alpha2));