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

  • 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 and plug track - progress discussions

Quick reply >
HI Martin,
I have now found the cause of the multiple Green T's in the EMF export file.

It was the four occurrences of Textout(0,0,''); statements, which I have removed.

Here is the latest version of export_draw_unit.pas if it not too late to include

Steve
 

Attachments

  • export_draw_unit.pas
    204.5 KB · Views: 43
_______________
message ref: 13469
It was the four occurrences of Textout(0,0,''); statements, which I have removed.
@Steve_Cornford

Hi Steve,

Why does that display as 'T'? :unsure:

Instead of removing it, maybe change the empty string to a space?

Without those statements Delphi5/T2 won't display dotted lines as dotted. I have no idea why not. I think the same applies in the PDF creator. I was in the habit of always inserting that line after creating a TCanvas, so there are a lot of them. I don't know if still needed in Lazarus/T5.

cheers,

Martin.
 
_______________
message ref: 13470
Hi Martin,
Thanks for accelerator keys tip.In Windows 20 Pro it is this setting:- "Change how keyboard shortcuts work"
1727212435978.png

Steve
 
_______________
message ref: 13471
.
Yet another tick-box -- several folks asked to be able to switch this off:


force_eq_checkbox.png



Note that the forced equalizing applies only to clip-fit and snap-fit plug track -- not to press-fit or COT track.

Note also that heaving individual chairs in COT track to clip-fit or snap-fit will not force equalizing.

cheers,

Martin.
 
_______________
message ref: 13485
Hi Martin,
I thought you might be interested in the results of some of my investigations to do with outputting of lines.
export_draw_unit
I have made a small change as a result of some research,
with output grid lines solid selected I get this:-
1727557427543.png

note the so called dash line of the timber centre lines, and the solid grid line.

This is the current status quo, and is equivalent to the version of the program you have.

If I then select output grid lines dotted, I now get:-
1727558908922.png

note the timber centre line dashes. Instead of round ends, and the dashes merging into one another they have "flat" ends.
Also the grid lines dots are visible as dots.

This

Code:
                    Pen.Color:=printgrid_colour;           // for grid lines.
                    Pen.Mode:=pmCopy;

                    // SC 28-SEP-2024 556
                    Pen.Cosmetic:=False;     // use Geometric Pen
                    Pen.EndCap:=pecFlat;     // Flat endcap instead of default round endcap
                    // sc 28-sep-2024 556

                    if pad_form.printed_grid_dotted_menu_entry.Checked=True
                       then begin
                              Brush.Color:=clWhite;  // 0.93.a gaps in dotted lines.
                              Brush.Style:=bsSolid;

                              { // for bigger dots we can use psPattern
                              Pen.Style := psPattern;
                              SetLength(aPenPattern,2);
                              aPenPattern[0] := 3;  //line [pixels]
                              aPenPattern[1] := 3;  //space [pixels]
                              Pen.SetPattern(aPenPattern);
                              Pen.Width := 3;}

                              Pen.Style:=psDot;
                              pen_width:=1;         // must be 1 for dots.
                            end

See https://lazarus-ccr.sourceforge.io/docs/lcl/graphics/tpenendcap.html

But the key thing is that for the export_draw_unit we can have mix solid and more defined non-solid lines, and even control their appearance by using psPattern instead of the default psDot or psDash.


However this does not work for the pdf_laz_unit, because (as I believe you found out) as soon as you select a non-solid pen, then all lines from that point on get presented in the pdf as that style of line, which I might investigate further.
I assume that is why you have replaced the psDot with PsSolid in the dotted grid procedure in pdf_laz_unit, and in other places...
1727560097219.png
ie line 3312 can set pen.style to psDot, but then line 3314 immediately sets it to psSolid before it is used.

Not all that important in the great scheme of things so ignore and enjoy COT track etc...
Steve
 
_______________
message ref: 13503
Hi Martin,
I have now proved that it is pdfcreator that is not handling the mix of line styles.

pdf_laz_unit creates one or more .emf files, all with the correct line styles. For instance here is page 1 of 3 as an .emf file:-
1727561561944.png


WIthh dotted grids ok, and solid timber outlines etc.
But once it has been through PDFCREATOR we get:-
1727561620404.png

Not too important for now..... but .... one day I will solve it.....

How is 556 going?

Steve
 
_______________
message ref: 13504
@Steve_Cornford

Hi Steve,

Thanks for your investigations. You have found some stuff in Lazarus which is new to me, and wasn't in Delphi5. Once we have T5 stable there may be lots of new stuff in Lazarus which we can make good use of.

For the PDF output there is a known bug in the PDF component (well it's known to me anyway) relating to dotted lines being unpredictable. I suspect this is related to the TextOut(0,0,'') fix.

It's possible I could have fixed this by getting an upgraded version of the PDF component, but I feared a later version might not be compatible with 25-year-old Delphi5 (which we still need for the PDF creator helper exe).

I'm currently working on this:


cot_sockets.png



To allow sockets within COT track for plug-in sections of rail -- which is important for complex formations.

That's something which I never allowed for in the original scheme of things, the plug-fit settings are currently global for the entire DXF file. Making them chair-specific has meant a lot of re-writing of the code. I think I'm getting there, slowly. Making the jaw options chair-specific too is a step too far for 556 and will have to wait -- otherwise I will never get 556 done any time soon.

Getting COT fully integrated into plug track is proving to be no 5-minute task. :(

cheers,

Martin.
 
_______________
message ref: 13505
Hi Martin,
Getting COT fully integrated into plug track is proving to be no 5-minute task. :(
But from the feedback & interest generated at Scaleforum will be worthwhile I am sure. Even I am tempted to try it!

As far as Lazarus is concerned I am pretty sure we do not need the TextOut(0,0,'') fix, as I removed it during my testing of export_draw_unit

Anyway please don't let the dotted or otherwise lines distract you from the rewrite!

I have a better way of distracting you, which is to ask if you can include the option of bonus chairs/sockets?

Why?
.
.
.
3rd rail of course :rolleyes:

Steve
 
_______________
message ref: 13506
I have a better way of distracting you, which is to ask if you can include the option of bonus chairs/sockets?

Why?
.
.
.
3rd rail of course :rolleyes:
@Steve_Cornford

Hi Steve,

That's easy now. :)

Just add a single rail as a partial template, hide the sleeper outlines and capture the sockets.

Or did you mean chairs on bonus timbers? That's on my list but it's tricky because it depends where the bonus timber is within the template.

Looking at your screenshot, something wrong here, no corner radius. Is that down to you or me?


wrong_corner.png


cheers,

Martin.
 
_______________
message ref: 13507
_______________
message ref: 13517
Hi Martin,
Is it ok for me to do a bit of work on print_settings_unit ?

for instance:-
View attachment 11643

Steve
@Steve_Cornford

Hi Steve,

Sure, carry on -- I'm not doing anything there at present.

Nor in bgkeeps_unit if you wanted them both to have a similar look. :)

I would like to get 556a out this week, and then we can get GitHub sorted out and stuff merged for 556b.

cheers,

Martin.
 
_______________
message ref: 13539
Hi Martin,
cautionary tale...
Last night when I was tired .....
Email from sourceforge advised me that Lazarus 3.6 available...
I downloaded it, then during install it prompted me to "uninstall previous version" (or some such message),
which I took.
It then installed v3.6.
When i tried to build Templot5 the first error I got was a report that frameviewer09 missing.
I used the online package installer thingy to find & install htmlviewer in Lazarus/components.
Then during build Templot5, I got an error ... about a "dpi" field undefined. this was defined in htmlfonts.pas in the modified html stuff you provide, so I copied your files into the lazarus/components/htmviewer folder, recompiled Lazarus RDE, then Templot5 build was error free.

Just holding my hand up to any steps taken in error above, but it all seems to work ok & splash screen for Lazarus displays 3.6.


Steve
 
_______________
message ref: 13542
Hi Martin,
It might be as a result of now using Lazarus RDE 3.6, but I noticed today that the Tpanel seems to have tabstops.
1727769510978.png

as well as the Tbutton:-
1727769586362.png


or am i getting confused?

I think it means that we could remove the colours.. Tbuttons, which might give us a bit more wriggle room to add all the other stuff we want to add?
Belay all that, as I have just discovered that although when you press tab, it does navigate to the Tpanel, but does not highlight it, so when you then press <cr>, it doesnt work. But obviously Tbutton does highlight when you get to it & does work when you then press <cr>

Obviously I would need to set tabstop true as here:-
1727769926941.png

Just thinking out loud & would value your opinion.

Aslo I am thinking of just grouping all 5 of these buttons under just one heading Infill colours in order to make space for patterns radio buttons and line thickness pararameters etc.
Steve
paused development for breakfast break 🥚
 
_______________
message ref: 13543
Last edited:
Hi Martin,
cautionary tale...
Last night when I was tired .....
Email from sourceforge advised me that Lazarus 3.6 available...
I downloaded it, then during install it prompted me to "uninstall previous version" (or some such message),
which I took.
It then installed v3.6.
When i tried to build Templot5 the first error I got was a report that frameviewer09 missing.
I used the online package installer thingy to find & install htmlviewer in Lazarus/components.
Then during build Templot5, I got an error ... about a "dpi" field undefined. this was defined in htmlfonts.pas in the modified html stuff you provide, so I copied your files into the lazarus/components/htmviewer folder, recompiled Lazarus RDE, then Templot5 build was error free.

Just holding my hand up to any steps taken in error above, but it all seems to work ok & splash screen for Lazarus displays 3.6.


Steve
@Steve_Cornford @Alistair Ward

Hi Steve,

Thanks for the warning. Strangely I haven't (yet) received the email.

For others, if you go to: https://github.com/Martin-Wynne/Templot5

and scroll to the bottom, the Lazarus install and build instructions are listed there (added by Alistair), with links to my original posts and screenshots.

cheers,

Martin.
 
_______________
message ref: 13544
Hi Martin,
I have just edited my tabstop post, as they don't seem to work
@Steve_Cornford

Hi Steve,

You can tab to a Tpanel but it can't be focused (gain a dotted rectangle) or be clicked from the keyboard. Or show any evidence of being clickable (but we could change the mouse cursor on it).

I think the idea is that having tabbed to it you can then tab again to access the buttons and controls it contains (or use the arrow keys).

With tabstop set false, tabbing goes straight to the first control within it.

But that might vary with different versions of Windows. It's 25 years since I played with these controls and concluded that it needed a separate button for keyboard access, and I've now forgotten whatever I knew then. I have never noticed such buttons on any other software, so obviously the Templot method is wrong somewhere. But it works and should be reasonably obvious to users, so it's probably best to stick with it. :)

It's not too much work -- just copy and paste a button onto it (select the panel first), and then set the button's OnClick event to the same as the panelClick. There is no coding involved. If it's a modal form you can set ModalResult in the panel click event, if wanted, rather than directly on the button.

cheers,

Martin.
 
_______________
message ref: 13546
t is not the work involved, just the space involved.
@Steve_Cornford

Hi Steve,

It's not essential for the panel to be clickable. You could use a TShape instead of a TPanel, and set both infill and outline colours on one line:


colour_settings1.png



There is no click event for a TShape, but there is MouseDown (or MouseUp), which you could use to make it clickable. But not really needed with the larger buttons.

Or anything else you think would work. :)

cheers,

Martin.
 
_______________
message ref: 13548
Sources:-
 

Attachments

  • export_draw_unit.pas
    206 KB · Views: 40
  • pdf_laz_unit.pas
    295.2 KB · Views: 38
  • print_settings_unit.lfm
    20.1 KB · Views: 67
  • print_settings_unit.pas
    22.9 KB · Views: 37
  • print_unit.pas
    347.7 KB · Views: 43
_______________
message ref: 13550
I'm currently working on this:


cot_sockets.png



To allow sockets within COT track for plug-in sections of rail -- which is important for complex formations.

That's something which I never allowed for in the original scheme of things, the plug-fit settings are currently global for the entire DXF file. Making them chair-specific has meant a lot of re-writing of the code. I think I'm getting there, slowly. Making the jaw options chair-specific too is a step too far for 556 and will have to wait -- otherwise I will never get 556 done any time soon.

I have made some progress and finally got the above working -- I think. :) It still needs a lot of testing.

It means you can now do this:


cot_sockets1.png



Mostly COT, but you can choose to leave individual chairs as plug-ins. This makes it possible to build complex formations in COT. In the above example I have set the V-crossing chairs as separate plug-ins. This would be an alternative to the glue-on loose jaws option for the wing rails. With the plug-in chairs loose on the rails it should be possible to assemble the bent wing rails into them, before plugging the assembly into the base. You would then slide in the vee rails as before.

I assumed this would need the solid snap-fit option for the plug-in chairs in FDM:


cot_snap_fit.png



Which work fine. I have also tried FDM-printing the clip-fit option on the Neptune 4 and the result is ok, but at present a tight bash fit in the sockets. So it needs some tweaking of the dimensions:


cot_clip_fit.png



On balance I think I prefer the plain vanilla snap-fit for FDM.

These new options should be available in 556a in the next few days.

cheers,

Martin.
 
_______________
message ref: 13562
Hi Martin,
I have found an anomoly in the style/pattern case codes between that used for rail infill style and all the other infill style definitions
rail_infill_i uses 2 as solid and 3 as cros-hatched, whereas all the other infills use 2 for cross-hatched and 3 for solid.

I would quite like to sort this out and make them consistent, but to do this need to modify pad_unit.pas, which I believe you have made changes to.
It might be that there is a reason for this inconsistancy and you might want to retain it, but it is confusing when one inspects the code.

What are your feelings on this?

Steve

edited to correct my confusion....
 
_______________
message ref: 13565
I have made some progress and finally got the above working -- I think. :) It still needs a lot of testing.

It means you can now do this:


View attachment 11668


Mostly COT, but you can choose to leave individual chairs as plug-ins. This makes it possible to build complex formations in COT. In the above example I have set the V-crossing chairs as separate plug-ins. This would be an alternative to the glue-on loose jaws option for the wing rails. With the plug-in chairs loose on the rails it should be possible to assemble the bent wing rails into them, before plugging the assembly into the base. You would then slide in the vee rails as before.

I assumed this would need the solid snap-fit option for the plug-in chairs in FDM:


View attachment 11670


Which work fine. I have also tried FDM-printing the clip-fit option on the Neptune 4 and the result is ok, but at present a tight bash fit in the sockets. So it needs some tweaking of the dimensions:


View attachment 11669


On balance I think I prefer the plain vanilla snap-fit for FDM.

These new options should be available in 556a in the next few days.

cheers,

Martin.


Martin

Excellent news, do you intent to fit the knuckle spacer and Vee end stop?
 
_______________
message ref: 13567
Martin

Excellent news, do you intent to fit the knuckle spacer and Vee end stop?
@Hayfield

Hi John,

I'm not sure what you mean by the vee end stop, but I certainly intend that the crossing spacer blocks be included in COT, and you should be seeing them already.

With the plug-in chairs it is a bit trickier because they are treated internally as part of the chairs. Which means at present you get this with the plug-ins:


cot_spacers_wrong.png



Which is no good at all. :(

They need to be "chairs" in their own right so that they can stay on the COT base between the timbers. I will get this sorted out eventually, but I can only go so fast.

My own preference is for the glue-on loose jaws instead, in which case the spacers are fine as they stand.

cheers,

Martin.
 
_______________
message ref: 13576
Hi Martin,
I have found an anomoly in the style/pattern case codes between that used for rail infill style and all the other infill style definitions
rail_infill_i uses 2 as solid and 3 as cros-hatched, whereas all the other infills use 2 for cross-hatched and 3 for solid.

I would quite like to sort this out and make them consistent, but to do this need to modify pad_unit.pas, which I believe you have made changes to.
It might be that there is a reason for this inconsistancy and you might want to retain it, but it is confusing when one inspects the code.

What are your feelings on this?

Steve

edited to correct my confusion....
@Steve_Cornford

Hi Steve,

I'm all in favour of consistency. :)

I should be pushing my WIP stuff to GitHub soon. There are not a lot of changes in pad_unit.

Are you intending to create a new form for the control template options, similar to the bgkeeps and print_settings?

cheers,

Martin.
 
_______________
message ref: 13577
Hi Martin,
I should be pushing my WIP stuff to GitHub soon

Have you included any of the changes I have sent you so far?

Are you intending to create a new form for the control template options, similar to the bgkeeps and print_settings?


That would probably be a good idea, but it would be useful to get some user feedback on the print_settings_unit enhancements first.

Current cosmetic situation:-
1727908818159.png


4 more line colour boxes to add

need to add some help/info buttons perhaps.

Also I have been comparing the bgkeeps form (detail on background templates) with print_settings form (output elements) to see what tick boxes they have in common.

Your COT developments look promising.

Steve
 
_______________
message ref: 13578
@Hayfield

Hi John,

I'm not sure what you mean by the vee end stop, but I certainly intend that the crossing spacer blocks be included in COT, and you should be seeing them already.

With the plug-in chairs it is a bit trickier because they are treated internally as part of the chairs. Which means at present you get this with the plug-ins:


View attachment 11686


Which is no good at all. :(

They need to be "chairs" in their own right so that they can stay on the COT base between the timbers. I will get this sorted out eventually, but I can only go so fast.

My own preference is for the glue-on loose jaws instead, in which case the spacers are fine as they stand.

cheers,

Martin.

Martin

Thank you for the clarification and sorry about getting the names wrong
I also mistook this was instead rather than as well as COT track with glued on chairs

I am now printing the revised design of the center section of the diamond, there was a design error anyway where I failed to remove a S1 chair for a L1 chair

I have looked at an old P4 company 1-6 diamond crossing plan, which shows presumably the correct rail breaks for the stock rails (as the Templot template unlike the turnout templates does not show these breaks**) This has confirmed in my mind the build sequence. The planed COT track improvements will make it even easier to build

As I said I am experimenting and its not something I would advise the average Templot'er. Hopefully a glimpse of the future and shows Templot 3D is not just about simple turnouts

** Neither a request or a complaint
 
_______________
message ref: 13579
Martin

Thank you for the clarification and sorry about getting the names wrong
I also mistook this was instead rather than as well as COT track with glued on chairs

I am now printing the revised design of the center section of the diamond, there was a design error anyway where I failed to remove a S1 chair for a L1 chair

I have looked at an old P4 company 1-6 diamond crossing plan, which shows presumably the correct rail breaks for the stock rails (as the Templot template unlike the turnout templates does not show these breaks**) This has confirmed in my mind the build sequence. The planed COT track improvements will make it even easier to build

As I said I am experimenting and its not something I would advise the average Templot'er. Hopefully a glimpse of the future and shows Templot 3D is not just about simple turnouts

** Neither a request or a complaint
I wouldn't count on it. If it is the same as Exactoscale then open to interpretation. If I recall it correctly the rail breaks or some of them at least were for production reasons. Then there is the question of prototype, not all the same and some not really practical either.
 
_______________
message ref: 13583
(as the Templot template unlike the turnout templates does not show these breaks**)
@Hayfield

Hi John,

These are marked on the Templot templates only if you change to the prototype timbering option for half-diamond templates (which works only with exact-scale flangeway gaps, P4, S7, etc.):


h_d_timbering_proto.png



Which then shows the prototype REA rail joints in the K-crossing wing rails, and closed-up timber spacing at the joint:


index.php



But that option is no good for 00/EM/0-MF etc., because the nose of the K-crossing point rails wouldn't be properly supported in a chair. Templot adjusts the timber spacings as necessary with the model setting, but then the rail joint can't be in the prototype position, so it is omitted.

cheers,

Martin.
 
_______________
message ref: 13585
Back
Top