[HN Gopher] The simple geometry behind any road
___________________________________________________________________
The simple geometry behind any road
Author : azhenley
Score : 117 points
Date : 2026-04-16 03:09 UTC (2 days ago)
(HTM) web link (sandboxspirit.com)
(TXT) w3m dump (sandboxspirit.com)
| jstanley wrote:
| 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.
| trelbutate wrote:
| 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
| ajs1998 wrote:
| :( but the math is fun And they went through all this effort
| anyways, and to blog about it.
| amelius wrote:
| Here's a nice article on it:
|
| https://www.dgp.toronto.edu/~mccrae/projects/clothoid/sbim20...
| Ef996 wrote:
| 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.
| dilberx wrote:
| many are yet to catchup
| red_admiral wrote:
| And then you have various types of hairpin bend where you
| actually vary the width of the lanes with the radius:
| https://www.google.com/maps/@46.8360535,9.6369913,68m
| 21asdffdsa12 wrote:
| 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.
| lencastre wrote:
| 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
| kalmar wrote:
| The care taken here to achieve aesthetically pleasing results
| reminds me of this post about creating nice transit maps in the
| Transit App: https://blog.transitapp.com/how-we-built-the-worlds-
| pretties...
| OgsyedIE wrote:
| 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.
| srean wrote:
| 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.
| pvillano wrote:
| 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?
| nkrisc wrote:
| 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.
| the_arun wrote:
| Roads need to be in 3D, right? I mean for turning elevation on
| the edges matter. Are you covering them in your next post?
___________________________________________________________________
(page generated 2026-04-18 23:01 UTC)