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

Why Doesn't Smooth Flex Default to the Largest Radius?

Started by TomB, January 16, 2024, 04:02:58 PM

Previous topic - Next topic

LDL

Given two fixed points and bearings of the alignments at each point, you can calculate the greatest radius that can be used to connect the points.  AnyRail already does this with "Round corner" lines.

Determine where tangents projected from the fixed points intersect.
- Measure the distance between the intersection and the closer fixed point.
- Measure the angle of the intersection.  Look up the value of the tangent of half the measured angle.

The measured distance divided by the TAN of the half-angle is the maximum radius.

Unless the fixed points are equidistant from the intersection, a tangent will be required at one end of the maximum-radius curve.

You can create this alignment in AnyRail by drawing a line.  Place an endpoint at each fixed point.  Add a point in between, choose "Round corner", and move the point to the intersection of the projected tangents.  The resulting curve + tangent would be the centerline of the track. 

If you're doing it by hand, the tricky part is finding the intersection. 

BadBanana

Quote from: LDL on January 21, 2024, 08:36:44 PM...
Determine where tangents projected from the fixed points intersect.
- Measure the distance between the intersection and the closer fixed point.
...
If I understand correctly, this method would work for two tracks which would cross one another if sufficiently extended.  But AnyRail also uses the smooth function to create S-shaped curves to join two pieces of track that might run parallel when extended, or might even diverge.  I am not sure that your method would work in this case. 

LDL

You're correct.  This method only works if the projected paths intersect.

BadBanana

Quote from: LDL on January 21, 2024, 11:26:13 PMYou're correct.  This method only works if the projected paths intersect.
Thanks.  It is helpful, though.  I was unaware of the technique.

TomB

Just to be clear, I've complained about some of the bad effects of Smooth Flex, but I couldn't live without it.

I've replaced almost every track section in my layout plan with either straight flex or a "Smooth Flex" curve.  I only use flex curves with defined radii in my helix and as guides.  Smooth flex allows this and makes everything look better.  I think it also lets you do easements on the fly by adjusting the control points.

I believe what I've learned is that the control points are everything.  If you apply "Smooth Flex" and don't like the results, just adjust the control points so that you get the configuration you want.  If the radii and configuration you desire are possible, Smooth Flex will show it, along with the radius readout on the bottom of the screen.

Even for ladder tracks, you can go back and grab the control point for the end of the spur (at the bumper), then use that control point to make it straight for as long as possible, while still preserving the minimum radii you want over at the other end where the switch point starts.