Creating Structure Type

Structure types are loaded dynamically and custom structure types can be created in the 'structures/' folder.

This document describes how to create custom structure types. The existing structures are also great for understanding file structure and how the models are drawn.

Create Directory (And define ID)

The name of the structure's directory is also the id of this structure 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 'bridge rather than 'ene_bridge') are reserved for the structures shipped with the extension (and 'ene_' prefix is already reserved by me, Eneroth3). Using such an ID for your own structure may lead to it being overwritten when updating the extension. Create a directory with the chosen ID as name in 'structures/' to save the files for the structure in.

Making the Models

Basically a structure consists of extrusions (yellow), arrayed elements (red) and endings (green). Tunnel portals and bridge heads are typically endings.

For backward compatibility save models as version 2013.

Extrusion Profiles

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 structure (e.g. painted metal bridge) themselves. The faces should be drawn in the models x-z plane with the front of the face pointing towards negative y. When making a tunnel ceiling however the face can be oriented the other way so the front faces are oriented towards the inside when extruded. The x axis represents the top of rails plane.

Arrayed Elements

Components can be arrayed along the structures, for instance pillars.

These components are saved by the name 'along_<distance>.skp' where <distance> is the distance between them in meters with a point (.) as decimal mark.

Also in these files x axis represents the top of rail plane.

Endings

Components can also be added at the end of structures (e.g. tunnel portal or bridge head). This file should be named 'ending.skp'.

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 structure will be.

Double Tracks

For double track bridges, tunnels and other structures, draw the structure for the rightmost track (furthest towards positive x). This makes the Add Structure Tool more consistent. A double track bridge should for instance be extended by the track's center distance towards negative x. A platform should be drawn at positive x.

Creating Info File

To create or edit structure information run Ene_Railroad.property_editor in the Sketchup console. Select structure, type in the ID of your structure and then enter the information for it.

Naming Convention

To make it easier to find the structure in the alphabetic list the name should be a comma-separated list as following:

Examples:

Corresponding Track Type

If the structure requires a special track type, e.g. with track ballast adapted to its width, reference to it by ID (not name). Otherwise leave field blank.

Corresponding Signal Type

ID of signal type to use by default for this structure, blank or "NONE" if this structure should be without signals.

Parallel Distance

If structure is made to hold multiple parallel tracks, write the center distance between them. Otherwise leave field blank.

Track Number

If structure is made to hold multiple parallel tracks, write the number of them. Otherwise leave field blank.

Height Offset

How far above the ground the track is by default, typically used for viaducts and elevated tracks.

Create Preview Image

To create the preview image of the structure, open preview.skp in structures/. Draw a structure that either has no, one or both ends visible inside the viewport depending on what's relevant. If the structure is made to cover multiple tracks you can center it at the track in the model to make it centered in the preview image.

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.

The scene in the model makes the preview match other previews. If it doesn't show what's relevant you can move the camera. To make the view visually match other previews you can have another instance of the file open with the default camera location to compare the view with.

Hide Hidden Geometry to hide the track.

Run this code in console to save preview image:

Ene_Railroad.save_preview_image

Distributing Structure

The whole folder for the structure type can easily be compressed, shared, and decompressed in someone else's structure folder.

Copyright © Julia Christina Eneroth 2014. This document may not be modified, including translated, without permission.