Cutting polygons by a grid.

Started by
0 comments, last by eppo 9 years, 3 months ago

I'm trying to cut polygons into smaller polygons constrained by a grid. I'm wondering if there's a fast way to do this other than normal poly-poly clipping because I'm dealing with a large amount of points on a comsumer's computer (via javascript).

The application is that I want to cut country boundries by longitude and latitude lines before tessellating them so they don't get clipped by the sphere that they will be matted on. If I don't do this then large triangles will go inside the sphere.

Advertisement

Simplest alternative to clipping would be to generate a triangulated volume of the boundary (if you don't already have a volumetric representation) using something like poly2tri. Then subdivide the mesh until all its edge lengths are below a certain threshold (to prevent too much distortion when you map its vertices to a sphere). If the map itself is triangulated you don't have to draw the sphere underneath it, avoiding possible intersection/z-fighting issues.

This topic is closed to new replies.

Advertisement