Hilbert Curves in 3 Dimensions
Posted on 5/7/2023, by Ben Gordon
Exploring New Dimensions
You may have noticed that in Part 1 of this Hilbert Curve series, I labeled all these curves as 2D Hilbert Curves. Each of the previously rendered curves has been a 2D Planar Curve, but there is nothing preventing us using the same methods to generate 3D Spatial Curves. Let's start by defining our first order curve in 3D, so that we have the building block to generate our future curves from:
3D Hilbert Curve, first order
You'll have likely noticed that our previous 2D curves were all square in dimension. The same will be true for all our 3D Hilbert Curves, only now they will be cubes. The same clone-rotate-connect algorithm can be used to construct 3D curves, only we will need 7 new clones, rather then the previous 3.
3D Hilbert Curve, second order
3D Hilbert Curve, third order
Hungry for More?
That's all for this post! These renderers are computationally expensive, so I'm limited to only a few per page. If you'd like to visually explore these curves further, check out part 3 of this series where I provide an in-browser sandbox where you can manipulate a Hilbert Curve: A 3D Hilbert Curve Sandbox in Your Browser
If you are interested in the algorithm I use to generate these curves, or how I render them in your browser, you can check out parts 4 and 5 of this series: