Closed khamaileon closed 5 years ago
If I understand you correctly you want to have a different width and height for your hexes. I'm afraid this is not possible currently with honeycomb âšī¸
I can image this is an important feature and I'll look into adding it. Please keep in mind this might take some time though...
Update: I've added the possibility to set a separate width and height for hexes, but Hex#fromPoint()
(and Grid.pointToHex()
) is now broken. I'm struggling with the math, but once I've got it, I need to update the tests and I could release an alpha version. Hopefully within a week.
One way to think about Hex#fromPoint
is that you now have a separate size
for x and y axes. Whereas before, you might calculate hex width and height from size
, you now have them as input constraints, and can calculate size
from them (separately for x and y).
Thanks for the input Amit :blush: I know how I'm going to do it, didn't found the time to finish it though :pensive:
I've just released v2.0.0 of honeycomb. It's a major release because I've removed some methods. I hoped the auto generated changelog would show the breaking changes too, but no đ
In this new version it's possible to have "stretched" hexes. See the docs for more info.
I've actually used a (the?) python hex library to "borrow" the math, thanks for that đ
I need to generate a hexagonal grid in my JS frontend that perfectly matches the one I generate from my Python backend because I use the centroid of the hexagon as an ID.
This is the Python code / library I use now:
https://github.com/stephanh42/hexutil#converting-between-hexagonal-grid-coordinates-and-screen-coordinates
Is there a way to fix the height and width of a hexagon with "honeycomb"?