Templot Club forums powered for Martin Wynne by XenForo :

TEMPLOT 3D PLUG TRACK - To get up to speed with this experimental project click here.   To watch an introductory video click here.   See the User Guide at Bexhill West.

     Templot5 - To join this open-source project on GitHub click here.  For news of the latest on-going developments click here.  Templot5 is now included with Templot2 - download.

  • The Plug Track functions are experimental and still being developed. Some of the earlier pages of this topic are now out-of-date.

    For an updated overview of this project see this topic.   For some practical modelling aspects of using Plug Track see Building 3D Track.

    The assumption is that you have your own machines on which to experiment, or helpful friends with machines. Please do not send Templot files to commercial laser cutting or 3D printing firms while this project is still experimental, because the results are unpredictable and possibly wasteful.

    Some pages of this and other topics include contributions from members who are creating and posting their own CAD designs for 3D printing and laser-cutting. Do not confuse them with Templot's own exported CAD files. All files derived from Templot are © Martin Wynne.
  • The Plug Track functions are experimental and still being developed.

    For an updated overview of this project see this topic.   For some practical modelling aspects of using Plug Track see Building 3D Track.

    The assumption is that you have your own machines on which to experiment, or helpful friends with machines. Please do not send Templot files to commercial laser cutting or 3D printing firms while this project is still experimental, because the results are unpredictable and possibly wasteful.

    Some pages of this and other topics include contributions from members who are creating and posting their own CAD designs for 3D printing and laser-cutting. Do not confuse them with Templot's own exported CAD files. All files derived from Templot are © Martin Wynne.

Templot5 - progress discussions

Quick reply >
I suspect we need to consider having an option:-
Background plain track omit labels

That's the trouble with Templotting, it sucks you in and no sooner than you think you've finished, another idea pops into your head!

Steve
@Steve_Cornford

Hi Steve,

Perhaps an option to omit all S1 labels? On the basis that if it hasn't got a label it must be an S1.

This would reduce plain track to just the S1J chairs if there are any, and make the turnouts look a lot less cluttered.

They need to all come back on when the shove timbers is in force, so that they can be selected for chair heaving.

cheers,

Martin.
 
_______________
message ref: 13366
Hi Martin,
Done:-
1726770112213.png


1726770147795.png

Steve
 
_______________
message ref: 13368
Probably need to tart up the comments, but here are the files at present.

Todo is the print_unit.pas

Steve
 

Attachments

  • pdf_laz_unit.pas
    294.8 KB · Views: 22
  • print_settings_unit.lfm
    16.3 KB · Views: 21
  • print_settings_unit.pas
    18.6 KB · Views: 25
_______________
message ref: 13369
@Steve_Cornford @Hayfield

Hi Steve,

That was quick. :)

The blue panel needs a note that it applies to print and PDF output only. Unless that is you have already done the image (and eventually sketchboard) outputs:

export_unit.pas

export_draw_unit.pas


Code:
export_draw(create_bitmap.Canvas,create_image_width_dots,create_image_height_dots,3);

Code:
do_export_metafile(file_str, metafile_width, metafile_height, emf_in_memory)=False

I'm not even sure those are working, I did a lot of work on them for the OT2024 conversion but I can't remember whether I finished it.

The rule of Templot is that there is always one more thing that you haven't done yet. :)

Thanks for the files -- I haven't merged any of your recent work yet, there never seems to be enough time. Currently messing with backlash corrections on the Neptune. I promised 556 before Scaleforum but that won't happen now.

John is doing a great job waving the flag for Templot across all the forums. :)

cheers,

Martin.
 
_______________
message ref: 13371
Hi Martin,
Have added the note re PDF & Print, and revised print_unit.pas

1726782722222.png


I will have a look at export_draw_unit.pas next.

Steve
 

Attachments

  • print_settings_unit.lfm
    16.6 KB · Views: 23
  • print_settings_unit.pas
    19 KB · Views: 21
  • pdf_laz_unit.pas
    295.2 KB · Views: 20
  • print_unit.pas
    344.8 KB · Views: 18
