Page 1 of 2

Scale Length Conversions

Posted: Tue Nov 10, 2020 1:55 pm
by John Donnelly
In my professional life, I've been a software developer for over 20 years working on developing applications for Windows. As the future is 'cloud' I figured it was about time I learnt how to develop web based applications and figured, if I was going to learn, I may as well produce something useful so I've developed a scale length calculator for railway modellers which can be accessed here:

www.leyburnsolutions.com/scale.php

At the moment, it has the following functionality:

1. Convert actual lengths in to their scale equivalent. So, for example, you can select to enter length of 12 feet, select output in mm and you will get the scale length equivalents in mm.

2. Convert a scale length in to it's actual equivalent. As above but the opposite way round, enter, for example, a mm value, select the scale, select the output measurement and you'll get the actual length.

3. Convert a scale length to it's equivalent in another scale. Enter, for example, a length of 10mm in 4mm scale and you'll get the equivalent in other scales.

4. Convert a curve radius (in chains) to it's scale equivalent. Enter an actual radius, select the measurement you want and get the relevant scale radius.

The program currently supports 2mm, 3mm, 3.5mm, 4mm and 7mm scales.

I appreciate most of us on here can probably do this manually in their sleep but it has been a worthwhile learning exercise for me.

John

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 4:22 pm
by Guy Rixon
Thanks John, that's nice and neat and saves some mental arithmetic. It's traditional at this stage of the software life-cycle to respond with suggestions for extra features, so if I may?

1. It would be nice to distinguish 2FS (1:152.3) from British N, and possibly to add European/American N. Working out what wheelbase a Kato chassis gives in British N or 2FS is a traditional sport.

2. The use-case I find a lot, and where I'm more likely to press the wrong buttons on the calculator, is deriving mm at 4mm scale from a printed drawing that is not at 4mm scale. I.e. "known length x is printed at y mm in the book, so if I measure an unknown length at z mm in the book what should that be in 4mm scale?" Yes, "don't scale from drawing mutter mutter", but often there's no alternative.

Feel free to ignore these if you don't feel like more coding.

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 4:26 pm
by John Donnelly
Thanks Guy, the suggestions are most welcome. The scale one is easy enough and I'll take a look at the second.

John

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 5:56 pm
by Noel
Since I sometimes write software myself [not much and not often], I know some of the problems which can arise. I played with the curve radius calculator a bit and found that putting in negative numbers got a negative answer [not unreasonable, but...] I also saw that the 4mm answer was not twice the 2mm answer. I know why, and the reason is clearly visible if you look at the ratios, but it looks potentially to be a bit ambiguous to me. Incidentally, why not just let users input the scale that they are working to? Similar comments arise with the length conversions, and I note you can have feet, or inches, but not feet and inches unless you convert to decimal feet or multiply out to give inches, and vice versa, while converting from feet to metres produces an awful lot of digits after the decimal point.

I hope that this is helpful; it is meant that way, honest...

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 6:47 pm
by John Donnelly
Thanks Noel,

I hadn't considered anyone would enter a negative number but that's what testing is for so thanks for that.

My thinking with the current entry was that, if this was available to the 'masses' I wonder how many would know what the actual scale of N gauge, for example, was...

I guess, ideally, the user should be able to enter a scale as now or enter the scale ratio.

I had considered being able to enter feet and inches and figured that users should be able to multiply by 12 but I may reconsider.

Thanks again.

John

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 7:03 pm
by grovenor-2685
Noel wrote:I also saw that the 4mm answer was not twice the 2mm answer. I know why, and the reason is clearly visible if you look at the ratios, but it looks potentially to be a bit ambiguous to me.

This is a problem started by Peco!, 2mm scale should not be 1:148 but 1:152.4.
1:148 was created by Peco (IIRC) for "British N" while N elsewhere is 1:160. And I believe the Japanese use 1:160 for modelling standard gauge and 1:150 for modelling 1067 mm gauge when it should really be 1:119 :)

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 7:17 pm
by John Donnelly
An update: 2mmFS is now an option and entering a negative will produce an error.

John

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 8:05 pm
by Philip Hall
John,

Thank you for producing what will surely become a useful tool for us. For years I have used the MRJ conversion tables for 4mm and 7mm when I need to establish drill sizes and dimensions but now being able to swap things around at the click of a mouse is great.

Philip

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 8:36 pm
by Paul Willis
Nice one John!

Being a real PITA (a genuine ETLA), could I ask for the <home> button to be at the top of the page, and not the bottom?

