All examples By author By category About

veltman

Triangulation morphing

Tweening between a single polygon (Texas) and multiple polygons (Hawaii) with an approach that's somewhat faster and more robust than this Voronoi jigsaw attempt.

This version uses earcut and some artisanal TopoJSON to triangulate the polygon and successively merge the triangles into the desired number of pieces. Then it uses this method to add points and rewind polygon pairs for smoother transitions.

The biggest area for improvement would probably be a smarter strategy for merging the polygons that factors in the relative areas and positions of the destination shapes like the Voronoi version does, or something that avoids the merge step altogether by only keeping certain cuts during the initial triangulation.

See also: Jigsaw morphing, Smoother polygon transitions