_______________
message ref: 13375
The blue panel needs a note that it applies to print and PDF output only. Unless that is you have already done the image (and eventually sketchboard) outputs:
Hi Martin, Have you now found a way of now incorporating the Sketchboard into T5? Or I am miss reading your comment above
cheers
Phil,
 
_______________
message ref: 13377
Hi Martin,
2 steps forward, 1 backward.....
This is my attempt at adding chair outlines & chair labels, control template radio button clicked:-
1726849283475.png

chair outlines seem ok (famous_last_words, oh dear I seem to have contracted Pascalitis!)
But chair labels separated from their enclosing rectangles & both out of kilter.....
I replaced the text_out call with a do_text_out, inserting canvas_height as the 2nd parameter.
Bit more research & understanding needed.....

As you can see I am using Inkscape to view the .emf file produced.

A zoomed out view:-
1726849721569.png


Maybe I need to replace roundrect with an equivalent swap_roundrect or fiddle around with the roundrect paras, as it loos as though the round rectangles are at rightangles to where they need to be...

Steve

Steve
 
_______________
message ref: 13395
@Steve_Cornford

Hi Steve,

If you post the .pas file I will have a look.

cheers,

Martin.
 
_______________
message ref: 13397
Hi Martin, Have you now found a way of now incorporating the Sketchboard into T5? Or I am miss reading your comment above
cheers
Phil,
@Phil G

Hi Phil,

Not yet I haven't. But it is my firm intention to do so -- even if it means in the end re-writing it from scratch. It uses an EMF file for the trackplan item on the sketchboard, so the work Steve is doing will be needed.

cheers,

Martin.
 
_______________
message ref: 13398
.
Two more buttons.

Well actually they are not new -- I have moved them from obscurity on the custom tab to where they can be found more easily:


backlash.png



Will be in 556a.

cheers,

Martin.
 
_______________
message ref: 13399
Hi Martin,
I might be getting there.....
1726860778380.png

At least roundrectangles and the text is coinciding!
Need to make the round rectangles bigger....

I assume it needs a small negative adjustment on the x1,y1 paras and equal positive adjustment to the x2,y2 parameters of the roundrect call within the new procedure do_label_out

Just concetrating on the "control template" export to EMF file , then will replicate to the "background templates" etc...
The labels need to go up a bit....

I think I have leart something new today anyway....
All enjoyable

I have probably had enough for today, as will be driving up to Scaleforum @ High Wycombe tomorrow to check in on James & John et al.


Here is the current state of play with export_draw_unit.pas and just in case the print_settings files.

Steve
 

Attachments

  • export_draw_unit.pas
    196.5 KB · Views: 21
  • print_settings_unit.lfm
    16.6 KB · Views: 19
  • print_settings_unit.pas
    19 KB · Views: 22
_______________
message ref: 13400
Hi Martin,
A slight improvement. I added one space to front of label text & two spaces on the end, got rid of the rectangle so just the roundrect + text now.
1726908476124.png


Need to figure out the adjustment needed to co-ordinates to get the labels higher, and then that will require a shift to the left a bit.
Just need to get my head around which direction that is, left. right, up, down when a swap is involved!

Then find out where the green T's are coming from...
1726908690601.png

Could they be T for Templot?

Heading off now to Scaleforum...

Steve
 

Attachments

  • export_draw_unit.pas
    196.6 KB · Views: 27
_______________
message ref: 13407
Hi Martin,
I am still Trying to get my head around what is up and what is down in the EMF world.
In the PDF and PRINTED world I believe X-axis goes from left to right, and the Y-axis from bottom to top.

In the EMF world how do the axis run?

Just trying to understand the transform required between the two worlds.

Steve
 
_______________
message ref: 13418
Hi Martin,
I am still Trying to get my head around what is up and what is down in the EMF world.
In the PDF and PRINTED world I believe X-axis goes from left to right, and the Y-axis from bottom to top.

In the EMF world how do the axis run?

Just trying to understand the transform required between the two worlds.

Steve
@Steve_Cornford

Hi Steve,

I'm working on it as we speak. I'll post later when if I've got it working.

cheers,

Martin.
 
_______________
message ref: 13419
@Steve_Cornford

Hi Steve,

I've pushed/merged the files, you should be able to get them (for images/EMF -- not your print and PDF files yet, still waiting to be merged).

