fananek / hex-grid

HexGrid library provides easy and intuitive way of working with hexagonal grids.
MIT License
45 stars 8 forks source link

issues with rectangular generator #13

Closed mgrider closed 2 years ago

mgrider commented 2 years ago

Describe the bug As mentioned in #12, when generating cells using the .rectangle GridShape, the resulting grid appears rotated from what is expected in 3 out of 4 possible combinations of Orientation and OffsetLayout.

To Reproduce It is probably easiest to reproduce this behavior by drawing/visualizing the resulting grid. Here are some screenshots generated using the SKHexGrid project. The coordinates shown are Axial.

Orientation: .pointyOnTop, OffsetLayout: .even

Screen Shot 2022-08-10 at 3 15 10 PM

Orientation: .pointyOnTop, OffsetLayout: .odd

Screen Shot 2022-08-10 at 3 17 55 PM

Orientation: .flatOnTop, OffsetLayout: .even

Screen Shot 2022-08-10 at 3 18 36 PM

Orientation: .flatOnTop, OffsetLayout: .odd

Screen Shot 2022-08-10 at 3 19 06 PM

Expected behavior You can see from the screenshots that only the .flatOnTop, .even layout appears to be correct.

fananek commented 2 years ago

Rectangular generator has been fixed in version 0.4.10.

fananek commented 2 years ago

During implementation of this fix I realized that convertor and generator might need some redesign. At this moment rectangular generator produces rectangular grids for all four possible configurations. But I'm not fully satisfied. Let's keep track in issue no. #14.

mgrider commented 2 years ago

Thank you for working on this!