Questions tagged [hexagonal-tiles]

Tessellating tiles for use as 2d-histogram bins, game boards, etc.

Hexagonal tiles are tessellating hexagons placed adjacently to each other.

The use of this tag is fairly broad, encompassing statistics, computer science and game design.

234 questions
11
votes
2 answers

Hexagon grid on sphere without pentagon

I wanted to make a tile-based world on a sphere. I would like to use hexagon-shaped tiles, though as far as I can figure out you need to have pentagons in there too to make it fit. So, my question is, is it possible to make a hexagon grid on a…
The Oddler
  • 6,314
  • 7
  • 51
  • 94
11
votes
4 answers

Best Way to Store a Triangular/Hexagonal Grid in Python

I'm making a game with hexagonal tiles, and have decided upon using a triangular/hexagonal grid. I found this question which helped me generate coordinates, and slightly modified the code to store all the coordinates as keys in a dictionary with…
RylandAlmanza
  • 1,358
  • 1
  • 8
  • 14
9
votes
2 answers

How to make stat_binhex shown on a log scale in ggplot2

I have a 2d hexagon density plot with many points. I would like the counts within the hexagons to be displayed on a logarithmic scale, but I can't figure out how to do this through ggplot2. Here is a simple example: x <- runif(1000, 50, 100) y <-…
user3389288
  • 992
  • 9
  • 30
8
votes
1 answer

How to reliably generate hexagonal grid over a world map

Goal I'm attempting to build an application whereby the whole world map is split into a large number of hexagons. These hexagons, once generated would always cover the same area on the map. Then, given certain geographical coordinates, a hexagon…
Maciej Gurban
  • 5,615
  • 4
  • 40
  • 55
7
votes
3 answers

How to draw/manage a hexagon grid?

I've read this article: generating/creating hexagon grid in C . But look like both the author and answerer have already abandoned it. √(hexagonSide - hexagonWidth * hexagonWidth): What's hexagonSide and hexagonWidth? Isn't it will < 0 (so square…
Luke Vo
  • 17,859
  • 21
  • 105
  • 181
7
votes
2 answers

Faster way to calculate hexagon grid coordinates

I'm using the following procedure to calculate hexagonal polygon coordinates of a given radius for a square grid of a given extent (lower left --> upper right): def calc_polygons(startx, starty, endx, endy, radius): sl = (2 * radius) *…
urschrei
  • 25,123
  • 12
  • 43
  • 84
7
votes
2 answers

Raytracing (LoS) on 3D hex-like tile maps

Greetings, I'm working on a game project that uses a 3D variant of hexagonal tile maps. Tiles are actually cubes, not hexes, but are laid out just like hexes (because a square can be turned to a cube to extrapolate from 2D to 3D, but there is no 3D…
6
votes
3 answers

R - Plotting Hexagon Tessellations

I'd like to generate some square plots that have arrays of hexagons inside of them, like drawn here. I'd like to plot both regular (geometrically regular) and abnormal hexagon tessellations, so I don't think tools from the "sp" package will work. …
Nathan
  • 323
  • 3
  • 13
6
votes
2 answers

Displaying data in a hexagonal grid using Python

What I am looking for is a method or class that allows me to display a list of hexagons in a grid. Ideally I would then be able to use some form of set-method to change the color/hatching/border of the individual hexagons. The hexagons are stored…
John
  • 1,721
  • 3
  • 15
  • 15
5
votes
1 answer

Best-fit hexagonal tilings of irregular areas

I'm looking for recommendations for an application or library to calculate good fits of regular hexagonal grids to an irregular area or group of areas. Minimally, I'd like to be able to supply an image and maximum number of hexagons and retrieve the…
Dan Percival
  • 293
  • 2
  • 8
5
votes
2 answers

Putting matplotlib hexbin into an Aitoff projection

I have the nice hexbin plot below, but I'm wondering if there is any way to get hexbin into an Aitoff projection? The salient code is: import numpy as np import math import matplotlib.pyplot as plt from astropy.io import ascii filename =…
npross
  • 1,756
  • 6
  • 19
  • 38
5
votes
1 answer

Neural Networks for hexagon-shaped (and binned) images?

This is really a conceptual question -- I've been working on this for sometime now, but haven't found a great way to go about solving my problem. I have a hexagonal image with hexagonal binning/pixels, with b/w intensity values for each pixel and am…
5
votes
1 answer

Making a hexagonal plot with elements being weighted in python

Using matplotib in python it is possible to make a simple histogram by providing the list of items to be plotted together with a list of weights, such that the contribution of each item to the bin to which it belongs is adjusted according to its…
5
votes
1 answer

Generate, fill and plot a hexagonal lattice in Python

I'd like to modify a Python script of mine operating on a square lattice (it's an agent based model for biology), to work in a hexagonal universe. This is how I create and initialize the 2D matrix in the square model: basically, N is the size of the…
Orso
  • 179
  • 1
  • 2
  • 12
5
votes
5 answers

snap to closest hexagon centre in hex based grid

I am attempting to create a grid based game. so far i have a hexagonal tile based grid, with a coordinate scheme as shown below: col 0 | col 1 | | col 2 | | | __ | __ __ __ __ …
JabbaWook
  • 677
  • 1
  • 8
  • 25
1
2
3
15 16