In image exports and EMF, X is positive across from the left, Y is positive down from the top. This differs from the trackpad grid, where Y is positive up from the bottom. And also on the sketchboard.

I think I now have it working, for both images and EMF, for the control template. Background templates not done yet.

Feel free to change the colours and font size if you wish. I have set the font height at 3.5 inches (full-size prototype).


emf_chair_labels.png



I have made some changes to the output settings form. It has been on my to-do list for about 100 years to make a proper dialog for the output colours, infill patterns, line thicknesses, etc., instead of having them in the output menu on the pad. So I have made a start on that.

If you create an EMF metafile in memory instead of saving to a file, you can view it in Templot instead of needing to go into a separate program. Saves time when testing. Viewing EMF files in Templot not yet done.

Can I suggest that you don't use tabs when editing? Just use multiple spaces. I had your code jumping about all over the screen while I was trying to adjust the indents. There is a setting to use only spaces in the editor options. :)

cheers,

Martin.
 
_______________
message ref: 13421
Hi Martin.
I have made some changes to the output settings form. It has been on my to-do list for about 100 years to make a proper dialog for the output colours, infill patterns, line thicknesses, etc., instead of having them in the output menu on the pad. So I have made a start on that.
I thought that rather than having to go into a dialogue screen & tick a box then go back to the menu tee and go down another branch to set the colour it makes sense to only have to go to one place to make both choices.
It will give Templot a consistent look & feel, which helps new users etc.
Of course Microsoft has had hundreds, if not thousands, of people working on the cosmetic side of their software over the years and you have just been a one man band!

Can I suggest that you don't use tabs when editing? Just use multiple spaces. I had your code jumping about all over the screen while I was trying to adjust the indents. There is a setting to use only spaces in the editor options. :)
OK will do. It is very frustrating that Lazarus editor and Notepad++ dont handle tabs consistently. Or perhaps they do if only we knew how to tell them.....
OK have now found this screen in the Lazaraus RDE, Object Inspector, right-click then Options:-
1726986113394.png

What are your recomended settings for these, as it would be good to be consistent?

As for Notepad++:-
1726986442843.png

Do you mean taking the "Tab to Space" option?

I think I now have it working, for both images and EMF, for the control template. Background templates not done yet.

Feel free to change the colours and font size if you wish. I have set the font height at 3.5 inches (full-size prototype).

Thank you. Are you handing the baton back to me to do the background templates?

Steve
 
_______________
message ref: 13422
OK have now found this screen in the Lazaraus RDE, Object Inspector, right-click then Options:-
@Steve_Cornford

Hi Steve,

Right-click on the editor, then Options.

https://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options_General#Indent_and_Tabs

I don't like tabs and switch them all off -- pressing tab is the same as the spacebar. For adjusting white space I just hold down the spacebar or backspace keys.

For block indents or outdents, CTRL+i or CTRL+u, and also 1 space at a time. If I want more I just hold them down until I have what I want.

Here are my settings, I'm not suggesting you should do the same, but ideally no TAB characters (ASCII 09) in the source, just multiple spaces. Well actually 09 would be ok if you could see where they are. Perhaps there is an option for that?


laz_ide_tabs.png



I don't use Notepad++ for much actual editing, mostly just searching/replacing.

Are you handing the baton back to me to do the background templates?

If you want it? I'm not issuing instructions. :)

I thought you might like to progress the right-hand side of the output options dialog. But it has waited so long for something to be done it's not urgent. It pre-dates the T5 conversion by half a century or so. There are several other places where multiple sub-menus would be better replaced with dialogs.

I would like to get back to the 3D stuff so that I have some answers for John when he asks about timber thicknesses, chair heaving plugs and sockets etc. I thought I had it all sorted, but then the Neptune arrived, the dreaded PEI bed affects the first layer, COT track appeared, and compatibility with Peco 0 gauge flexi got added into the mix. Not forgetting available plywood thicknesses for laser-cutting. Currently the whole thing is up in the air, and I can't release 556a until it isn't.

cheers,

Martin.
 
_______________
message ref: 13423
Hi Martin,
Thanks for the tabs update.

