Jump to content

All possible distances that can be achieved with different combinations of track sizes


Kkxzd

Recommended Posts

I've been looking around this info and couldn't find any, so I assumed it doesn't exist. I've done a simple script to calculate this for Kato (although any other can be done easily). Sharing in case anyone else finds this handy. It's been a very good reference to get my design to snap better. It's interesting that almost any distance can be achieved with the right combination of tracks, usually with steps of no more than 4-5mm for any given distance.

 

The attached file shows distances and what combination of tracks are needed to achieve said distance. The first solution would be the one with less number of tracks. If the number of tracks are the same for two particular solutions, there is no particular order, although I would like to hear what you think might be best in that scenario.

 

 

kato-distance-calculator.txt

Edited by Kkxzd
Link to comment
Guest keio6000

interesting.  at some point you stopped being thorough though - For example, 1364 + 29 = 1393 - not on your list.  i undedrstand this is because you capped the number of pieces per line.  For example, 203 does not exist though it is achievable 29 * 7.  this is easily fixable in your script and probably should be to generate a better list to provide an accurate dictionary of achievable distances,   The maximum number of digits it should consider is FLOOR(MAX_LENGTH_CALCULATED / 29), though a well-made script shouldn't particularly need this. 

Edited by keio6000
Link to comment

Keio6000 you're absolutely right, while I didn't clarify it before, I've run the algorithm up to 6 pieces, and that's the reason both examples you gave are not in the list. I could definitely provide a more complete list if people find it useful, although I may have to tune the algorithm so that it doesn't take forever to calculate.

 

Also, for 1364 + 29, being 1364 = [124, 248, 248, 248, 248, 248], in my design process if I find I'm looking at extending a bit beyond 1364, let's say I need 1401, I'd take away the last 248, so I need something to get from 1116 to 1401, so a distance of 285, and this can be easily be found in the list: [29, 64, 64, 64, 64]

It's probably not the optimal solution thou.

 

I wonder what are the disadvantages between running exact lengths but in multiple small parts vs just bending the tracks a bit on much fewer track pieces for your layout. ie does it make sense to use 7 segments to get to 203 (29 * 7) if I can do 202.5 with 4 ([29, 45.5, 64, 64])?

Edited by Kkxzd
Link to comment

This is another version with up to 10 different segments. It becomes a bit overwhelming and it's hard to imagine you would need so many different options. It's interesting that the difference between possible values becomes 2mm or less for values over 200 or so.

 

BTW, this includes each possible combination for values <=290 (10 * 29)

kato-distance-calculator-v2.txt

Edited by Kkxzd
Link to comment

The algorithm could be simple brute force loops for generating all possible cases (including 0 for combos less than N pieces) then sorting by length and number of pieces (if the first two values are these).

 

A slightly more interesting code would be to use backtracking search to find the two bounding (smaller and larger or exactly matching) combinations for a given length.

 

Ps: The cheatability of lengths depends on cumulative global effects (like module boundaries) and local effects (like parallel tracks between two turnout districts). Sometimes it's ok, other times it won't work.

Link to comment

katoftw, fully agree, that's why using the first version is probably the best, usually try to replace a couple of sections with another couple that fit better or maybe replace with 3 sections, but wouldn't go beyond that if possible.

Link to comment

Our club has no less that 6 software developers/engineers in it out of a dozen. On our first layouts Matthew wrote a small route in to calculate the combos to make things come out to a couple of mm after we abandoned sung the extension tracks.

 

Jeff

Link to comment

Our club has no less that 6 software developers/engineers in it out of a dozen. On our first layouts Matthew wrote a small route in to calculate the combos to make things come out to a couple of mm after we abandoned sung the extension tracks.

 

Jeff

 

He wrote a program for that?  Interesting, that's what I was thinking about when I made this post: http://www.jnsforum.com/community/topic/9010-layout-planning-geometric-calculations-for-asymmetric-layouts .  Every time I start messing around with XTrkCad, I want to make something a little more complex than an oval, but I just wind up with something that doesn't connect, so I kind of give up :)... :(

Link to comment

Miyakoji, I've found that having many options in the straight tracks by using the tables I posted, it's much easier to do arbitrary shapes with some trial and error in curved shapes and by measuring how long a straight line you'd need. Sometimes you might use much more small tracks than probably ideal, but that's probably something that you can decide if it's worth it in any situation.

 

These are two examples I was able to do, mostly copies of other layouts I liked. test5 doesn't really snap together but it's probably close enough to snap in real life, I wanted to probe if that shape in the right could be done even without having curved turnouts in kato.

 

 

post-3027-0-71344200-1431325845_thumb.jpg

post-3027-0-14559400-1431325848_thumb.jpg

Edited by Kkxzd
Link to comment

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...