Rail3D*

   

 

How To Reflect Strips



Strips are very useful and efficient for building complex shapes like the side walls of carriages. It’s not that difficult to create them, but unfortunately there aren’t many tools in the editor for manipulating them yet. A common task is reflecting a strip in the W direction (e.g. to make the second side of a vehicle). Imagine you have a strip like this for the side wall of a loco:

 
STRIP  217:30:25 
134/75/25 1/0/0 @0.014,0.5
134/1405/25 1/0/0 @0.756,0.5
134/55/125 1/0/0 @0.011,0.653
134/1425/125 1/0/0 @0.770,0.653
134/55/150 1/0/0 @0.011,0.685
134/1425/150 1/0/0 @0.770,0.685
134/100/307 1/0/0 @0.031,0.903
134/1380/307 1/0/0 @0.748,0.903
125/117/330 1/0/1 @0.035,0.930
125/1363/330 1/0/1 @0.743,0.930
ENDSTRIP

How do you create the matching strip for the other side?

The first step is to copy the strip, and change the signs of the W coordinates of the points and normals:

 
STRIP  217:30:25 
-134/75/25 -1/0/0 @0.014,0.5
-134/1405/25 -1/0/0 @0.756,0.5
-134/55/125 -1/0/0 @0.011,0.653
-134/1425/125 -1/0/0 @0.770,0.653
-134/55/150 -1/0/0 @0.011,0.685
-134/1425/150 -1/0/0 @0.770,0.685
-134/100/307 -1/0/0 @0.031,0.903
-134/1380/307 -1/0/0 @0.748,0.903
-125/117/330 -1/0/1 @0.035,0.930
-125/1363/330 -1/0/1 @0.743,0.930
ENDSTRIP

If you look at this in the preview, you’ll discover that it’s facing the wrong way (i.e. you’ve turned it into an interior wall!).

It’s simple enough to correct this - just reverse the order of the lines in pairs (i.e. drag the last two data lines up to the top, then the next-to-last pair, and so on.

 
STRIP  217:30:25 
-125/117/330 -1/0/1 @0.035,0.930
-125/1363/330 -1/0/1 @0.743,0.930
-134/100/307 -1/0/0 @0.031,0.903
-134/1380/307 -1/0/0 @0.748,0.903
-134/55/150 -1/0/0 @0.011,0.685
-134/1425/150 -1/0/0 @0.770,0.685
-134/55/125 -1/0/0 @0.011,0.653
-134/1425/125 -1/0/0 @0.770,0.653
-134/75/25 -1/0/0 @0.014,0.5
-134/1405/25 -1/0/0 @0.756,0.5
ENDSTRIP

Note how this has now caused the vehicle wall to be defined from the top down (before it was defined from the bottom up). This has the effect of making it visible from the opposite side instead.

An alternate method is to swap the order of each pair of vertices – i.e. insert the 2nd vertex before the 1st, insert the 4th vertex before the 3rd, etc. This reverses the direction of visibility without changing the order of the strip.

Both methods produce exactly the same result, but if you plan to do further work on the original strip and the reflected strip, the second method might make editing easier. (In the editor the reflected strip will read “upside down” if you used the first method.)

Note - the editor preview doesn’t always update correctly when you make changes in a strip - just insert and delete a blank line before the endstrip if your changes aren’t appearing.



import