Three dimensional Hilbert curve
See also
Michael Bader. Space-Filling Curves: An Introduction with Applications in Scientific Computing, Springer Science & Business Media, 2012. doi:10.1007/978-3-642-31046-1 .
Examples
pos = hilbert_3d(2)
if(require(rgl) && interactive()) {
plot3d(pos, type = "l", lwd = 4, col = 2)
}
#> Loading required package: rgl