RailSetter

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

RailSetter

Post by Egg on Sun Jul 22, 2012 3:00 pm

After many months of exhausting revision of school geometry and trigonometry, and much scratching of head, I've produced a program which will (just about) help with making a csv of rails from a map or aerial view of a railway.
Here's what it is intended to do:-

* Load an image of a map, aerial view, Google earth view, or sketch map.
* Accept mouse clicks along the line to mark the beginning of each straight or curved section.
* Draw a circle, the radius of which can be adjusted to match the rail radius.
* Recognize that the number of exit points from a curve is limited, due to the fixed block length.
* Save the resulting track in csv format, ready for the real work to begin.

It will also (attempt to):-
* Place a marker on the map, which will appear in the csv as a free object location, i.e trackposition and X offset.

Here's what it won't do:-
* Make a fully driveable route with all the work done and all scenery in place.

Here's what it might do in the future:-
* Produce a route which can be explored with 'RouteViewer', though with very limited scenery: just rails and a ground really.
* Currently, the curve radius is infinitely adjustable, and it would be more practical to restrict this to user-set steps.

This is still WIP, and still has a few bugs, but at this stage I think I need some feedback from the community. RailSetter would be of little or no use to those developing fictional lines, but should surely help anyone working on a real line, particularly a very twisty one (mountain railway).
This is not for novices: if an experienced developer would like to try it, pm me, and I'll send the python.pyc file. You'll need to have Python 2.7 installed to run it. RailSetter has been developed in Linux (Mageia2): I have tested the pyc file on a Windows XP box succesfully, but know nothing of Mac.

If there's any interest, I'll post an image of RailSetter at work, and a sample of the output.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by Dexter on Sun Jul 22, 2012 5:28 pm

This sounds very interesting and sophisticated...
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 32
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: RailSetter

Post by lonelyinardwick on Sun Jul 22, 2012 5:39 pm

Does much of my attention, I'm up for it.

lonelyinardwick

Posts : 375
Join date : 2011-07-24

https://about.me/lonelyinardwick

Back to top Go down

Re: RailSetter

Post by Egg on Mon Jul 23, 2012 1:30 pm

Attached is a (reduced scale) image of RailSetter in use. The rail (blue) is being placed from right to left. The yellow spines are the possible exit points from the next curve to be placed. The radius of the curve is changed using the up/down arrow keys, while the left/right arrow keys select a left or right curve.
The small green circular marks represent positions marked for freeobjects: in this example, a hilltop feature and a watercourse.
The output from the attached is as follows:-
===================
836.0.freeobj 0; 0;0
110.0.freeobj 0; 0;-210
Options.BlockLength, 22
0, .Curve(0)
132, .Curve(100)
286, .Curve(0)
330, .Curve(-100)
550, .Curve(0)
594, .Curve(150)
792, .Curve(-175)
1012, .Curve(0)
1100, .Curve(175)
1144, .Curve(0)
1210, .Curve(100)
1452, .Curve(0)
1496
====================
Attachments
flowerdale1.jpg You don't have permission to download attachments.(82 Kb) Downloaded 71 times

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by Drag0nflamez on Mon Jul 23, 2012 2:34 pm

Looks promising.. can't wait to try it out...

Drag0nflamez

Posts : 203
Join date : 2012-05-11
Location : The Netherlands

Back to top Go down

Re: RailSetter

Post by Egg on Mon Jul 23, 2012 2:47 pm

As I said earlier: if an experienced developer would like to try it, pm me, and I'll send the python.pyc file. You'll need to have Python 2.7 installed to run it.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by BruceS on Tue Jul 24, 2012 8:38 am

Amazing stuff! Will make real life route creating (in terms of track) much easier I assume!

Very very very interesting and I am very very very very interested.

BruceS

Posts : 77
Join date : 2011-08-31
Location : Somwhere in the Worth Valley

Back to top Go down

Re: RailSetter

Post by Rogerc on Tue Jul 24, 2012 5:54 pm

Just what I have been looking for!
avatar
Rogerc

Posts : 4
Join date : 2012-06-12
Location : San Juan, Puerto Rico

Back to top Go down

Test

Post by gyzma on Fri Jul 27, 2012 8:59 pm

Hi,

I am testing this program on Win 7 and here is my observations:

- Program have problem with picture containing transparency. It was my mistake but it is good to know;)
- When I open a new image, it remains to see the previous drawing. Can not continue. It is necessary to run the program again. (see ZIP file)
- After starting the program can not write the scale and length of blocks. You have to click the command prompt window and then it goes.

So thats my reports. I think it is a very useful program that will do real lines. It would be good to have the function opacity, because over the yellow lines is not easy to see map. Alan, thank you very much for sending the program to test it. For me it is very useful and I believe that for other developers will too. ;-)
Attachments
problems.zip You don't have permission to download attachments.(195 Kb) Downloaded 6 times

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by Egg on Sat Jul 28, 2012 2:48 pm

