A few days ago Roger asked about a diamond-crossing on a transition curve. So I watched again the video from 2015:
It uses the method of finding the intersection by moving the mouse manually along the rails and judging the intersection position on the screen by eye. It struck me as a bit agricultural to be still using such methods after all these years, relying on close hand-eye co-ordination and limited by the screen resolution and rounding effects in the drawn lines on the screen.
For a long time we have had the notch on intersection
which are fine as far as they go. But they are limited to fixed-radius curves, and apply only to plain track and/or the main road of a turnout.
They are based on conventional circular geometry, which means they always find two intersections. Resulting in a clunky interface in which Templot asks you which one you want -- even when one of them is nowhere near the templates.
But they do have the advantage of being guaranteed to produce a result.
For years I have had some bits of experimental code for finding intersections directly. Watching that video, I decided it is high time I did something about it, so for the next program update I have implemented an alternative find intersection
Clicking that menu item shows this dialog:
which will find an intersection between any rail (gauge-face) or centre-line with any other rail or centre-line, on any template, straight, curved, transitioned or slewed. And on the main road or turnout road of a turnout or half-diamond. There will be only one intersection, or none if it would be outside one or both of the templates.
Notice that both these turnouts contain a transition curve combined with a slew. The likelihood of anyone wanting to superimpose two such turnouts is almost nil, it's just to demonstrate the function.
(Note that despite appearances the background template is a right-hand template.)
Here I set it to find the intersection between the turnout-road stock rail on the background template, and the turnout-road crossing rail on the control template, with this result after a few seconds:
And zooming in you can see that despite the transitions and slews Templot has found the exact intersection point:
The notch could now be moved under it. The intersection angle is known and there will also be an option to insert a V-crossing or K-crossing of that angle at the intersection location if required.
This will save quite a lot of faffing about, for example when creating custom type 2 tandem turnouts, or custom tandems on a transition curve -- the auto make tandem
function isn't available for transitions or slews. And when working with partial templates generally.
Just one thing holding me back -- if I leave the existing notch on intersection
functions, it will be hard work explaining to beginners the difference between the two. And a whole lot of videos and screenshots will need re-doing. That's two things. I was quite pleased to get the function working, but now feeling weary at the amount of work involved in getting it implemented and released. There is a lot of new stuff in 227a already.
message ref: 30638