Tuesday, August 3, 2021

Next step in making polygons...

I split the world rectangle into two better polar polygons. I still need to figure out further polygon subdivision, and then subdivide many times. The simplest approach is to take three consecutive points which define a triangle unless the points are all in a line, which is possible. If it is in line, then the triangle has zero area and I can detect and ignore it. Better, I can detect and remove or reposition the middle point! Furthermore, I can turn four consecutive points into a quad or triangle pair; I can turn any number of points into a triangle mesh inside of a polygon! 

After we create upper and lower polar polygons we can find several consecutive points, at least three, to start defining polygons. This is a loop with two legs, upper and lower, between the initial endpoints. In a triangle this third point gets between the endpoints on the bottom or lower leg, but for other polygons we want the upper leg to have all the points on or above a line between the endpoints and all the points in the lower leg lie below a line between the endpoints. Also, we need to go through the bottom leg backwards to build a list of polygon points. What do I need?

  1. Start with triangles, look for three consecutive points

  2. Check this triangle for area. If the area is very low, move that midpoint! 8-)

  3. Modify the northern and southern polygons as needed

  4. Eventually figure out how to build bigger polygons

No comments:

Post a Comment