Thanks for the report, gyzma. During testing, I usually need to re-run the program quite a few times, and admit that I haven't fully tested loading an image as you have done. I'll look into it.
The problem you had changing scale and blocklength will be related to the above. For now. I suggest you simply stop and restart the program before loading a new image.

I don't get your point about opacity. I plan to make the rail colour and spine colour user selectable- would that help? The default colours at present show up reasonably well on the green pasture of my test image, but probably wouldn't show well over a lighter background.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by gyzma on Sat Jul 28, 2012 5:12 pm

I think it helps. Colors are OK. Really good program. I use it mainly for the detection curve radius;)

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by gyzma on Sat Aug 11, 2012 5:31 pm

Sorry for the late response. I tried the latest version, and here are my reports:

loading an image - OK
stipple spokes and disappear spokes by ALT key is very useful

I use the program for a long time, I test it and compare real curve radius and radius measured with Railsetter. Small radius are ok but larger than 400 m is working with the program really difficult. The deviation of curve r=800 is about up to 100 m. The problem is bigger piece of the map, it is not possible to move the loaded image. Who has a small screen resolution, is in trouble. So I was thinking about other possibilities how the program could work. For me and other developers is not certainly important to have the program export to *. csv. Anyone can measure the distance such as in Google Earth

My idea is: Mark the beginning of curve (A), then mark the end of curve (B). The program automatically finds the center of the line AB (S). Then catch the point with the mouse, drag and drop on the curve. The program write size of curve radius. I think it is possible. (my_idea.jpg)

--------------------------------------------------
Picture - Circular_segment.png

formula: s = 2√( h( 2r-h ) )


Example: s = 42 m; h = 7 m; r = ?

s = 2√( h( 2r-h ) )
42 = 2√ (7( 2r-7 ) )
21 = √( 7( 2r-7 ) )
441 = 14 r - 49
490 / 14 = r
r = 35 m


There is something like this from Simon Gathercole - circumradius.xls. It's accurate, but uncomfortable. I'm not a programmer and do not know how much this would be difficult. If it were possible I would prefer this method of determining the curve radius.

Allan, thank you very much for your patience Wink

Cheers Gyzma
Attachments
my_idea.jpg You don't have permission to download attachments.(93 Kb) Downloaded 11 times
Circular_segment.png You don't have permission to download attachments.(16 Kb) Downloaded 4 times
circumradius.xls You don't have permission to download attachments.(20 Kb) Downloaded 1 times

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by Egg on Sun Aug 12, 2012 4:40 am

Thanks for the feedback, gyzma.
Taking your three points in turn:-

1. Are you saying that the curve radius is measured incorrectly, e.g. a real radius of 800m is measured as 700m (or 900m)? If so, how are you measuring the real radius? I have to admit that I have done very little testing on that.

2. While scrolling the image on the screen is possible, in practice that would mean that very large images would be needed, which wouldn't be easy to produce by camera, scanner, or Google Earth. This would remain a problem even with the largest of screens. My approach is to use multiple images, each image showing the continuation of the line from one section to the next. I'm working on that at present..

3. The approach you show for measuring curve radius was discussed three years ago on a now defunct forum (BVE Terminus?). It's fine for measuring curve radius, and I looked into using it I found it quite tricky to use on sections where the radius changed often, and very difficult on short curves). However, it only measures curve radius, which leaves the serious problem (caused by the fixed blocklength) that there are only a limited number of exit points from a curve. Why is this important? Because choosing the wrong combination of curve radius and exit points for a number of curves can mean that the track is well away from where it should be. Though that error won't make any difference on a line with large curve radii and long straights, on a twisting mountain railway the views could be well out- whole mountains could be lost!

I get the impression that for the line you are modelling, you don't need RailSetter, just a simple radius measuring tool. It would not be too difficult to implement the system you describe in a graphical way, but it isn't something I want to take on at present.

Alan

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by gyzma on Fri Aug 17, 2012 8:54 pm

Hi,

First,sorry for my English. It is very difficult for me to talk about technical matters. I do not think anything bad. Wink For simplicity, I will answer the three points.

1. RailSettler measured radii well, but there is a problem with the length of blocks. There is no box for block length in new version. It is difficult to take the first point and then after 25 meters hit the start of curve. I have 8 km railway track real plans so I know that the radius is 960 m. I give the show two measurements: 879.jpg 964.jpg. As can be seen easily arises deviation almost 100 m. Also, the yellow lines are thick enough radius of 960 m at 25 m block length. If 10 or 5 m block length I can see only one of the yellow area;)

2. OK, use of multiple images is not a problem for me.