Saves an awful lot of mousing...

Cheers
Paul

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 10:31 pm
by John Donnelly
Thanks Philip and Paul, much appreciated, working on a change to the Home button now...

John

Re: Scale Length Conversions

Posted: Tue Nov 10, 2020 11:42 pm
by John Donnelly
New version is up with improved navigation meaning you can get from one page to another without having to go back to the Home page.

John

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 9:01 am
by Alan Turner
Also continental TT is 1:120

regards

Alan

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 9:54 am
by John Donnelly
Thanks Alan.

This morning's update adds support for US/EU N at 1:160 and clarifies the current TT selection is British, I'll look to add Continental TT.

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 10:54 am
by andrewnummelin
May I make a few suggestions that may cause some coding "fun"?
The two projects I've been working on of late have involved the use of old general arrangement drawings that are dimensioned in good old fashioned units so I ended up with a spreadsheet to take things in feet, inches and fractions of an inch to speed the calculations to mm.

With the small items it was then a case of looking for the nearest appropriate size material (typically sheet or wire) so I added columns to give the output also in thou, as materials are often so dimensioned.

Then a next step might be to add look-up tables to convert to things like SWG, number drill size, screw size, ...

Then the real fun can start by thinking of our friends who still use imperial measures in their modelling work, and indicate the calculated model sizes in fractions (of an inch).

There's a lot to be said for going back the use of slide rules!

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 12:06 pm
by Neil Smith
Well done with putting this together John, I can see myself using it a lot!

In which case, one other (very easy) calculation that might be worth adding in a simple converter between thou <=> mm.

My thinking here is that whilst your site can not only do real <=> scale, but also take something in on set of units and spew out an answer in a different set of units, sometimes what we know is that something is a scale x thou, but could do with that in mm, or vice versa. Yes it's easy enough to run a Google search (other searches available, etc!) but adding in another button would bring this all under one roof?

But well done on a useful little tool!

All the best

Neil

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 12:44 pm
by Noel
John Donnelly wrote:I had considered being able to enter feet and inches and figured that users should be able to multiply by 12 but I may reconsider.


It's not just input, the conversion should work both ways to be truly useful, so output is also relevant. If the output is, say, something like 38.84 inches or 0.766 inches, converting to non-decimal format is likely not to be straightforward. Like Andrew I'd probably use a spreadsheet, but that would miss the point of your calculator...

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 1:02 pm
by John Donnelly
Currently working on the ability to handle fraction of inches properly (i.e 1/2 rather than 0.5), it is proving interesting...

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 1:36 pm
by Noel
:D

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 1:54 pm
by Neil Smith
And just one other request, any chance of one of those little icons that appear to the left of the URL in the browser window and alongside the name of the website title on quick access bars in browsers like Chrome... I usually delete the text altogether on my quick access bar, so if there was an icon of say a little ruler, that would be helpful. Sorry I cannot remember what they are called...

Or, it may just be me that sees this as a benefit, in which case please ignore!

Neil

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 2:00 pm
by John Donnelly
I'll have a look, I believe they are called favicons...

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 3:04 pm
by Neil Smith
That's the word, thanks John!

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 3:30 pm
by John Donnelly
Favicion now added 8-)

As a go at handling fractions of an inch, I've started with a simple imperial to metric converter so you enter a length in feet, inches and fractions of an inch and get it converted to millimetres or meters...

http://leyburnsolutions.com/scaleconver ... metric.php

Feedback and criticisms welcome, I've been doing this for a long time and I'm used to 'picky' clients :mrgreen:

John

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 5:27 pm
by garethashenden
This text is red seems to be stuck at a certain position down the page. On the home page its at the bottom, but after the calculations when there is more information to display its higher up.

Image

Re: Scale Length Conversions

Posted: Wed Nov 11, 2020 5:47 pm
by John Donnelly
Thanks Gareth, it is supposed to be anchored to the bottom right of the page but clearly not...

Re: Scale Length Conversions

Posted: Thu Nov 12, 2020 8:38 am
by andrewnummelin
John Donnelly wrote:Favicion now added 8-)

As a go at handling fractions of an inch, I've started with a simple imperial to metric converter so you enter a length in feet, inches and fractions of an inch and get it converted to millimetres or meters...

http://leyburnsolutions.com/scaleconver ... metric.php

Feedback and criticisms welcome, I've been doing this for a long time and I'm used to 'picky' clients :mrgreen:

John

Very nice way of dealing with fractions.