Using this object as bevel curve, it is easy to generate railroad tracks. Now, how would you do add sleepers at regular intervals along the track?
Array modifier springs to mind as sleepers are somewhat of an array. It does however depend upon the way you want to extract (excuse my use of language, English is not my native language) your track.
If you intend to make some straight track, I would first create the tracks, 60 cm looks kind of right. Create a sleeper next and join it all as one object (sleeper as "root" works fine for me). I hope the included pictures enlighten you a little.
A straight track might look like this and can use an relative interval of 1:
To create a curve, this method is to crude: you get a lot of jagged connection, though if the track is only a very minor part of your scene, it might work. I reduced the interval to 0.95 to avoid gaps in the outside curve.
As you may see from my examples, I replaced your nice track-profile with a fairly crude modified cube.
I hope this helps you a little, kind regards, Christiaan
Chaining the "Array" modifier and the "Curve" modifier solves the problem. The sleeper mesh should be aligned with its longest side in the y direction.
If you're being picky, and want continuous track and no curve-distortion on the sleepers.. you could use Dupliframes.
- Create the curve that will be the route
- Create a single curve (with two identical splines) that will be the profile of the rails
- Create a solid (cuboid) sleeper
Here, looking down in Z, the sleeper oriented as you would expect, with respect to the rail profile.
The objects are to scale with the route curve. Ensure CtrlA > all transforms are applied, and the objects therefore share a pivot point at the origin.
- Now Set the rail profile as the Bevel Object for the route curve in its Data > Geometry panel.
- Set an animation length of the number of sleepers you want to lie along the track
- Assign a 'Follow Path' constraint to the sleeper object Target: the route curve, 'Follow Curve' checked, Forward:Z, Up:Y. The sleeper should jump to the route. Do not hit 'Animate Path' for this method.
- At Frame 1 of your animation, right-click > keyframe the 'Offset' field of the constraint to 0, and at the last, key it to the last frame number.
- In the sleeper's Object > 'Duplication' panel set the duplication to 'Frames'.
Note that you can not key the 'Offset' field if the sleeper 'Duplication' is set; put it back to 'None' to make revisions.
You may need to select a sleeper, and go into a Graph Editor window to set the animation curve of its constraint offset to Linear, to prevent an ease in and out of the number of sleepers at the beginning and end of the route. Select its 2 Keyframes, and hit T > Linear.
To make the Duplis into instances, you can hit CtrlShiftA > 'Make Duplicates Real'
It's possible this method is too much fuss for the difference it makes.