Creating a surface of triangles from a set of two-dimensional points

I have a set of points, and I need to convert the set to (non-overlapping) triangles (or a large polygon, if equivalent) ...

Application: I have a list of locations (latitude, longitude) from the country, and I need to find whether this point is inside the country or not ...

X         X                   *---------*                       *---------*
                              | \     / | \                     |           \
                              |   \ /   |   \                   |             \
     X         x      =>      |    *    |    *      = or =>     |              *
                              |   / \   |   /                   |             /
                              | /     \ | /                     |           /
X         X                   *---------*                       *---------*

Is there an easy way or do I need PhD to encode it?

Or with a huge training ground? I found http://en.wikipedia.org/wiki/Point_in_polygon

thanks JD

+3
source share
4 answers

In fact, it would be easier to calculate a finite polygon than to build a polygon from triangles.

, , . .

(a.k.a.: March Jarvis). , .

, triangulation, Delaunay.

+3

. :

  • (Google );

  • , ( )

  • , ( ), , , , ' t - ).

, PhD, , . . , , , .

+1
0

Here you can find a library called qhull ( http://www.qhull.org/ ) to do this. It is robust enough for use in Blender, OGRE3D and other applications that are seriously used, and has an API for more than just C / C ++. It can even be used on the command line with simple text data files for manual experimentation.

No need for PhD, just a license to install 8D

There are others, but mainly for researchers or for special applications.

0
source

Source: https://habr.com/ru/post/1723249/


All Articles