Monday, August 2, 2021

More Polygon Subdivision

I wrote some code last night to create polygons. One was a triangle fan around a point and the other was basically another triangle fan around the north pole. What this tells me is that making that polygon on a world map is subdividing that world into two new polygons. I can dog-walk a line across my world rectangle from west to east to create two north and south polar polygons, like I ham-fistedly did with the second bit of code last night, or subdivide the second larger polygon from the first triangle fan into a second and third polygon. I could do a better world map with that line dog-walked truly chaotically from west to east to subdivide the world into two polar polygons and then push a loop dog-walked through either the north or south polar polygon, by doubling back over a section of the polygon border.

  1. Split the world rect with a line of points into two polygons.

  2. Split one of these with a loop of points doubling back adjacent to a bit of polygon border

  3. Rinse and repeat several times; each subdivision divides an existing polygon, adds one

No comments:

Post a Comment