3. It's possible, I did not follow what is happening on the forum. "... Because choosing the wrong combination of curve radius and exit points for a number of curves can mean that the track is well away from where it should be..." Yes, I know what you mean.

***
I think I need both;) No, seriously, I think RailSetter is a very good program and thank you for the opportunity to try it. I'm sure I'll use it.

gyzma
Attachments
879.jpg Radius 879 mYou don't have permission to download attachments.(270 Kb) Downloaded 14 times
964.jpg Known radius 960 mYou don't have permission to download attachments.(268 Kb) Downloaded 11 times

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by Egg on Sat Aug 18, 2012 2:33 pm

Yes, I see that the entry box for blocklength is now missing- probably a casualty of the changes I am making. I'll re-instate it and send out a new version. Thanks for pointing it out.
I can't see an error of 100m. Can you send me your test image so that I can see for myself?

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by Egg on Sat Aug 18, 2012 2:50 pm

Found the missing blocklength box- looks like it was due to a bit of careless copying and pasting. I'll check it out tomorrow, and send out the corrected file.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by gyzma on Sun Aug 19, 2012 11:52 am

Ok, don't hurry. Thank you. Wink

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by alvinhochun on Mon Aug 20, 2012 3:07 am

My idea: openBVE is C# and .NET 4.0, so any related tools are better built for .NET 4.0 and compatible to mono, so that no extra dependencies are needed.
avatar
alvinhochun

Posts : 88
Join date : 2012-05-08
Location : Hong Kong

Back to top Go down

Re: RailSetter

Post by Egg on Mon Aug 20, 2012 4:17 am

Yes, I can see the logic of that, but I chose Python because I was already using Python for other projects, and my experience of C# and .NET is zero. In practice, Python isn't a problem anyway: only python 2.7 is required; no other libraries.
If RailSetter proves to be of use, I'll put it out as open source, then you can re-write it for C#/.NET if you wish.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by gyzma on Wed Aug 22, 2012 10:39 am

Hi

I tested the new version and I think that the length of the block has no effect...or am I wrong?

The program is accurate, but it should be done with it for a long time;) I have one question. It would be possible to move individual points by clicking mouse and adjust radius if I make a mistake? I know it is possible to use the BACKSPACE key, but... Wink

Thanks Gyzma

PS: My programming skills are absolutely zero. So I'm glad someone did this useful tool. Wink

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by Egg on Wed Aug 22, 2012 11:37 am

possible to move individual points by clicking mouse and adjust radius if I make a mistake
It's probably possible, but not easy. Because the rails are laid down one after another, moving a rail changes the position of all rails which follow. I was reluctant to use the backspace method of editing, but consider that it's easy to spot a mistake as soon as you have made it, and easy to simply delete it and do it again. Even if you had to delete two or three blocklengths, it's only going to take a minute or less to re-do them.

You're right about the blocklength. I admit I haven't been giving it much attention, as nearly everyone uses the default 25m, but I'll sort it out.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by gyzma on Thu Aug 23, 2012 4:52 pm

Hi Alan

You're right, it is not easy;) I tried the new version that you sent me and block length works. I must say that with the block length of 15 m reaching a much more accurate results. So I'm happy;) When I use block length of 5 m rapidly increasing hardware requirements. (yellow lines)

Thank you

gyzma

gyzma

Posts : 12
Join date : 2011-07-08

Back to top Go down

Re: RailSetter

Post by Egg on Thu Aug 23, 2012 5:15 pm

The way I see it is that the only reason to use a short blocklength is to increase the number of exit points on very tight curves: perhaps an experienced developer could comment on that. Yet you are not mapping tight curves.
If you are seeing too many exit angles (yellow lines) then maybe your chosen blocklength is too short.

Egg

Posts : 81
Join date : 2011-07-25
Location : Tasmania

Back to top Go down

Re: RailSetter

Post by Dexter on Fri Aug 24, 2012 4:16 pm

True, the tighter the curve, the more blocks to make it look better and less sharp.
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 32
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: RailSetter

Post by Rogerc on Sun Aug 26, 2012 7:34 am

I have been testing with Win 7 64-bit; very useful so far. Some comments:

- Agree with need to change colors; current colors are fine on G-Earth, but get lost on topo maps.
- I am running on 1920x1080 display and would love to extend the .gif on to another screen. Is this possible? Is there a size limit?
- I noted an option to load an .rsr file, which appears to do nothing at this point. This would be a great feature, if I could save the .rsr, tweak it a little, and then reload it and continue working on the route.
- The checkbox to create a point of interest instead gave me a measurement between two points.

So far so good, I will try it on Linux next.
Thanks for a great tool.

Roger

avatar
Rogerc

Posts : 4
Join date : 2012-06-12
Location : San Juan, Puerto Rico

Back to top Go down

Re: RailSetter

Post by Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum