News:

Due to heavy spamming attempts on this forum, automatic registration has been disabled. We will approve registration requests as quickly as possible (unless you're a spammer of course :) )

Main Menu

More flex-track

Started by Jeff, January 08, 2009, 05:24:33 PM

Previous topic - Next topic

Jeff

Speaking of flex-track, I know that holding down shift while dragging control points or the ends constrains the move to a straight line. What I would like to see is having the drag follow a curve, IF the original track is curved. It would make shrinking a curved piece of flex-track to insert a turnout MUCH easier.

On a similar subject, this applies when you're moving a track piece end-point to make the piece shorter. If the end-point runs into a curve-control handle, it simply stops, whether the point is on a straight piece or curve. I'd like to see the end-point 'push' the control handle along the track piece ahead of it until the mouse button is released. This would save time and effort, as this situation happens, on average, 50 or a hundred times in a day's work on designing.
Later,                                                AnyRail Fanatic
Jeff                      and Unofficial Guy Who Knows Almost Everything About It

David

Hi Peartree,

Thanks again for your suggestions!

It's quite difficult stuff that you ask though. To keep a curve curved, at least three control points need to be moved at once. You've asked before for a 'cut here' function, which seems to be a bit easier to understand as a user, and easier to implement as well. We've studied the math behind that, and it seems doable.

I do not really understand your second suggestion. Could you explain it a bit further?

David.
David Hoogvorst. Founder and Owner of DRail Software. Creator of AnyRail.

Jeff

I'll try.

Let's say you have placed a piece of straight flex-track. You decide you want it shorter, but you don't want it to wander away from being straight. You hold down the shift key while you drag the end-point handle of the piece, which confines it to following the straight-line path of the piece.

Now suppose you have placed a piece of flex-track that you have curved. You want to make the piece shorter. You disconnect it on one end(at least). and try your best to move the end-point handle back along the curve, but whether you hold down shift or not, you make a terrible mess of it and decide you need to do it all over again :(

So, what is needed is to have the shift key confine the end-point handle to the path of the existing curved piece, yes? Someplace in the layout file is something describing the path of the original curve. I was simply hoping you could do this. If it's impossible, I'll take the 'cut the original piece at this point' and I can discard the unwanted section.
Later,                                                AnyRail Fanatic
Jeff                      and Unofficial Guy Who Knows Almost Everything About It

David

Hi Peartree,

I understand what you want.

Of course, it's never an excuse, but the way flex is represented now is not by a path, but by its four 'control points', or handles.

These four points define what's called a 'Bezier curve'. We've chosen to use Bezier curves because the have plenty of nice features, among which the speed at which they can be drawn onto the screen.

However, its mathematical characteristics imply that it is not possible to keep a curve follow the same path when moving only one of the points, unless it is completely straight. Hence, if you move one endpoint along the existing curve, deformations will occur. The only solution would be to move three control points at the same time (the dragged endpoint and the two points halfway the flex). That seems like an ugly solution to me, as there are many conditions where it will not work very well.

Cutting a Bezier into two new Beziers is possible though. This will then mean that you can cut an existing piece of arbitrarily curved flex at any point, and will be left with two new pieces of flex. I think that that approach is a lot more natural.

Please give us a bit of time to further investigate this.

David.
David Hoogvorst. Founder and Owner of DRail Software. Creator of AnyRail.