7 ms·
This is critically missing spiral hex coordinates which require only a single coordinate, not two. I think the original idea is from Paul Bourke. He calls it a
by virtualritz 3y ago
This is critically missing spiral hex coordinates which require only a single coordinate, not two.
I think the original idea is from Paul Bourke. He calls it a Spiral Honeycomb Mosaic (SHM).
See his "Tiling on The Plane" page [1]. Scroll down to the section titled "Hexagonal Lattice" (contains links to source code with coordinate conversions).
Here is a Rust implementation of a different variant of the same idea [2].
[1] http://paulbourke.net/geometry/tilingplane/ http://paulbourke.net/geometry/tilingplane/
[2] https://crates.io/crates/hex-spiral https://crates.io/crates/hex-spiral
- pohl 3y agoThat's pretty sweet. I tried to work something like that out on my own while I was using this resource to do some spiral iteration on a Tonnetz[1] I was making in SwiftUI. (Janky screenshot[2]) I ended up retreating from that approach — but now I might give it another go. Thanks for the links! [1] https://en.wikipedia.org/wiki/Tonnetz https://en.wikipedia.org/wiki/Tonnetz [2] https://hachyderm.io/@pohl/110918457500286347 https://hachyderm.io/@pohl/110918457500286347
- stcg 3y agoThere is a note on another page about it: https://www.redblobgames.com/grids/parts/#more https://www.redblobgames.com/grids/parts/#more > Spiral Honeycomb Mosaic [0] (search the page for "Spiral Honeycomb Mosaic") is an interesting way to assign numbers to hexagons in a hexagonal grid. It results in bizarre properties. [0] http://paulbourke.net/geometry/tilingplane/ http://paulbourke.net/geometry/tilingplane/
- amitp 3y agoSpiral and other coordinate systems are on my list of things to add to the page. In addition to the Paul Bourke page, I have these bookmarked: - https://gamedev.stackexchange.com/questions/71785/converting-between-spiral-honeycomb-mosaic-and-axial-hex-coordinates https://gamedev.stackexchange.com/questions/71785/converting... - https://tex.stackexchange.com/questions/275490/is-there-an-easy-way-to-number-a-hexagonal-spiral https://tex.stackexchange.com/questions/275490/is-there-an-e... - https://github.com/cooscoos/spiral_cube https://github.com/cooscoos/spiral_cube - https://web.archive.org/web/20160309172431/http://www.pyxisinnovation.com/pyxwiki/index.php?title=Generalized_Balanced_Ternary https://web.archive.org/web/20160309172431/http://www.pyxisi... - https://www.sciencedirect.com/science/article/pii/0166218X9200186P https://www.sciencedirect.com/science/article/pii/0166218X92... - https://thoughtstreams.io/jtauber/hex-map-addressing/ https://thoughtstreams.io/jtauber/hex-map-addressing/ - http://tzaphiriron.sidemoon.net/static/hex/hex.html http://tzaphiriron.sidemoon.net/static/hex/hex.html - https://tilde.zone/@misterdave/109736460410840020 https://tilde.zone/@misterdave/109736460410840020 There's so much more to add to the page, and I keep adding over time. Thanks for the link to the hex-spiral crate; I'll add it to my bookmarks.