I am currently working on a visualization of a road network. I am using OpenDrive as my standard for road description. I now have a problem with visualizing the curved parts of roads. These are given as either line, arc or spiral. Line meaning a simple line (curvature = 0), arc is a segment of a circle (curvature is constant).
I now hae a problem with the spiral type. It is given with a start point in the plane (x and y), it's length and a linear curvature function given by 2 parameters: curvatureStart and curvatureEnd. The first is the curvature at the start of the spiral, the second at the end.
From this information I found out, that it is an Euler spiral (also called a clothoid).
Now I am stuck at the point of getting plottable points from these informations about this curve. I want to get a fixed number of points along the spiral. So let's say I want 3 points would mean one at the start of the curve, one at the end and one exactly in the middle along the way.
I hope you can understand my problem. Sadly I haven't found a good solution yet. It also does not have to be totally accurate, an approximation would suffice, as I can only plot points to a certain precision.
There are lots of tricks to doing this that aren't published. Don't implement the stuff in papers (except for Levien's papers), use existing code. IIRC, the auto industry has a "standard" clothoid code library. I can't remember what it's called, though.
Anyway, it's not terribly hard to integrate a two-parameter clothoid. Below is some quick example code I've jotted down. Exactly how you fit the clothoid between two points varies a bit, see the second function for one example.