Friday, September 11, 2020

Diagonal Slices of Cubes

Hexagonal grids can be represented as diagonal slices of cubes. Oh my. My brain has not strained this hard to comprehend something for a long time.

I noticed long ago, of course, that the silhouette of a cube is a hexagon, and I knew there had to be some useful application of that, somewhere in the wide world.

Visualize a 3x3x3 Rubik's cube, give the center cube coordinates of 0,0,0, keep all the sub-cubes the sum of whose coordinates equal zero, and voila! -- you have the representation of a hexagonal grid, one central hexagon surrounded by six others. The central one shares an edge with all the others: each other shares one edge with the central sub-cube and an edge with two other neighbors. And you can calculate distances between hexes and all sorts of things using plain old spatial xyz coordinates.

I did not invent this idea. I don't know who invented it. It comes to me by way Amit Patel, whose interactive explanation of the idea is a gorgeous piece of work.

And so by way of Amit Patel's (free) website I come to discover that someone else has actually written a Python library for manipulating hexagonal grids, which you can use -- even commercially! -- for free. I haven't used it yet, so I don't know if it actually works, but my God. The staggering amount of value that is being added daily to the human world! It boggles the imagination. This is just one trivial example: but it's happening all over the world, all the time. 

Which is why, despite all the man-made disasters we're enduring, I do not quite lose hope. A Python library for manipulating hexagonal grids is never going to be headline news, but the increase in human strength -- in our capacity for intellectual cooperation -- that it represents, may be bigger news really than this year's wildfire season.

The morning comes yellow, smoky, and dreary, and there's a dusting on ash on the skylights: but my heart is full of delight and gratitude this morning.


How many political posts have I written, and left unpublished? It must be dozens. I read and think much about politics these days, and I work things out sometimes, to my own grudging satisfaction; but as I do so I realize more and more how ignorant and superstitious my opinions have been all my life; how wrong I have been about so many things. And so I write things out, and then I leave them sitting as drafts. So much I don't know, so much I don't understand. I would only mislead and misrepresent. Let the damn ideas simmer a while. I need to know more, so much more. The last thing the world needs is one more Rush Limbaugh. Which is what I would be, a left-wing version of him, if I let my tongue loose.


Rain will come to the Northwest again, eventually, and the fires will go out, and in a year or two the pandemic will have faded, and there will be a clear bright fearless dawn, whether I'm here to see it or not. Much love to you all, my dears!

No comments: