# Cornu spiral connection

Hi,

I am looking for a way to connect a circle with a circle using the Clothoide. Is there a function in Rhino, that does that?

Take a look at these pics:

Thanks
Martin

1 Like

So I might be totally missing something about what makes this curve special mathematically but does BlendCrv get you what you need?

Hi Brian,

well. BlendCrv will connect these two curves in different types of G continuity.
However: What is needed (and a part of the cornu spiral should create) is a continues increase in curvature.

In Blend Crv, I have no direct control over the increase of decrease of the curvature.

It is needed for train track and street development. The continues change is the steering wheel change over time - when driving from a straight track to a circle.

Wikipedia explains it better than me

@dale can you help answer this one?

Thanks for the further info Martin.

Rhino does not have a function that will calculate this. But, there are plenty of papers on the Internet that describe the process. Some ambitious programmer might be able to provide this functionality in a plug-in. Also, you might check ghe Grasshopper forum to see if this type of spiral has been mentioned.

I found this with a quick search.

with this as its vb.Net code:

``````  Private Sub RunScript(ByVal x As OnPlane, ByVal y As Object, ByVal z As Object, ByRef A As Object, ByRef B As Object, ByRef C As Object)

Dim pts As New List(Of On3dPoint)
Dim EndPointLine As On3dPoint = x.PointAt(0, 100, 0)        'centre of first arc
Dim Line As New OnLine(x.origin, EndPointLine)              '
Dim pt As On3dPoint = Line.PointAt(0)                       'origin of spiral
Dim rot As On3dPoint

Dim Vector As New On3dVector(x.PointAt(z / 2 * 100, 0, 0))
Line.Translate(Vector)
pt = Line.PointAt(0)                                        'second point on spiral

For i As Int32 = 1 To y

rot = Line.PointAt(1 / i)
Line.Rotate(z * i, x.zaxis, rot)                           'rotates line
pt = Line.PointAt(0)                                       'third point on spiral etc

Next

A = pts

End Sub

``````

Thanks guys,

so I will probably programm something on my own on the basis of the papersā¦ simplified approach

Thanks
Martin

Wondered if the code has been written (Python preferred but Grasshopper or VB script accepted) to do this Cornu spiral / Euler spiral āconnectionā between a ālineā and a ācircleā (or arc?) ??? (or am I (a DEFINED AMATEUR)) destined to do this on my own? - My perception is what we want is something like: '_Blend_Cornu ; select circle; return; select line; return - it gives me back a āvisualā in some color, and it has connected and/or split-off (but not trimmed-off) the circle where the cornu intersects / connects?

i think i see whatās supposed to be happening with this type of spiral and its curvature graphā¦ it you were to straighten the curve and the curvature graph, the result should be like this imageā¦ the curvature increases linearly:

after tracing your attached image then using `BlendCurve`:

ā¦i ended up with a curve that very closely resembles the original except when straightening, the graph looks like the following imageā¦ the acceleration(?) of the curve wavers as you go through the transition and i guess the goal is to allow a driver to increase the turn of a steering wheel at a consistent clip.

anyway, it might be possible to script this in more of a geometry fashion using some of the rhino functions as opposed to those crazy looking formulasā¦ the part i need to figure out now is how the cornu spiral determines where to make the tangent points on the circle and lineā¦ if you already know those points, itās probably possible to adjust the BlendCrv points to the proper locationā¦ without knowing those points, itās more of a guessā¦
does anyone see a logic (that doesnāt look like itās written in an alien language ) to determine the blend points on the curve and line?

1 Like

@MartinIC The last line of this paragraph from the linked wiki is intriguing to me:

The Euler spiral has two advantages. One is that it is easy for surveyors because the coordinates can be looked up in Fresnel integral tables. The other is that it provides the shortest transition subject to a given limit on the rate of change of the track superelevation (i.e. the twist of the track). However, as has been recognized for a long time, it has undesirable dynamic characteristics due to the large (conceptually infinite) roll acceleration and rate of change of centripetal acceleration at each end. Because of the capabilities of personal computers it is now practical to employ spirals that have dynamics better than those of the Euler spiral.

Kind of vague, and I know its wikipedia, but what are those better dynamics defined by exactly? Can you speak about that as it pertains to train track and street development?

i sort of give up on trying to figure out how to make this happen with standard python/rhinoscriptā¦ everything i can find regarding the fresnel integral calculations has people using numpy or scipy etc in the examplesā¦ and the calculus is just too much for me to wrap my head around without taking some sort of class to point me in the right direction.

