It is impossible to cover a sphere with regular tiles (except for long and thin "orange slices". So the optimal way to pixelize a map, given certain constraints or requirements, is actually a pretty difficult research problem.
You can't cover a sphere with equal hexagons, but you could cover it with a geodesic, which is mostly hexagons, with 12 pentagons at the vertices of an icosohedron, and the hexagons slightly distorted to make it bulge into a sphere.
六角形瓷砖对于应用于地理空间用途的常规几何形状来说过于复杂。
查看 HTM 来了解与三角形类似的内容,或者在 google 上查找“其他来源的分层三角网格”。
Hexagonal tiles are too complicated for regular geometry as applied to geospatial uses.
Check out HTM for a similar thing with triangles or google for "Hierarchical Triangular Mesh" for other sources.
I've just built an R package called dggridR which divides the surface of the Earth into equally sized hexagons for the purposes of binned spatial analysis.
Carsten makes this sound impossible in his answer, but, practically speaking, it's not. By introducing 12 pentagons all the rest of the hexagons fit together without an issue. Since you may have millions upon millions of cells for a highly-resolved grid, you can forget about those pentagons most of the time.
The maths of the transformation are complicated. You can find them in:
Crider, John E. “Exact Equations for Fuller’s Map Projection and Inverse.” Cartographica: The International Journal for Geographic Information and Geovisualization 43.1 (2008): 67–72. Web.
Snyder, John P. “An Equal-Area Map Projection For Polyhedral Globes.” Cartographica: The International Journal for Geographic Information and Geovisualization 29.1 (1992): 10–21. Web.
In the background dggridR relies on Kevin Sahr's DGGRID software.
You may also find the following references to be of use:
Gregory, Matthew J. et al. “A Comparison of Intercell Metrics on Discrete Global Grid Systems.” Computers, Environment and Urban Systems 32.3 (2008): 188–203. CrossRef. Web.
Kimerling, Jon A. et al. “Comparing Geometrical Properties of Global Grids.” Cartography and Geographic Information Science 26.4 (1999): 271–288. Print.
Sahr, K. “Hexagonal Discrete Global GRID Systems for Geospatial Computing.” Archiwum Fotogrametrii, Kartografii i Teledetekcji Vol. 22 (2011): 363–376. Print.
Sahr, Kevin. “Location Coding on Icosahedral Aperture 3 Hexagon Discrete Global Grids.” Computers, Environment and Urban Systems 32.3 (2008): 174–187. CrossRef. Web.
Sahr, Kevin, Denis White, and A. Jon Kimerling. “Geodesic Discrete Global Grid Systems.” Cartography and Geographic Information Science 30.2 (2003): 121–134. Print.
There are only a few platonic polyhedra that use a single type of polygon to approximate a sphere. Famously the ICOSAHEDRON and the DODECAHEDRON. If you're willing to have a little bit of distortion and a few overlapping points, you can get fair results that would make a game fun. Try THIS LINK, which manages to have nearly equal area for all tiles and pretty consistent tile-distances for circles around the globe.
However none of these map very easily onto the good old geographic, cylindrical longitude/latitude projection system.
One solution is to just super-impose a honeycomb pattern onto the EQUIRECTANGULAR projection map and allow TONS of distortion as you approach the poles LIKE THIS.
The old Traveller roleplaying game used to map planet surfaces as icosahedra (cut open for printing in a book). This produced a big distortion at the corner hexes (they have to become pentagons). You might find some such material when searching for GURPS Traveller.
Getting a sphere to divide into equal parts made with flat surfaces is a tough nut. Because of this, you end up with Geodesic shapes, which are not composed of shapes that can be in turn composed of triangles of equal size. Breaking down all of the hexagons and pentagons into triangles, you end up with triangles that have different interior angles, leading to a loss of symmetry.
The one consolation that I can give you is that all of the shapes will have a limited number of triangles that can be catagorised, which means for a small geodesic, that 5 or 6 triangles can be used repeatedly to describe all of the hexagons and pentagons required for the geodesic. While distances will not be equal from the "center" of each triangle/shape, you can at least divide the handling of each triangle into a discrete case, lending to a potential work-around in code.
HEAlpix is the right one if your constraint is to keep equal area when splitting the sphere in pieces (interesting for covering the projected area in the sky the same in the poles as well as in the equator region). You basically split your sphere in 4 each time following either an ring or nested scheme to fulfill the Hierarchical Equal Area constraint. It is also very convenient for 'deploying' FT functions ((iso-latitude property) on the sky for example to study the temperature of CMB modes in Planck or WMAP mission.
It is also implemented in many programming languages.
Furthermore, I should mentioned another one (not equal area though), called Q3C for 'Quad Tree Cube', another sky-partitioning scheme which has other advantages (cone search and x-match)
The other responses are correct in that it is impossible to tile a sphere using only hexagons.
However, a simple(ish) hack is:
Create a 2d "sheet" of hexagons:
and offset them in 3D space from the origin by 1. Then, normalize all of the vertices.
This will give you a "bulging" version of the sheet that has a nice spherical curve to it. The problem is that this will only work if the sheet covers part of the sphere.
One solution is similar to what is used to create an infinite grid floor. As the sphere rotates, when you have moved half a cell, rotate the sphere back once cell in the relevant direction. (For the case of hexagons, the numbers aren't really half a cell, but tied to the dimensions of a hex tile.) This is a little tricky in 3D, but is doable.
I had a similar question in 2D awhile back that may be helpful.
There is a paper which handles the case of equal area tiling (almost square tiles around the equator) and is relatively easy to pre-compute neighbouring tiles and on which tile a specific set of coordinates falls in. It doesn't fare well with the requirement for equal distance between the vertices though.
Copying here the abstract:
A new method is proposed to divide a spherical surface into equal-area cells. The method is based on dividing a sphere into several latitudinal bands of near-constant span with further division of each band into equal-area cells. It is simple in construction and provides more uniform latitude step between latitudinal bands than other methods of isolatitudinal equal-area tessellation of a spherical surface.
(I've used its ideas trying to find closest geolocation neighbours from a long list of locations).
Well, lots of people have made the point that you can't tile the sphere with hexagonal tiles - maybe you are wondering why.
Euler stated (and there are lots of interesting and different proofs, and even a whole book) that given a tile of the sphere in x Polygons with y Edges total and z vertices total (for example, a cube has 6 polygons with 12 edges and 8 vertices) the formula
x - y + z = 2
always holds (mind the minus sign).
(BTW: it's a topological statement so a cube and a sphere - or, to be precise, only their border - is really the same here)
If you want to use only hexagons to tile a sphere, you end up with x hexagons, having 6*x edges. However, one edge is shared by each pair of hexagons. So, we only want to count 3*x of them, and 6*x vertices but, again, each of them is shared by 3 hexagons so you end up with 2*x edges.
Now, using the formula:
x - 3*x + 2*x = 2
you end up with the false statement 0 = 2 - so you really can't use only hexagons.
That's why the classical soccer ball looks like it does - of course modern ones are more fancy but the basic fact remains.
发布评论
评论(14)
用规则的图块覆盖球体是不可能的(除了又长又薄的“橙色切片”)。因此,在给定某些约束或要求的情况下,像素化地图的最佳方法实际上是一个相当困难的研究问题。
一种非常常用的图块通常(在天体物理学中)是 HEALPIX 像素化: http://healpix.sourceforge.net/
这种像素化满足等面积要求;然而,
另一种像素化是“GLESP”,它具有一些不同的属性(并且不像软件包那样完善):http://www.glesp.nbi.dk/
It is impossible to cover a sphere with regular tiles (except for long and thin "orange slices". So the optimal way to pixelize a map, given certain constraints or requirements, is actually a pretty difficult research problem.
One sort of tiling used very often (in astrophysics) is the HEALPIX pixelisation: http://healpix.sourceforge.net/
This pixelization satisfies the equal-area requirement; it's impossible to make everything equidistant, however.
Another pixelization is "GLESP", which has some different properties (and isn't as polished a software package): http://www.glesp.nbi.dk/
我想到的第一个网站是Amit 的游戏编程信息及其六边形网格上的链接集合。
The first website that comes to mind is Amit's Game Programming Information and its collection of links on hexagonal grids.
你不能用相等的六边形覆盖球体,但可以用测地线覆盖它,测地线主要是六边形,二十面体的顶点有 12 个五边形,六边形稍微扭曲,使其凸出成球体。
You can't cover a sphere with equal hexagons, but you could cover it with a geodesic, which is mostly hexagons, with 12 pentagons at the vertices of an icosohedron, and the hexagons slightly distorted to make it bulge into a sphere.
六角形瓷砖对于应用于地理空间用途的常规几何形状来说过于复杂。
查看 HTM 来了解与三角形类似的内容,或者在 google 上查找“其他来源的分层三角网格”。
Hexagonal tiles are too complicated for regular geometry as applied to geospatial uses.
Check out HTM for a similar thing with triangles or google for "Hierarchical Triangular Mesh" for other sources.
阅读 Kevin Sahr、Denis White 和 A. Jon Kimerling 所著的《测地线离散全球网格系统》,
您可以找到它 这里...
Read "Geodesic Discrete Global Grid Systems" by Kevin Sahr, Denis White, and A. Jon Kimerling
You can find it here...
我刚刚构建了一个名为 dggridR 的 R 包,它将地球表面划分为大小相等的部分用于分箱空间分析的六边形。
卡斯滕在他的回答中使这听起来不可能,但实际上,事实并非如此。 通过引入 12 个五边形,所有其余的六边形都可以毫无问题地组合在一起。 由于高分辨率网格可能有数百万个单元,因此大多数时候您可以忘记这些五边形。
转换的数学很复杂。 您可以在以下位置找到它们:
Crider, John E.“富勒地图投影和逆的精确方程”。 制图:国际地理信息和地理可视化杂志 43.1 (2008):67–72。 Web。
约翰·P·斯奈德。“多面体地球仪的等面积地图投影。” 制图:国际地理信息和地理可视化杂志 29.1 (1992):10-21。 网络。
dggridR 在后台依赖于 Kevin Sahr 的 DGGRID 软件。
您还可能会发现以下参考文献有用:
I've just built an R package called dggridR which divides the surface of the Earth into equally sized hexagons for the purposes of binned spatial analysis.
Carsten makes this sound impossible in his answer, but, practically speaking, it's not. By introducing 12 pentagons all the rest of the hexagons fit together without an issue. Since you may have millions upon millions of cells for a highly-resolved grid, you can forget about those pentagons most of the time.
The maths of the transformation are complicated. You can find them in:
Crider, John E. “Exact Equations for Fuller’s Map Projection and Inverse.” Cartographica: The International Journal for Geographic Information and Geovisualization 43.1 (2008): 67–72. Web.
Snyder, John P. “An Equal-Area Map Projection For Polyhedral Globes.” Cartographica: The International Journal for Geographic Information and Geovisualization 29.1 (1992): 10–21. Web.
In the background dggridR relies on Kevin Sahr's DGGRID software.
You may also find the following references to be of use:
只有少数柏拉图多面体使用单一类型的多边形来近似球体。 著名的 ICOSAHEDRON 和 十二面体。 如果您愿意有一点扭曲和一些重叠点,您可以获得公平的结果,从而使游戏变得有趣。 尝试此链接,它设法使所有图块的面积几乎相等并且非常一致地球周围圆圈的平铺距离。
然而,这些都不能很容易地映射到良好的旧地理圆柱经度/纬度投影系统上。
一种解决方案是将蜂窝图案叠加到 EQUIRECTANGULAR 投影图上,并允许大量扭曲当您接近两极时 像这样 。
祝您研究顺利! :)
There are only a few platonic polyhedra that use a single type of polygon to approximate a sphere. Famously the ICOSAHEDRON and the DODECAHEDRON. If you're willing to have a little bit of distortion and a few overlapping points, you can get fair results that would make a game fun. Try THIS LINK, which manages to have nearly equal area for all tiles and pretty consistent tile-distances for circles around the globe.
However none of these map very easily onto the good old geographic, cylindrical longitude/latitude projection system.
One solution is to just super-impose a honeycomb pattern onto the EQUIRECTANGULAR projection map and allow TONS of distortion as you approach the poles LIKE THIS.
Good luck with your research! :)
旧的旅行者角色扮演游戏曾经将行星表面绘制为二十面体(切开以便打印在书中)。 这在角六边形处产生了很大的变形(它们必须变成五边形)。 您在搜索 GURPS Traveller 时可能会找到一些此类材料。
The old Traveller roleplaying game used to map planet surfaces as icosahedra (cut open for printing in a book). This produced a big distortion at the corner hexes (they have to become pentagons). You might find some such material when searching for GURPS Traveller.
将一个球体分成由平坦表面制成的相等部分是一项艰巨的任务。 因此,您最终会得到测地线形状,不是< /em> 由形状组成,而形状又可以由相同大小的三角形组成。 将所有六边形和五边形分解为三角形,最终会得到具有不同内角的三角形,从而导致对称性丧失。
我可以给您的一个安慰是,所有形状都将具有有限数量的可分类三角形,这意味着对于小型测地线,可以重复使用 5 或 6 个三角形来描述所有 测地线所需的六边形和五边形。 虽然与每个三角形/形状的“中心”的距离不相等,但您至少可以将每个三角形的处理划分为离散的情况,从而在代码中提供潜在的解决方法。
Getting a sphere to divide into equal parts made with flat surfaces is a tough nut. Because of this, you end up with Geodesic shapes, which are not composed of shapes that can be in turn composed of triangles of equal size. Breaking down all of the hexagons and pentagons into triangles, you end up with triangles that have different interior angles, leading to a loss of symmetry.
The one consolation that I can give you is that all of the shapes will have a limited number of triangles that can be catagorised, which means for a small geodesic, that 5 or 6 triangles can be used repeatedly to describe all of the hexagons and pentagons required for the geodesic. While distances will not be equal from the "center" of each triangle/shape, you can at least divide the handling of each triangle into a discrete case, lending to a potential work-around in code.
如果您的约束是在将球体分成几部分时保持相等的面积(对于覆盖天空中的投影面积在两极和赤道区域相同)。 基本上,每次按照环形或嵌套方案将球体分成 4 份,以满足分层等面积约束。 在天空上“部署”FT功能((等纬度属性)也非常方便,例如研究普朗克或WMAP任务中CMB模式的温度。
它也可以用许多编程语言实现。
此外,我应该提到另一种(虽然面积不相等),称为“四树立方体”的 Q3C,这是另一种天空分区方案,具有其他优点(圆锥搜索和 x 匹配)
原论文:
http://adsabs.harvard.edu/abs/2006ASPC..351..735K
HEAlpix is the right one if your constraint is to keep equal area when splitting the sphere in pieces (interesting for covering the projected area in the sky the same in the poles as well as in the equator region). You basically split your sphere in 4 each time following either an ring or nested scheme to fulfill the Hierarchical Equal Area constraint. It is also very convenient for 'deploying' FT functions ((iso-latitude property) on the sky for example to study the temperature of CMB modes in Planck or WMAP mission.
It is also implemented in many programming languages.
Furthermore, I should mentioned another one (not equal area though), called Q3C for 'Quad Tree Cube', another sky-partitioning scheme which has other advantages (cone search and x-match)
original paper:
http:// adsabs.harvard.edu/abs/2006ASPC..351..735K
老问题,但是:
其他答案是正确的,因为不可能仅使用六边形来平铺球体。
然而,一个简单的黑客是:
创建一个六边形的二维“表”:
并将它们在 3D 空间中从原点偏移 1。然后,标准化所有顶点。
这将为您提供一个“凸出”版本的板材,具有漂亮的球形曲线。 问题是,只有当薄片覆盖球体的部分时,这才有效。
一种解决方案类似于用于创建无限网格地板的解决方案。 当球体旋转时,当您移动了半个单元格时,将球体沿相关方向旋转回一个单元格。 (对于六边形的情况,数字实际上并不是半个单元格,而是与六角形图块的尺寸相关。)这在 3D 中有点棘手,但是可行的。
不久前我在 2D 中遇到了类似的问题,这可能会有所帮助。
https://gamedev.stackexchange.com/questions/70092/infinite-treadmilling-六角网格/70341#70341
Old question, but:
The other responses are correct in that it is impossible to tile a sphere using only hexagons.
However, a simple(ish) hack is:
Create a 2d "sheet" of hexagons:
and offset them in 3D space from the origin by 1. Then, normalize all of the vertices.
This will give you a "bulging" version of the sheet that has a nice spherical curve to it. The problem is that this will only work if the sheet covers part of the sphere.
One solution is similar to what is used to create an infinite grid floor. As the sphere rotates, when you have moved half a cell, rotate the sphere back once cell in the relevant direction. (For the case of hexagons, the numbers aren't really half a cell, but tied to the dimensions of a hex tile.) This is a little tricky in 3D, but is doable.
I had a similar question in 2D awhile back that may be helpful.
https://gamedev.stackexchange.com/questions/70092/infinite-treadmilling-hexagonal-grid/70341#70341
有一篇 论文 处理等面积平铺的情况(赤道周围几乎是方形平铺)并且预先计算相邻图块以及特定坐标集落在哪个图块上相对容易。不过,它不能很好地满足顶点之间距离相等的要求。
在此复制摘要:
(我使用它的想法试图从一长串位置中找到最近的地理位置邻居)。
There is a paper which handles the case of equal area tiling (almost square tiles around the equator) and is relatively easy to pre-compute neighbouring tiles and on which tile a specific set of coordinates falls in. It doesn't fare well with the requirement for equal distance between the vertices though.
Copying here the abstract:
(I've used its ideas trying to find closest geolocation neighbours from a long list of locations).
看看 vraid/earthgen; 它使用六边形(加上一些五边形)并包含源代码(请参阅 planet/grid/create_grid.cpp)。
截至 2018 年,基于球拍的新版本可用。
Take a look at vraid/earthgen; it uses hexagons (plus a few pentagons) and includes source code (see planet/grid/create_grid.cpp).
As of 2018 a new version is available based on racket.
嗯,很多人都指出不能用六边形瓷砖来铺球体 - 也许您想知道为什么。
欧拉指出(有很多有趣和不同的证明,甚至整本书)给出了 x 多边形中的球体图块,其中总共有 y 条边和总共 z 个顶点(例如,一个立方体有 6 个多边形,有 12 条边, 8个顶点)公式
始终成立(注意减号)。
(顺便说一句:这是一个拓扑陈述,所以立方体和球体 - 或者,准确地说,只有它们的边界 - 在这里实际上是相同的)
如果你只想使用六边形来平铺球体,你最终会得到 x 六边形,有6*x 边。 然而,每对六边形共享一条边。 因此,我们只想计算其中的 3*x 个和 6*x 个顶点,但同样,它们中的每一个都由 3 个六边形共享,因此最终会得到 2*x 个边。
现在,使用公式:
你最终会得到错误的陈述
0 = 2
- 所以你真的不能只使用六边形。这就是为什么古典足球看起来像它的样子——当然现代足球更花哨,但基本事实仍然存在。
Well, lots of people have made the point that you can't tile the sphere with hexagonal tiles - maybe you are wondering why.
Euler stated (and there are lots of interesting and different proofs, and even a whole book) that given a tile of the sphere in x Polygons with y Edges total and z vertices total (for example, a cube has 6 polygons with 12 edges and 8 vertices) the formula
always holds (mind the minus sign).
(BTW: it's a topological statement so a cube and a sphere - or, to be precise, only their border - is really the same here)
If you want to use only hexagons to tile a sphere, you end up with x hexagons, having 6*x edges. However, one edge is shared by each pair of hexagons. So, we only want to count 3*x of them, and 6*x vertices but, again, each of them is shared by 3 hexagons so you end up with 2*x edges.
Now, using the formula:
you end up with the false statement
0 = 2
- so you really can't use only hexagons.That's why the classical soccer ball looks like it does - of course modern ones are more fancy but the basic fact remains.