By continuing to use this site, you agree to our use of cookies. Find out more

Member postings for richardandtracy

Here is a list of all the postings richardandtracy has made in our forums. Click on a thread name to jump to the thread.

Thread: Roses of Success!
20/09/2017 16:02:11

Looks pretty impressive.

I notice 'Rainhill' is not on your list. A couple of years ago I started modelling it from a TEE re-print of the magazine articles. Then my workload increased & I had to put it to one side before it was finished & had forgotten it until your article:



Thread: Program to Calculate all Possible Lathe Thread Pitches
19/09/2017 12:35:22

I am really confused by the problems with Thor's pdf file. I sent him one that worked OK on my machine under Acrobat Reader SD (the latest) but it failed to read on his machine using Edge & Firefox (which presumably calls up a reader to embed the pdf in a tab).

I also got the same file to open with PDFCreator, but it failed with PDFsam. I am stumped. Very stumped.

I think I'll leave it be for the moment, and try a few experiments with libharu. I will upload the 'decimal comma hardened' version of the program this evening, which should make it more likely to work with more machines. If I can get the libharu libraries to work for me under C++ Builder 10, I will upgrade the program to use it, but given my likely schedule in the near/medium future, my programming time is likely to be curtailed and developments will be slow.



18/09/2017 16:45:24

Thanks Clive, I have downloaded Libharu and will look into it.



18/09/2017 15:14:40

My own.

I am too much of a cheapskate to pay for anything if I can avoid it. I suppose it is rather like most of the stuff with model engineering - it's more effort, but more satisfying and cheaper to do it yourself. I have never charged for a program, and am never likely to, so paying for bolt-on's is not anything that is going to pay for itself. Software libraries are not high on my list of priorities for purchases. In July last year I found I had been using my 'PCPlus' cover disc of the C++ Builder 4 programming environment for exactly 16 years, and thought it wise to finally upgrade to C++ Builder 10.1, so when the price dropped from £205 to £49, I jumped at the chance. It is now free... teeth

I have made my C++ Builder 10 pdf source code available for download here: **LINK** for anyone who is interested. I have been harbouring the hope some clever person may be able to use it, and maybe improve on it. Not happened so far that I have heard of, but there we go. I will update it if I can trace the source of the problems Thor is experiencing. As it is, it seems to work most of the time. Or it seemed that it did...



18/09/2017 13:26:26

Embedding of fonts was my aim when I started.

After reading the spec & trying to relate that to the information I could get out of Windows with my level of understanding, I fairly rapidly revised the aim.

Maybe, one day...



18/09/2017 12:41:40

There are four fonts that are 'built in' with the PDF spec, Helvetica, Times, Courier and ZapfDingbats. On Apple systems, they exist, I think, by virtue of being loaded with the OS. On Windows there are auto substitutions of Arial, Times New Roman, Courier New and Symbol, which are all loaded by the OS. The four fonts are part of the core PDF definition - and I use them for simplicity, programming in the font embedding is interesting, but getting the information to embed the fonts from Windows is a non-trivial exercise which I'd prefer to avoid.

A font can be embedded in the pdf file in the manner described below.

Each character is stored as an object in the file. It is stored as an array of co-ordinates marking the perimeter of the object, this is done clockwise. Any 'holes' in the filled in character (eg for 'A' etc) are another group of co-ordinates where the perimeter is drawn anti-clockwise. The co-ordinates are all in points from the character origin, which is on the line and permits the correct character spacing from the previous character. The character is defined at 1 point font size. There is another co-ordinate for the 'End of character' point.

Each font is defined as a series of objects and they are mapped onto letters. The font need not be complete, just cover every letter that is used. The font is given an external designation (eg 'Arial' ) , and an internal name (eg 'Font1' )

When text is used in a pdf file you get an uncompressed entry in the 'Page Object Contents Stream' similar to that below (anything after a % character is a comment that the reader ignores):

