Cornu spiral connection


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:


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 :wink:

@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) 
    ''' <your code>

    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))
    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


    A = pts

    ''' </your code>
  End Sub 

Thanks guys,

so I will probably programm something on my own on the basis of the papers… simplified approach :wink:


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 :wink: ) to determine the blend points on the curve and line?

@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 :smile:

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


Google Translation:

Transition curve

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.


yeah… i think you’re right… once you enter a human driver into the equation, all sorts of things can go wrong :wink:

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.


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 :wink:

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.


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.