I have pulled your updates, and copied them to my Lazarus folder.
I have edited my pdf_laz_unit & print_unit as Build reported errors where you have updated field names to be consistent with your naming conventions. SO now have a clean compile.
I would like to get back to the 3D stuff so that I have some answers for John when he asks about timber thicknesses, chair heaving plugs and sockets etc. I thought I had it all sorted, but then the Neptune arrived, the dreaded PEI bed affects the first layer, COT track appeared, and compatibility with Peco 0 gauge flexi got added into the mix. Not forgetting available plywood thicknesses for laser-cutting. Currently the whole thing is up in the air, and I can't release 556a until it isn't.
By all means get back to the bits you enjoy.

I will grasp the batton for applying the contol template updates to the background templates part of the EMF draw stuff.
Then will progress the right-hand side options.

Steve
 
_______________
message ref: 13427
@Steve_Cornford

Hi Steve,

Did you get the files I merged overnight ok?

I've received a baffling pull request from you about print_settings_unit.lfm

GitHub says it contains a conflict which must be resolved.

However, the files in my Git folder and my Lazarus folder are identical.

I've closed the pull request assuming it's an error. Post it again if not.

cheers,

Martin.
 
_______________
message ref: 13429
Hi Matrin,
It was a prior request, and irrelevant, as this morning I pulled your updates to your Main into my fork, then updated my local from my fork so that I match your main.
The T556 branch could be deleted IMHO as it has conflict with main & I believe is irrelevant at present.
Steve
 
_______________
message ref: 13430
The T556 branch could be deleted IMHO as it has conflict with main & I believe is irrelevant at present.
@Steve_Cornford @Alistair Ward

Hi Steve,

It has been deleted. Several weeks ago. GitHub insisted I merge it back into main and delete it. GitHub kept waving a yellow flag at me until I did so.

Or at least, my version of T5-556 has been. Do you have a copy of it which didn't get deleted?

All as clear as mud on GitHub, as usual.

cheers,

Martin.
 
_______________
message ref: 13431
I will grasp the baton for applying the control template updates to the background templates part of the EMF draw stuff.
@Steve_Cornford

Hi Steve,

The main change I made in getting your code to work was to swap X and Y here:


emf_xy.png


For printing templates and PDF, the screen grid is rotated 90 degrees on the paper, so X and Y above need to be swapped over (left of screen is top of printed page).

For image exports, EMF and sketchboard, they are not swapped (left of screen is left of page).

BTW, my usual convention is that upper case X and Y are integers, lower case x and y are floats.

As you can see I have hard-coded the text height in the labels at 3.5" full-size (compared with most chairs being 8" wide, for example). You may feel moved to make that yet another user option. :) The rectangles would adjust to match any changes.

Also you may prefer a font other than Arial, although you need to be sure the font is guaranteed to be available on all users' computers, otherwise the printed result could be very messy. This can be a problem for those using CrossOver/Wine, so the font could be another user setting. There is never an end point. :)

cheers,

Martin.
 
_______________
message ref: 13432
Hi Martin,

I think I have got EMF export background templates chair labels working:-
View attachment 11557

The next thing s to track down the green T's, highlighted above .

Steve
@Steve_Cornford

Hi Steve,

Looking good. (y)

Have you tried saving the EMF to memory instead of to an .emf file? You can then open it immediately in Templot instead of needing to launch a separate viewer (inkscape?).

(But there is no zooming in the Templot viewer -- it displays full-size and you may need to scroll around in the viewer to find it.)

The green T seems to be coloured clLime, so that would be something to look for. Does it appear in the Templot viewer? Does the green T appear if you export a PNG image file instead of EMF metafile?

My current WIP is math_unit, dxf_unit, heave_chairs, shove_timbers

Where have we got to with print_unit and pdf_laz_unit? Are they ready to be merged, or are you still working on them? Sorry if you have already told me and I have forgotten.

Do you have any thoughts on James saying the chair labels vanished and reappeared by themselves?

cheers,

Martin.
 
_______________
message ref: 13455
Hi Martin,
My current WIP is math_unit, dxf_unit, heave_chairs, shove_timbers
I have made some small changes to math_unit.pas so will send you my version for you to winmerge.

I will also post export_draw_unit, pdf_laz_unit, print_unit, print_settings_unit etc

These versions taken together implement the following:-

For experimental chairing, chair label marks are always created for the control template & hence copied to background templates.

The show chair labels checkbox on the Experimental 3D form only controls whether they are shown on the trackpad.
1727180961310.png



The chair labels checkbox on the output elements form controls whether they are output to PDF, print or EMF etc
1727181054027.png

Once the output elements form has been enhanced to include the options currently residing on lots of different menu entries, then I suggest we perform a similar action to create a trackpad elements form, as it is a lot easier for a user to go to just one place to access these settings, rather than having to dip in & out of lots of different menu items

I am happy to undertake these cosmetic changes on your behalf, as this would leave you free to concentate on developing the (you enjoy.

On the output elements form above, I wonder if the [colour...] buttons are redundant, as you just have to click on the coloured panel to edit the colours (as on the Experimental 3D form)

Do you have any thoughts on James saying the chair labels vanished and reappeared by themselves?

Yes I have experienced that in version 555, but not since I have introduced above changes in my development version of 556.

Steve



 
_______________
message ref: 13459
On the output elements form above, I wonder if the [colour...] buttons are redundant, as you just have to click on the coloured panel to edit the colours (as on the Experimental 3D form)
@Steve_Cornford

Hi Steve,

Many thanks for all that. (y)

Unlike TButtons, TPanels cannot be tabbed to and clicked via the keyboard. For those who prefer to use the keyboard or have trouble using the mouse, I put a small TButton on such panels to duplicate the panel click function. It probably doesn't need a caption though. There are several such in Templot.

If you look at the OnClick event drop-down for those colour... buttons, you can see that it is set to the same click event as for the panel, there is no need to write any actual code.

But there is one missing on the 3D experimental form. Probably several others missing on the dxf form -- I tend to forget about such things while developing and have to go back later and tidy it all up.

The same applies to the underlined accelerator keys on the menus and buttons -- I used to spend ages sorting them out to use the most logical letters. But I haven't been bothering nowadays because I get the impression hardly anyone uses them. Menus can be accessed with the Alt key and arrow keys if no using the mouse is wanted.

cheers,

Martin.
 
_______________
message ref: 13460
Funnily enough, at Scaleforum someone asked why you could not use the tab key. I said that I thought that there were quite a few instances taht the tab order had been defined. Oh come to think of it, it might have been James.

As for accelerator keys, think you have to press <Alt> to make them visible, so most people don't know they exist.

Steve
 
_______________
message ref: 13462
As for accelerator keys, think you have to press <Alt> to make them visible, so most people don't know they exist.
@Steve_Cornford

Hi Steve,

They can be made always visible. I imagine folks who like using them would do that:


accel_keys_always_on.png


cheers,

Martin.
 
_______________
message ref: 13463
HI Martin,

Here are the current versions of the units I have worked on.

If you are working on math_unit or have been, then I assume a quick winmerge will identify my small changes.

I have added assign statements for print_chair_label_font to keep wine compliancy, having replaced your hard wired font.assign in the code that output chair labels in the other units.

Todo is the means of user maintenance of this font.

Steve
 

Attachments

  • export_draw_unit.pas
    203.9 KB · Views: 14
  • pdf_laz_unit.pas
    294.2 KB · Views: 16
  • print_unit.pas
    345 KB · Views: 15
  • print_settings_unit.pas
    19.4 KB · Views: 12
  • math_unit.pas
    1.8 MB · Views: 19
_______________
message ref: 13465
Here are the current versions of the units I have worked on.

If you are working on math_unit or have been, then I assume a quick winmerge will identify my small changes.
@Steve_Cornford @James Walters

Hi Steve,

Thanks for the files. I have simplified brick_form by removing the unwanted labels checkboxes:

brick_form1.png


It's still an illogical temporary mish-mash of functions. When we have got a bit further on we can think about tidying things up. The multi-store raft functions need their own form, with probably some more options when we get the K-crossings done. The CTRL+F3 / 3 mouse action blanking button is completely illogical here, but there isn't room for it on the top toolbars without a major re-design of them.

cheers,

Martin.
 
_______________
message ref: 13468
Back
Top