Garden RGS Construction – Part 1

I have been working for a couple of years to get a long-neglected part of my yard in shape to build a new garden railroad. About three years ago, I began to use herbicide to eradicate the massive amount of ivy that had taken over a couple thousand square feet of the yard. This is what I had about 1 year ago: most of the ivy was sickly or gone, with a mess like this still in part of the yard.

July 2017

August 2017

After more than a year of cutting brush and filling the weekly trash can with debris, I have a clear enough space to lay out a grid and mark where tracks and walls will go.

Laying out the Railway

I placed stakes on 20-foot intervals corresponding to my plan. Marking paint connects the main grid markers. Then I staked out the limits of track, especially the limits of curves, and placed rocks along the proposed retaining walls so we (my wife) could visualize what the final product will be. (“It’s going to be THAT BIG?”)

Laying out the Railway – Revised

Taking her helpful advice about the size of my planned pike I moved everything back five feet. I lost 30 feet of mainline but gained a happier wife. You can see that over the weekend I started some excavation with a shovel. (This is my exercise program!)

Helper District

This section of the rail road will probably require helper service.

Matterhorn Table

Ha ha. Actually I’m going to build a “table” section so I don’t have to put in a retaining wall, buy and move tons of soil and bury the base of my trees. I’ll build the Lizard Head return loop, the Matterhorn table section and add a temporary return loop – hopefully before the rains come this year.

Looking up the Grade

Like the real Rio Grande Southern, the mainline works hard to climb from Ridgway (about where the camera is), the lowest point on the pike, to Lizard Head (way up that orange line about 60 feet up the hill). The climb is about 8 feet vertically, so there is a nearly constant 2.5 to 3.0 percent grade all the way along the 380 foot mainline.

RGS Plan

Here is my planned version of my chunk of the Rio Grande Southern. I’m modelling the line from Vance Junction to Lizard Head. The towns of Ridgway and Rico are represented by storage or staging tracks.


Yakso Falls is a 3/4 mile hike from Little River Road Road ( NE-27 ).  Park at Lake in the Woods camp ground, and cross back over the NE-27 to fine the trail head.

“The Yakso Falls Trail passes through an old-growth forest which has been selective logged and has many wildflowers during the early spring. Rhododendrons are plentiful and the waterfall is approximately 70 feet high.” –  The fall colors are nice, too.

The sun was still behind the mountains, and I learned something about filters…


Cut Optimization

This past weekend, I was thinking about cut optimization. This is a method for planning cuts to produce the most pieces of given sizes out of a quantity of material of some length with minimum waste. This was brought about by the planning process involved in building a new garden railway trestle. (I’ll cover the specifics of that in another post – I still have to finish my earlier series on the Curved Trestle with a final part covering stringers and installation.)

As a programmer, of course I always think of writing a program to solve that problem. It turns out, that particular problem is considered NP-Hard, which is a computer scientist way of saying you can’t practically solve that exactly in all cases. With this problem, though, I assumed I could generate a good-enough solution. It turns out, that I could.

First, definitions:

  • The raw material that you have is the “stock.” You have some quantity of stock at given length.
  • The pieces that you need to cut from that are a collection of “pieces,” each with a length and quantity needed.
  • The remaining stock after all the cuts is the “waste.”

Because this is a physical world, and I’m working with wood, I considered the saw blade kerf in the calculation. (The kerf is the width of the cut that the blade produces.)

The first algorithm I tried is the “greedy” method, which finds the longest piece(s) that fit the stock, in turn, until none fit the remaining stock. The last bit after that is “waste”, as there are no pieces that are that size or less.

The second method I tried is what I call “best fit.” This picks the longest piece as the starting point, then finds the one or more pieces that best use up the remaining stock. I used recursion to test all the remaining piece combinations to find the best.

See Cut Optimize for my example program. This uses browser local storage so you can create a project, save it, and refer back to it later. It also uses a table with “editable” content, so there are no input boxes there, just click in the cell and edit the value. Really slick! (I didn’t write the table code.) On first use (or if no jobs are defined) a sample project may be created that has two “jobs”: one for the 90 degree cuts and one for the angled cuts.

What I found was that the greedy algorithm tended to get better results much of the time as a percentage of waste, but most of the waste was in pieces that were too short to have any value for another use (1-2″ long, for instance). The best fit algorithm, though it tends to lose out on a percentage of waste score, does a really good job of using almost all of the stock while there are still short pieces left, and produces more usable waste later in the cut list (3-5″ waste, for instance).

In the examples, both algorithms produced a lot of waste because of the large number of about 9.5″ lengths paired with the 24″ stock length. I’ll likely just get some 20″ or 30″ stock to make most of those pieces, then the waste will be dramatically reduced.

Update: 10/16/2017

I changed a few things:

  • Added a minimum Usable Length setting. Remaining pieces greater than or equal to this value are not considered waste.
  • Expanded the Stock inventory to five lengths and quantities.
  • Changed the buttons to “glyphicons” for a more compact presentation.

Also, fixed a few random bugs in the page.

Total Solar Eclipse 2017

Our eclipse photos were taken with a Pentax K-50 using a 200 mm lens.

Right after start of occlusion.

Totality. If you click on the image, I believe that Mars and Mercury are visible (about 3 o’clock and 8 o’clock, respectively).

“Diamond Ring.”

Near end of eclipse.