Closed shallwefootball closed 6 years ago
I think it is because of below.
Then, Is there any way to know the center point of each hexagon?
I can imagine you expect a hexagon's center()
method returns the center position of the hexagon you called it on relative to Hex(0, 0)
. But unfortunately Hex#center()
returns the same point for all hexagons in the grid. I have an item on my backlog (see item 4) to fix this, but I haven't come around to it...
You can get around it by adding the hex's point, like so:
const Hex = Honeycomb.extendHex({size: 11})
const Grid = Honeycomb.defineGrid(Hex)
Grid.hexagon({radius: 15}).forEach(hex => {
console.log(hex.center().add(hex.toPoint()));
});
I want to know the center point of each hexagon, but only one hexagon center point is output.
Let's look at the code below.
Am I misunderstanding?