i think mcneel would have to integrate it via those code wizards they have locked up in the cave

i guess it depends on how many road,railroad, and roller coaster designers are requesting the function to be added to rhinoā¦ i recall 3 people at this forum needing (or wanting?) to create this type of spiral in the past few months.

Hi CarveCream,

Iām not actually in the field of street development. So Iām not the most reliable source on this matter.
However, Iāve been doing some online research on this field (on wikpedia) aswell. On the German translation of transition arc - āĆbergangsbogenā, it states that there are several commonly used curves.
Klothoide, Sinusoide and cubic Parabolas
The German Railway (Deutsche Bahn) is states that they are also using s- Shaped transition curves, based on Parabolas by the power 5 (Bloss Curve). The ālatestā development is taking the center of gravity of the train into account and is names āWiener Bogenā
This approach was developed by Herbert, L. Hasslinger and seems to be patented.
(Iām still not sure how the patenting of geometry works. I think you need to file the patents in Vienna. Anyway.)

Here are the sources (all Wikipedia).

Thanks
Martin

Transition curve

The
transition curve is a Trassierungselement used in the construction of
roads as a connecting element between a straight line and a circular arc
or between two arcs. It
is characterized by the fact that he - as opposed to straight and
circular arc - at every point has a different radius of curvature. This causes the transition between straight lines and arcs, the curve is slow and not abruptly close. Purpose of a transition curve is, in the curve ā¦
Wiener sheet

The Wiener Bogen is a novel form of the transition curve, which is used in railway construction. Unlike
other forms such as clothoid, Bloss sheet, etc. sinusoids, the focus of
a rail vehicle is taken into account in the Wiener sheet. In this way, the load of the vehicle and the path is minimized. The
Wiener sheet is protected since 2002 a registered trademark and patent
law for the public transport and the Austrian Federal Railways. The inventor Herbert L. Hassl ā¦

in a way, i donāt believe this to be the optimum curve for a driverā¦ itās more of a theoretical optimum but i doubt it translates as such in real worldā¦ for the theory to be correct, it assumes the driver is basically on cruise control when going through the turnā¦ that may be the case on certain highway stretches but for interchanges and such, a driver is typically accelerating or decelerating through the curve in which case, the linear curvature is no longer linear as noticed by a driverā¦ is it?

in many cases, i can also imagine these curves make the driver feel as if the turn is less sharp than it really isā¦ or, there is probably a tendency to tap the brakes when youāre 3/4 through as the sharpness sneaks up on youā¦

āoptimumā is probably in the 3D realmā¦ a curve combined with an inclineā¦ and also may be different depending on the surrounding environmentā¦ a curve may appear different to an approaching driver depending on what else/landscape is visible.

idk, just thinking out loud with no reason other than being interested in the spiral.

Iād guess a lot of this applies more strictly to railroads, where there is no scope for adjustment at all in the trajectory and probably very little for speed.

-Pascal

1 Like

yeahā¦ i think youāre rightā¦ once you enter a human driver into the equation, all sorts of things can go wrong

Or right, is what Iām thinking - on a roadway the driver can smooth out the actual traveled curve as needed as long as there is sufficient width in the roadway, so it may be less crucial to get the roadway curves perfect. But I just made that up.

-Pascal

1 Like

in either case, i imagine the cornu connection is still better than just putting a radius curve in there any time the road needs to change direction.

this is as far as iāve gotten with trying to make it in python:

itās ārightā in that the spiral never collapses onto itself and that it just gets infinitely smallerā¦ but itās turning too fast too soonā¦ i think if i could somehow change the calculation based on arc length as opposed to using a set angle of rotation (ie- make it so the spacing between the radial lines at the yellow arrows is always equal), then it would be correctā¦ or close to correct.

problem is, i donāt understand the physics involved so i have to make it happen first then test if itās correct instead of what i think is the more proper way of understanding the physics first then just writing the code accordingly

Yeah, that was how I was āthinkingā about it - approximate with a series of tangent arcs of a given arc length and then interpolate the end points if a smoother curve is needed. You need to decide on the starting radius and the allowed decrease in radius. I did this by hand with a constant decrease to get an idea about how it was going to look but I imagine the decrease should be proportional.

-Pascal

My understanding is roads are designed with constant radius curves so that a drive can see how tight the curve will be as they enter it and make the appropriate adjustment to their speed. Fundamentally different than designing rail tracks.