Tracks types are loaded dynamically and custom track types can be created in the 'tracks/' folder.
This document describes how to create custom track types. The existing tracks are also great for understanding file structure and how the models are drawn.
The name of the track's directory is also the id of this track type. This directories name must start with your initial or some other rather unique character combination, followed by an underscore (_), to prevent name collisions.
IDs without leading initials (such as 'conctete_ties rather than 'ene_concrete_ties') are reserved for the tracks shipped with the extension (and 'ene_' prefix is already reserved by me, Eneroth3). Using such an ID for your own track may lead to it being overwritten when updating the extension. Create a directory with the chosen ID as name in 'tracks/' to save the files for the track in.
Basically a track consists of extrusions (yellow), arrayed elements (red) and endings (green). The rails and track ballast are typically extrusions while ties/sleepers are arrayed and buffer stops are endings.
For backward compatibility save models as version 2013.
The extrusion faces are saved in a file named 'extrusion_profile.skp'. Each face in this model must be in its own group. By separating faces to individual groups unnecessary vertices from edges binding other faces can be avoided, reducing the number of faces created in the extrusion.
The groups can be painted with a material or left without material so the user can paint the track themselves. The faces should be drawn in the models x-z plane with the front of the face pointing towards negative y.
The most important extrusions may be the 2 rails. The standard gauge (distance between inner sides of rails) is 1,435 m. The top side of the rails must be along the x axis. The inner side should be half the gauge distance from the model origin. Many tracks share the same rails and ballast as the default one so these 3 groups can be copied and paste in place in the new track's extrusion file.
Components can be arrayed along the tracks. This is most often done with ties/sleepers.
These components are saved by the name 'along_<distance>_tie.skp' where <distance> is the distance between them in meters with a point (.) as decimal mark. '_tie' may be used in a future version of the plugin to separate ties/sleepers from other components and should be left out for these.
Also in these files x axis represents the top of rail plane and ties/sleepers should normally be underneath it but centered at origin in horizontal(x-y) plane.
Often track types have the same ties/sleepers as the default one and then that model can be copied to their folder.
Components can also be added at the end of either each piece of track, where the track type changes (e.g. start of inner rails for bridges or tunnels) or where the track comes to an halt (e.g. buffer stop).
Endings are typically based on the extrusion profile model with the faces push-pulled towards negative y. It's also possible to do it the other way around; starting with the ending and copy faces from its x-z plane to use for the extrusions. Positive y is where the rest of the track will be.
These files should be named as following:
To create or edit track information run Ene_Railroad.property_editor in the Sketchup console. Select track, type in the ID of your track and then enter the information for it.
Name should start with gauge in millimeters unless it is default (1435 mm) or it's irrelevant, e.g. for monorail tracks. If the track type is specifically made to match a structure, use name same name as for the structure.
There's a tiny space to show a track description with the most vital information such as what time this track type was built.
To create the preview image of the track, open preview.skp in tracks/. Change track type of the track in the model by right clicking it and open track properties.
The closer to 1362 * 610 the viewport size is, the better line thickness will match other previews. My Viewport Resizer can be used to achieve this.
If you've drawn your track at another scale you can zoom in to make it more visible, otherwise you can use the camera location of the scene to make it match other track previews.
Run this code in console to save preview image:
The whole folder for the track type can easily be compressed, shared, and decompressed in someone else's track folder.
Copyright © Julia Christina Eneroth 2014. This document may not be modified, including translated, without permission.