ManevilleF / hexx

Hexagonal tools lib in rust
Apache License 2.0
273 stars 22 forks source link

Support irregular hexagons #125

Open feelingsonice opened 7 months ago

feelingsonice commented 7 months ago

Is your feature request related to a problem? Please describe. I'm not able to configure for irregular shaped hexagons in HexLayout. Perhaps there is a way, in which case please excuse my ignorance and point me in the right direction :)

Describe the solution you'd like A way to support irregular shaped hexagons.


EDIT:

I see the hex_size field in HexLayout, but since it's a Vec2, I'm guessing it would only support irregular hexagons that, in the "flat top" orientation, have the flat size exactly 1/2 of the over all width?

i.e. how would one support something like this?

Screenshot 2023-12-09 at 10 13 40 AM
ManevilleF commented 7 months ago
Screenshot 2023-12-10 at 11 15 50

Chainging the hex_size in the hex_grid example you can set irregular hexagon sizes but they will look scaled and not sliced like your example. I can look into custom scaling but that doesn't exist yet

ManevilleF commented 3 months ago

I worked on this, and it's a headache. Making the hexagons scaled along a vertex is not a problem, the issue comes from adapting the layout which is based on matrix calculations. Unfortunately I could not figure it out for 0.16 but I think this would make a good addition for a future release

feelingsonice commented 3 months ago

np, thanks for taking a look