'BT' %Begin Text
/Font1 10 Tf %Use Font 'Font1' which has already been defined, and scale it up by a factor of 10 to get 10 point.
1 0 0 1 17.008 814.869 Tm %Rotate text using 2x2 text rotation matrix 1 0 0 1 [no rotation] and put the first character's origin at 17.008,814.869 points (1point = 1/72" ) from the bottom left corner of the page.
0.00 0.00 0.00 rg %Colour black, 0.00 red, 0.00 green, 0.00 blue from a range 0.00-1.00
(Pitch (mm)) Tj %draw the text and fill it in. The text to be drawn with Font1 is 'Pitch (mm)'. Outline fonts are possible by changing the 'Tj' to 'TJ' I think (can't remember at the moment).

Then at the end of any group of text there is an


before any line drawing can occur. There must be an 'ET' before the end of each page that has a 'BT'.



Edited to kill rogue emoticons

Edited By richardandtracy on 18/09/2017 12:45:08

Thread: Guy Martin F1 Pit Crew
18/09/2017 11:20:57

Reckon he's the 2017 version of Fred Dibnah; without the steam but with the same enthusiasm for life & all things mechanical.



Thread: Program to Calculate all Possible Lathe Thread Pitches
18/09/2017 11:05:22

I had an idea this morning about the cause, and think it may be related to pdf page location co-ordinates being converted to use decimal commas. I am hoping Thor will respond to a PM so I can check whether this may be the cause of one/all of the problems.

I am not sure that HTML opening is likely to be the problem as the pdf file with the problems opens (if it opens at all) just shows blank pages. However, there is such diversity in setups that I am increasing less sure about anything!



18/09/2017 09:06:21

For some reason I can't yet identify, the pdf output does not always work. I shall work on it, but as I have no idea of what the cause may be, the solution may be difficult to come by. So, in the mean time, can I suggest that you try the pdf output and if it doesn't work, resort to the csv output.



15/09/2017 16:19:10

New version can now be downloaded via the same link.



15/09/2017 10:59:35


There is a function applied to each form (read 'Window' )    in the VCL library, and it's the 'Refresh()' method built into the TForm object, which I call up every 10 pdf pages or so. Amongst other things it sends Windows a WM_PAINT message to trigger a redraw and halts the process to flush the message buffer. But somehow Windows forgets this.

I will admit that I am a 'hobby' programmer, and it has taken me a good few years to get to the limited programming capability I have. Due to the lack of programming finesse I have, I tend to err of the side of brute ignorance & force to get things done. (The programming equivalent of using a sledgehammer for all jobs requiring a hammer.)



Edited to kill a rogue emoticon

Edited By richardandtracy on 15/09/2017 11:00:27

15/09/2017 10:05:26


I don't know why the PDF file won't work on 'edge' - though it's one I've not heard of.

Possibly the file format is too old.

I deliberately went to a pdf format as early as possible for several reasons. I hoped for maximum compatibility (therefore early format) and my mind goes completely to mush when I try to understand how run-length, variable byte length zip compression works in a file. Apparently the byte length supported by the pdf zip compression can be between 9 and 12 bits, and varies as the stream progresses before re-setting to 9 bits when the 12 bit bytes cannot contain the encoded data. Unfortunately the pdf spec I read had been written by someone who didn't seem to understand it well (or understood it too well) and I couldn't get head nor tail of the explanation. All pdf formats after v1.3 use compression in the object data streams, but it's optional in the 1.3 format. Because I don't understand it, I opt out.




Edited By richardandtracy on 15/09/2017 10:07:18

15/09/2017 09:53:49

As a result of Thor's .ini file I discovered that it did not respond well to decimal commas being used in the input. I have changed the program to include a text parse to convert any inputted commas into decimal points.

While looking for the source of Thor's problem, I did notice a silly bug in the pdf output if no initial gearbox was specified where I had misplaced a closing brace so it didn't include a statement it should have done. I have corrected that.

To prevent the apparent problems of data.ini not being present, I've included a really basic one that works in the zip file with 5 tooth numbers in it. If the teeth are not in your list, delete them and add the ones you want.

I will try to get the modified file uploaded this evening.



14/09/2017 19:41:07

That is one problem I have never had. It's amazing how people come across problems that seem baffling and shouldn't happen.

Could you try with outputting to a .CSV file?

The other option I can think of is, have you put in a 'final ratio'? Needs to be 1 if no other value is put in. A final possibility is is a font selected from the three options. It should default to 'Helvetica' but may not.

If that doesn't work, could you post the contents of data.INI, so I can try it myself?




Edited By richardandtracy on 14/09/2017 19:49:19

Thread: How can I keep a deeply drilled hole straight?
14/09/2017 16:45:40

As background reading, Machinery's Reference Series #25, 'Deep Hole Drilling' is a pretty good start, available here: **LINK**

Another thought is 'Can I change the design so it doesn't matter if the drill wanders?'. You will have to ream to get the hole circular, but it may be possible that if the centre at one end is correct, then it may be possible to make it so the valve does not have to be perpendicular to the face from which you drill.



Thread: Something very, very splendifourously exiting is on it's way.
14/09/2017 15:33:35

I must have missed the ending of the last one.


Thread: Decorative effect on steel nut
14/09/2017 12:33:33

Or left in the bottom of a toolbox in a vehicle for years, and has bounced into everything hard in the box.



Thread: Boring / Turning Steel
14/09/2017 09:20:44

Take a look at this thread:




Thread: Program to Calculate all Possible Lathe Thread Pitches
14/09/2017 08:09:02

The program is a self contained 32 bit Windows program that should run on any version of Windows from Win95 onwards and should also run under WINE on Linux. I have tried the program on Win7 (64bit) and WinXP (32 bit), and it definitely works on both operating systems. The zip file includes a readme file, the help file, executable file, and calculation unit source code (so you can check that the code does nothing nasty to your machine if you want to). The program creates a file in its own directory called 'data.ini' to keep the gear wheel sizes and pdf file preferences for next use. If you have any of my CNC programs and put the program in the same directory, they will all share the same 'data.ini' file, keeping the clutter down.

Instructions for how to use the program are given on page 2 of the help file. Please note that the program can take a while to run, and Windows occasionally gets bored, looses focus and the program does not update the progress indicators. Just leave it to run, if there is a problem it will exit cleanly and tell you what happened in the box at the bottom, but if it seems frozen, that's simply a symptom of Windows not knowing how to cope with a calculation intensive task and it behaving like it has the attention span of a goldfish.

I hope you find it useful when you need an odd thread pitch, loose a wheel or simply want to play.



14/09/2017 08:08:43

Some while ago I became suspicious of one of the thread pitches quoted in my Warco WMT300 handbook, the 3mm pitch thread was wrong by close on to 15%, and (embarrassingly) I discovered that 10 years after getting the lathe, it hadn't been delivered with all the wheels it should have been - I didn't check when I got the lathe, just counted the wheels without opening the wrapping plastic - and it did have unexpected duplicates. This meant that I couldn't cut half the metric threads in the lathe manual. After enquiring as to the price of the wheels I needed (after 10 years I couldn't reasonably ask for them to be supplied FOC), and gulping loudly, I decided to write a spreadsheet to check the accuracy of the pitches in the manual and try to work out wheel combinations to make up some of the other threads for nothing instead. The manual threads were fairly consistent in being 1.59% in error, except the 3mm pitch which had a 70 tooth wheel instead of 63, which was the cause of the pitch error. After a good deal of trial and error I found alternatives for most of the metric threads I wanted, but it stuck me that it was more error than success & there must be a better way of doing things.

You may be aware that every screw cutting lathe can actually cut a lot more threads than the manufacturer usually specifies in the handbook, and with pen making I wanted quite a number of non-standard threads. After the hours trying, I had proved trial & error was not a viable method, as it took too long to find the pitch I wanted, so what I really wanted was a method of quickly calculating every possible pitch, searching through the list and selecting the ones I want. So.. how to do it?

Well, I wrote a program that used the brute ignorance & force method to try every possible combination of wheel in the lathe and calculate the pitch for it. The program is pretty simple and does not check if the wheels will actually fit in the available space (it would require too much detail about gear module, distance between shafts etc to be entered, to be worth programming for a program that really only runs once per lathe), but it does check every theoretical combination and allow the user to try them out quickly & easily. There are usually many alternatives giving the same pitch, so if one combination won't fit, another probably will.

It turned out there were quite a few combinations for my lathe - the 755,160 possible combinations led, due to duplication of wheels, to about 230,000 distinct different combinations producing around 30,000 different pitches (I'm guessing, I haven't counted), and I found I was able to get thread pitches from 0.0708 mm to 5.185mm (358 to 4.898tpi). At the 1.5mm pitch range I particularly wanted, there are 356 different combinations to try that all produce exactly 1.5mm pitch to 14 decimal places, and then a further thousand or so giving a perfectly viable error of less than 1%.

So, what has this to do with the ME forum?

Well, I thought other people may be able to use the program. It is certainly applicable to the Warco WMT300/1 & WMT300/2 Combi's and all other badged alternatives of the lathe (Clarke CL430/500M, Chester Model B, Sealey SM27). It is also applicable to every single lathe that uses 4 gear wheels with a drive train similar to that shown schematically in the diagram below:

The program directly applies to the Seig SC2, SC3 and SC4. With a bit of thought it could probably be applied to the SC6. It also applies to the Warco Super Mini, WMT500 Combi and WM150. It may apply to the WM180 with thought.The program does apply directly to the Chester Centurion 3 in 1 & long bed Centurion, Conquest Lathe Super & Superior, DB7, DB8 and DB11. It applies equally to many Grizzly & US badged lathes with the same drive train layout.

The program window looks as below (with all the data for my Warco filled in):

I have added a 2 page help file accessed through the 'Schematic and Help' button, made the data entry a bit easier than when I initially wrote the program, and programmed in two different output formats for the available thread pitches. The program can output to a PDF or CSV file for further manipulation in a spreadsheet. The PDF file can be quite big, so do not be surprised if there are 1000 pages in it, for my lathe and rather odd wheel combinations, I get 2991 A4 pages at 76 combinations per page, and a file size of 125Mb. On opening the pdf file, Adobe Acrobat Reader states that there is an error in the pdf file and 'repairs' the file. It speaks with forked tongue - it doesn't; it just wants to convert it from the uncompressed version 1.3 file format to a more recent and verbose compressed format and thereby slow the opening and responsiveness of the file (I had to know the v1.3 pdf format inside out before I could programme the unit to create a pdf file, and I know it's right - no other PDF reader objects to the files created by the pdf code I wrote).

You can download a zip file of the program here:


Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer!

Find Model Engineers' Workshop!

Email News - Join our newsletter

Love Model Engineering? Sign up to our emails for the latest news and special offers!

Latest Forum Posts
Support Our Partners
Expo Tools July 14
Meridienne Mid Mod Eng Show. Aug 21
TRANSWAVE Converters
Allendale Electronics
Reeves 2000
Eccentric Engineering
Advertise With Us
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

Visit the Model Engineer
Exhibition website

Model Engineer Exhibition