
Data structure for triangle meshes - the-enemy
http://www.redblobgames.com/x/1722-b-rep-triangle-meshes/
======
modalduality
Another particular interesting representation is Guibas and Stolfi's
"quadedge" data structure from their 1985 paper at "Primitives for the
manipulation of general subdivisions and the computation of Voronoi," source
[http://dl.acm.org/citation.cfm?doid=282918.282923](http://dl.acm.org/citation.cfm?doid=282918.282923)
and pdf at
[http://www.sccg.sk/~samuelcik/dgs/quad_edge.pdf](http://www.sccg.sk/~samuelcik/dgs/quad_edge.pdf).

It really is an elegant use of some basic topology with impressive results, a
full Voronoi/Delaunay linear-log time algorithm in less than a page of easily
implementable pseudocode (once the data structure is written).

~~~
chancho
Careful, that pseudocode has a famous error in it. Finding it is an
illuminating exercise.

~~~
woliveirajr
Could you give more details?

~~~
modalduality
I believe the error is only in the incremental algorithm. Spoiler:
[https://people.eecs.berkeley.edu/~jrs/meshpapers/GSflaws](https://people.eecs.berkeley.edu/~jrs/meshpapers/GSflaws).

------
Sharlin
Amit's pages in general [0][1] are an absolutely amazing and invaluable source
of high-quality game programming information.

[0] [http://www.redblobgames.com/](http://www.redblobgames.com/)

[1] [http://www-cs-students.stanford.edu/~amitp/gameprog.html](http://www-cs-
students.stanford.edu/~amitp/gameprog.html)

~~~
grimgrin
I think they're great too. I'm a complete novice to game development and my
normal dev gig doesn't require much understanding of the math I learned in
high school.

I needed to draw lines in a little thing I'm doing for
[https://itch.io/jam/cga-jam](https://itch.io/jam/cga-jam) and stumbled across
[http://www.redblobgames.com/grids/line-
drawing.html](http://www.redblobgames.com/grids/line-drawing.html)

Implemented it last night and it worked wonderfully.

[http://ix.io/wSG/nim](http://ix.io/wSG/nim)

------
nerdponx
This is cool. Does it have applications beyond computer graphics?

~~~
leblancfg
It would provide a fast, grid-like interpolation for any 2D data: think
geospatial, GIS, etc. If I understand correctly, could also be used
recursively to provide a lazy (but inefficient) way to calculate locations to
an arbitrary precision.

~~~
maze-le
Reminds me of topojson[0], a GeoJSON extension, that encodes features as
topologies, instead of geometries.

[0]: [https://github.com/topojson](https://github.com/topojson)

