Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - GG_Train

Pages: 1 [2]
Updates are slow, but work is being done. In order to get quicker rendering, the number of faces must be reduced.  This image is of Girard Street in Tottenville looking towards the tracks.  Originally this view which is is 25 meter section had 12000 faces. It now has only 2000 with better detail because the textures are image files rather than vectors. An automobile that once had 500 faces now has 25. A bus with 1200 faces now has 55. More textures have to be loaded, so I am not sure if there is a downside to that.

Another street scene on Ellis Street which runs adjacent to the tracks with fictitious bus route.  More updates for downloads to follow. Buses and cars will be included.

OK. Here you go.  A zip file containing all the files of my work done so far.  Included are all the SketchUp files also.  See my tutorial on how to convert SketchUp files to CSV format.

Hi,  I would like to share with you the process of converting SketchUp files to CSV format.  This has been successful in thousands of conversions with the exception of ONE single failure due to hidden geometry causing null faces.  There are 2 versions of this conversion: the first will convert each SketchUp image to have triangular faces only; the second or enhanced version eliminates common sides of the triangles to create a many sided polygon.  The limitation here is that concave polygons will not render correctly in most cases.  This limitation is by design in OpenGL, so the best way to eliminate the concave polygons is to do it manually in SketchUp rather than via an external conversion program which would be very complicated to design and build for 100% accuracy.  It is much easier to add a few lines in SketchUp.

The results are never distorted and are on the proper axis.

STEP 1 contains the executable files SketchUPXML2CSV.exe and SketchUPXML2CSVEnhanced.exe.  Place them in a directory of your choice.

STEP 2 contains the Ruby Script files to act as Plugins for SketchUp 2017.  These files are bve_export.rb, bve_export_enhance.rb, and b3d_config.rb.  You edit and must substitute the directory name including drive letter of the location of the executable files in bve_export.rb and bve_export_enhance.rb.  All 3 files should be placed in the following directory "C:\Users\%USERNAME%\AppData\Roaming\SketchUp\SketchUp 2017\SketchUp\Plugins".


Close SketchUp if it is already opened.  Open up SketchUp again and you will notice the following added under Tools

Enhanced Export to BVE
Enhanced  Export Selected to BVE
Enhanced Export to BVE 2 Sides
Enhanced  Export Selected to BVE 2 Sides
Export to BVE
Export Selected to BVE
Export to BVE 2 Sides
Export Selected to BVE 2 Sides

As stated before the enhanced tools create polygons from common sided triangles while the standard version just uses the triangles. The Selected versions only convert the currently selected faces in SketchUp. 2 Sides outputs 2 sides of the face.  Trees and fire hydrants use 2 dimensional images that cross each other at right angles.  SketchUp files using images such as these require the 2 sides to be drawn.


The conversion process works as follows:  SKP ==> XML ==> CSV

The Ruby Script files convert SKP files to XML format using SketchUp's internal objects to cycle through the faces organized by material.  The executable files SketchUPXML2CSV.exe or SketchUPXML2CSVEnhanced.exe convert XML files to CSV format.  These executable files are created via Visual Studio 2017 C# solutions.  I have attached zip files and  Each contain the C# solution and source code for the appropriate conversion program.  Other solutions could be built for formats other than CSV.  The XML files can be deleted manually as they are never needed after the conversion is successful.  I could have put some code in place to perform that task automatically.  I may do so in the future.

If the conversion programs find a material name in SketchUp preceded by a #, it will also set an emissive color. This is useful for lighting.  For example, a material name of #Green which contains an RGB value of (0,255,0) will set an emissive color using the same RGB values.  When applied to a signal it would show a lighted green color.

NEVER use "<" or ">" characters in material names.  The XML loader will fail.  I may add code to substitute those characters with "[" and "]" respectively.

Textures using files have no prefixed directory.  The assumption is that the texture files reside in the same directory as the CSV file.

An example of a generation of concave polygons would be a ring or border. For the enhanced conversion to work correctly, rectangular borders must have their edges connected by a diagonal line to eliminate the concave polygon.  Rings have two circles whose edges must be connected by a line.  Also concave polygons can be eliminated by using the Fredo Tools Curviloft plugin in SketchUp.  I would use this plugin for subway door window borders.

The zip files are located here:,r2c6z6p3ulx87ip,8y7gaww777p2quw/shared

Ok, I have not posted in a while. I was away on vacation a lot over the summer and now I am working on my O-Gauge subway layout in addition to this.  I have the tracks down from Tottenville to Richmond Valley Road.  No new signals have been added yet and I am working on scenery which is about 400 meters away from the Arthur Kill Road station.  Here is a shot of beautiful Tottenville USA.  I have one fictional apartment house and may add another mid-rise.  After all, Staten Island will have some Queens influence as it now has a subway.

Regarding the conversion program from SketchUp.  I will share this in detail.  The conversion has only failed ONCE because of strange hidden geometry that I was able to remove.  That is one time for thousands of conversions.  The enhanced conversion combines triangles to reduce the number of faces.  Concave polygons behave erratically.  This is a limitation of OpenGL.  The conversion program first creates an XML file via a plugin and then runs an executable written in C# to convert the XML file to CSV format.  It is sophisticated enough to minimize the number of polygons and use a material naming convention to light up faces which is useful for signals.

Tottenville USA!!!

Hi everyone.  The status of this project is that I completed the track from Tottenville to Richmond Valley Road.  This includes curves and pitch, but no signals.  The Main Street - Tottenville station houses and mezzanine is complete with signage.  Miscellaneous markers for train lengths and other station artifacts (subway maps, station seats, garbage pails, stairs from tracks to platform, etc.) will soon be added.  Details on both sides of the tracks go out about 500 feet on each side complete with streets and pavement.  This detail will make building a reverse direction easier.

Here are a few more images:

1. Exit at end of platform to Bentley Street, Tottenville Beach, and the Perth Amboy Ferry.

2. Entrance on Ellis Street to mezzanine.

3. Exit at start of platform to Main Street and Ellis Street.

4. Bentley Street station house.

Hi, here are some more images.  These will be my last images until I finish a one station route video showing an R1 running from Tottenville to Arthur Kill Road. I will be on vacation for a while, plus I will be working on my O-Gauge hobby also.  I have expanded my Sketchup to CSV conversion program to eliminate the triangulation of faces in most cases.  This program removes common edges for a face but the rendering fails for concave polygons which is correct by design given the limitations of OpenGL.  It is easy however to add line segments to make convex polygons in those cases.

Anyway here are the images:

Look at the route sign for the T train.  It goes to "Downtown" Staten Island (the St. George area) via Staten Island's South Shore, then uses the Red Hook Tunnel to get to Manhattan.  The bullet is colored turquoise.

Here are several lighted yard signals.

And here are the new lighted interlocking signals for the switches in the view.

Ok, here is an update.  I had to update the configuration of the switches and yard leads given the curve extends some 125 meters past the point where the curve originally ended.  Also I have reduced the polygon count for the signals by 80 percent.  This was an FPS killer.

This is my first rendition of the station frame.  I will be modifying the beams slightly for better definition, add the station name, subway maps, and other signs.  There will be an exit to the fictitious Perth Amboy ferry.  The Jersey Coast line is less than a mile from the Tottenville station.

Aerial View Showing Tottenville Beach and approach to yard and station.  For scenery I am using Structure.Ground to define a scene every 25 meters.  Images for Ground need not be just ground.  It is possible to place objects above the y-axis, so trees, buildings, and other landscaping can be place there.  Can experienced users validate this technique for me?  I viewed the OpenBVE source code and there seems to be no limitations for the number of objects for Ground, Dike, etc.  Memory is your limiting factor.

Here is Tottenville Beach with the station visible behind the trees.  This may be overkill, but I enjoy that detail.

On the platform viewing southbound with the Arthur Kill visible behind the trees.  The Tottenville station is 6 feet above sea level.


I have known of OpenBVE for some time and did some minimal work to get familiar with the product.  About 2 years ago I detailed a comprehensive fictional subway plan for Staten Island.  The details are here  One of the lines takes the existing 2nd Avenue plan and extends it to Staten Island via Governers Island and the Red Hook Tunnel to St. George, Staten Island using Brooklyn as an anchor.  The existing SIR route would be modified to handle subways with signals, new structures and expanding the right of way.

I would like to build my objects as detailed as possible, so I wrote a program to create vertices and faces using primitive objects (rectangle, circles, polygons, etc.).  Although I had success it was equivalent to blindly building objects.  I needed something visual.  Enter Sketchup.  I have become quite experienced in using this product over the last year and wanted to find a way to export from .skp files to .csv files recognizable by OpenBVE.  My success was limited until I found a plugin that extracted meshes, faces, and vertices.  This plugin generated an XML file and had a trial version conversion program that converted the XML format to B3D format.  Sadly there is no longer any support for this so I wrote my own conversion program to generate .csv object files.  The results were fantastic, but there are downsides where the triangulation of the polygons generate quite a lot of faces as well as some problems with reverse faces that can be corrected building the Sketchup model.

I have somewhat coded up the Tottenville yard, rendering it size-wise as closely as possible aided by Google Maps satellite view.  I have built custom signals and am investigating how to integrate them with the Signal namespace if at all possible.  For signal identifiers I will use the chaining for the current 2nd Avenue line.  One problem is that the distance markers go negative based on the current use of the IND zero point where a current signal at 72nd Street is marked as 1168.  So when the identifier goes negative, I will precede the number with an "M" for minus.

Other issues concern FPS which is not to high, barely cracking 20 with a CPU running full throttle and my laptop fan running at full steam.  I am using a nearly 5 year old Sony VAIO 2.2 GHz Quad Core i7 running under 64-bit Windows 7 Home Premium with 8GB of RAM.  My graphics card is the NVIDIA GeForce GT 540M with 4GB of memory.  Not sure if this is a problem.

Anyway here are some screen captures.

1. Regional Plan using Scribble Maps

2. Forward View showing signals, bumpers, and crossovers.

Pages: 1 [2]