Note: the /x/ series of posts on my site are mostly unpolished mini posts. This is a test of the code I wrote for the previous blog post, about polygon meshes.
For one project we wanted to be able to hand draw a map and then add procedurally generated features. Here’s an image drawn in a paint program (try dragging your own image here):
![](../1721-read-painted-map/map-parsed.png?2017-06-07-21-15-11)
to a polygon map:
or a more detailed polygon map:
Note that rivers don’t work well with this approach. They end up as polygons (and have gaps sometimes) instead of vectors. I plan to handle rivers with something else.
Also see Sylvain Lesage’s Color by Number[1] if you want to do this for artistic reasons.