Jump to content

Resizing the base plate, and importing contours.


Recommended Posts

May not be the right group.. but if I resize the base plate, it should keep the current origin, position, orientation, and grid size of the current base plate..... possibly with the option to indicate where you want the extra space to be relative to the current layout. e.g. X := centered, left, right, Y:= top, middle, bottom

Also... when importing the landscape bitmap, it would be helpful if it defaulted to the current max Y value.

Link to comment
Share on other sites

Hi Trevor,

I guess you want something like this:

Expanding the base plate

I am sorry that this thread is only in german, but I hope you will understand the images to give you an idea how to arrange the base plates. You will need csv- export and import. Find the bodenplatten-management.zip containing a spreadsheet (:(german) to calculate the new dimensions.

Please ask me for further information. I will try to translate this thread soon.

Regards, Henry

Edited by Henry
Link to comment
Share on other sites

Hi trevor,

.... when importing landscape bitmap or landscape .csv you can set an offset....

1) Panel1

2) .... export landscape as .csv (or bitmap)

3) Panel2...
Bild 2.jpg

4) ... import .csv (or bitmap) and set offset (Origin) [Note it is in mm]Bild 3.jpg

.... so you can expand in all directions.
Bild 4.jpg

Note: the Grid size of both panels must be the same...
Bild 5.jpg



Edited by EASY
Link to comment
Share on other sites

Thanks Henry and Easy,

Yes I pretty much figured out that would be the only method to shift the contour map.... bit of a painful process though.... and it wont fix the texture map. 

Re the default elevation on import thing..

I find the current dialog frustrating. Every time I import I need to guess at a number, see what happens, undo, then do a repetitive higher-lower game to get it right....

plus the dialog remembers NOTHING so it's not an overly fast procedure.


Link to comment
Share on other sites

I figured out a quick and dirty way to "FIX" and know the height to enter on the imported bitmap when you massage (blur etc.) part of the contour bit map..

Before you export create a single point peak at the corner of your layout and set it's height manually to a number greater than the current max.

Then do the export, and do what you will with the image remembering NOT TO manipulate the image in that corner or add areas that are brighter than that point.

When you import use the same value you entered here for the max height.

(If you write down what that point was before you can set it back quickly too...)


Edited by trevor
Link to comment
Share on other sites

Hello Trevor,

if you do not exceed the upper and lower limits of the original height profille, you need not to define this special point with specified height.

When marking the whole base plate in the height mode, ...


... you see the minimum and maximum height of your profile in the property window in the lower right (green and red surrounded). When you memorize these values, you can them specify as lower an upper limits of the height area when importing the height bitmap again.

Import mit Höhengrenzen.jpg

But please take into account, that the maximum resolultion of the grayscale bitmap is 256, so that you are not able to reconstruct a landscape profile with more than 256 scale factors with this method. Then, you need the CSV-formatted export file to re-imort the landscape profile again with no loss of original details. In that case, the original height values will be saved, so that you need not to remember the existing height limits.

Many greetings


Link to comment
Share on other sites

Thanks Bahnland.

I did have that idea in my head too... though the selecting all part kind of eluded me LOL... (A feature that is conspicuously absent...)

Thanks for pointing out the grey scale factor, I had not considered that fact. hmm...

I'm using a simple paint-shop like program to smooth or add texture to my data... it there a better tool you use that works with the csv?
Or do I have to write one of those too LOL ....

Best regards


Link to comment
Share on other sites

Hello Trevor,

I have written a little program for my own purpose, which reads CSV files and converts them to a bitmap in grayscale and in pseudocolor.

When exporting a landscape profile from a TrainStudio base plate to a CSV file, each value triple beeing written to the CSV file repesents the coordinates of one raster point of the base plate, where the 1st and 2nd value are the numbers of the raster point in x- and y-direction (beginning counting with 0), and the 3rd value represents the absolute height of the raster point in mm, with 3 decimals behind the decimal point (it must not be a comma, because this is the separator of the values).

When reading this CSV file with my program, the dimensions of the bitmaps been created are the maximum number coordinates of the raster point matrix. When converting the CSV data to the pseudocolor bitmap, each CSV value triple will be converted to a bitmap pixel, whose coordinates correspond to the x- and y-numbers of the value triple, and whose color corresponds to the height value, multiplied with 1000, where the resulting integer value is interpreted as a 3-byte RGB value (lower value byte = red, middle value byte = green and upper value byte = blue color part). After the pseudocolor picture is completed, the grayscale picture is converted from it by convertimg the lowest RGB integer value to 0 and the highest RGB integer value to 255. All other color values then are interpolated.

If you are interested, you can try the program, which I have added here als a ZIP file.


But take into account, that it is in German and not yet documented.

The main window contains a list area at the left side for the CSV file content to be read in or written out. The remaining main window shows the grayscale picture at the left and the pseudocolor picture at the right. Below the main window, there is a status and button line. The buttons are grouped into partitions for loading, conversion and saving.

The loading part contains (from left to right) follwing functions:

  • 2. Bild (2nd picture) - ignore it
  • CSV - load CSV file (.csv) and convert it to pseudocolor and grayscale picture
  • Bilder (pictures) - convert existing CSV data to pseudocolor and grayscale picture (e.g. restoration after picture modifications)
  • Graubild (grayscale picture) - load grayscale picture from bitmap file (.bmp)
  • Buntbild (pseudocolor picture) - load pseudocolor picture from bitmap file (.bmp)

The conversion part contains (from left to right) follwing functions:

  • www x hhh - These are the dimensions of the bitmaps shown above (www = width, hhh = height). Click to this button, if you want to reduce them. After you have clicked on it, it will be changed to an edit field, where you can overwrite the current content. Press the <enter> key to accept the modification or doubleclick to the edit field to discard the modifications (the old content remains unchanged). 
  • Maximum - ignore it
  • Konturlinien (contour lines) - create contour lines with fixed value distances, specify the value distance to be used by the button at the rigt side from it
  • Grenzlinien - ignore it
  • Kanten - ignore it
  • Flächen (areas) - create an interpolated area between neighboring contour lines
  • bbb + hhh - specify base (bbb) and height (hhh) above for justification the color bitmap before conversion to CSV
  • CSV - convert bitmap to csv data. The result will be written to the left side main window and overwrite there the old content

The saving part contains (from left to right) follwing functions:

  • Bild links (left picture) - save the leftside picture to a bmp-file
  • Buntbild (pseudocolor picture) - save the rightside picture to a bmp-file
  • CSV - save the CSV data from the leftside main window to a csv-file

With the last (rightmost) button, you exit the program.

The functions, which I have described above as to be ignored, are specific functions to be used by me for creating the Gotthard layout. To describe their functionality, I must self look again to the program source, because I have not documented the whole program (sorry).


This is the "Göschenen" module of my Gotthard layout.


The corresponding CSV content ist shown at the left side of the picture above. The remaining picture shows the module profile as a grayscale picture.


This is the pseudocolor picture representing the profile of the Gotthard module shown above.

Now, you may try this program if you are interested. I hope, that it is understandable with the little description above.

Many greetings


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...