alt.hn

4/16/2026 at 3:09:50 AM

The simple geometry behind any road

https://sandboxspirit.com/blog/simple-geometry-of-roads/

by azhenley

4/18/2026 at 8:27:04 AM

You're missing one very important type of curve: a clothoid (or "Euler spiral") is a curve of continuously-varying radius, these are encountered on roads very frequently. And especially on race circuits.

A clothoid is used to connect two lines the same way your fillet is, except instead of just 1 radius it has a radius configured for each end and smoothly changes in between.

https://en.wikipedia.org/wiki/Euler_spiral

They are also used in railways, because on a railway you don't have the freedom of moving the car's position across the road, so a transition from a straight track to a constant radius would imply an instantaneous step change in centrifugal force, or infinite jerk. Using a clothoid to smooth the change between the straight track and the constant-radius turn means the lateral acceleration increases smoothly instead of instantaneously.

by jstanley

4/18/2026 at 4:57:31 PM

Author here. Engineers use clothoids as the primary geometry for high-speed roads by offsetting a centerline clothoid. However, the offset of a clothoid is not itself a clothoid, so the left and right edges are not mathematically clothoids.

A clothoid is simply a mathematically ideal way to achieve continuously increasing curvature along a path. In practice, it can be approximated by chaining multiple circular arcs with decreasing radii.

by Ef996

4/18/2026 at 9:06:03 AM

I was also confused about that because they did mention clothoids in their first post: https://sandboxspirit.com/blog/art-of-roads-in-games

Although re-reading that it seems they just don't want to deal with the math involved

by trelbutate

4/18/2026 at 9:24:41 PM

:( but the math is fun And they went through all this effort anyways, and to blog about it.

by ajs1998

4/18/2026 at 9:19:41 PM

I skimmed some parts I was already familiar with so maybe I missed a mention, but the issue with transitioning from straight to circular arc like this is you get an (theoretically) instantaneous change in lateral forces on the vehicle at the transition point.

Obviously it’s much less of a problem in a game, but it can look strange if you’ve implemented animations that make vehicles lean when going around curves or are limiting vehicle speeds based on those computed lateral forces.

In a game at least, there’s lots of simple ways to work around the issue (just use some kind of fake, arbitrary smoothing on changes in lateral forces).

In a real road, it would likely not feel good and probably would cause issues.

by nkrisc

4/20/2026 at 5:47:02 AM

When I worked on autonomous vehicles I realized that if I really wanted to figure out how to get the vehicle to end up where I wanted, I had to model the actual processes involved. It wasn't actually that difficult. I literally just generated a set of curves that would start with the wheels of a vehicle pointed straight ahead, and tracing the path the car would follow if the steering wheel started being turned at a reasonable rate to a maximum fixed angle, holding it there for some amount of time, then straightening the wheel again. This curve wasn't a simple shape at all, but it didn't matter. It gave the most accurate results. Once the family of curves was generated, I could just select the one that best fit the situation.

by pontifier

4/18/2026 at 4:56:48 PM

I think this comment section would be a good place to ask for help with a related problem.

I want to design a "smooth" closed path that fits in a square, as long as I can make it. It needs to smooth in such a way that a constant velocity can be maintained subject to limits on acceleration and jerk. The point is to develop a test for maximum flow rate on a filament 3D printer without the motion system ever slowing the tool-head down. (In reality, the standard smoothed "E" shape is good enough. This is more of an exercise.)

I know roads are designed to limit acceleration and jerk, and someone knowledgeable about road design would know about finding curves with constraints on acceleration and jerk.

Do you know any free tools or resources on theory that I could use?

by pvillano

4/18/2026 at 2:11:26 PM

The wikipedia page on some of the considerations is a good introduction on where the real world goes beyond this:

https://en.wikipedia.org/wiki/Geometric_design_of_roads

It's tempting to think that the cross-section geometry of a road only applies in three dimensions and can be elided for 2D overheads, but the parabolas that smoothly connect straights and curves in the overhead perspective are often subtly warped to permit any requirements of cant and superelevation.

by OgsyedIE

4/18/2026 at 4:56:45 PM

I recall reading that Markov (of Markov chain fame) had also worked on transition curves for railway tracks. I have tried and failed to track down any references, or even recall where exactly I read this.

If any HN folks have pointers, would love that.

by srean

4/18/2026 at 9:20:12 PM

Roads need to be in 3D, right? I mean for turning elevation on the edges matter. Are you covering them in your next post?

by the_arun

4/18/2026 at 11:02:19 AM

vehicular speed is very important as a consideration in any road curvature, as well as “pitch and yaw” when changing slope and direction at speed, so… simple it is not, and if we are mostly “offsetting” straight lines and arcs, we are doing it wrong

by lencastre

4/18/2026 at 10:18:22 AM

Expected it to at least mention the slant imposed on any road surface so water does not pool. Disappointed to tears and thus salt-water-aquaplaning in all games build upon this.

by 21asdffdsa12

4/18/2026 at 8:40:00 AM

many are yet to catchup

by dilberx