48 |
|
#define polyFree free |
49 |
|
|
50 |
|
/* callback for output triangle */ |
51 |
< |
typedef void tri_out_t(const Vert2_list *tp, int a, int b, int c); |
51 |
> |
typedef int tri_out_t(const Vert2_list *tp, int a, int b, int c); |
52 |
|
|
53 |
< |
/* triangulate a contour/polygon, places results in STL vector |
54 |
< |
* as series of triangles. */ |
53 |
> |
/* triangulate a polygon, send results to the given callback function */ |
54 |
|
extern int polyTriangulate(const Vert2_list *contour, tri_out_t *cb); |
55 |
|
|
56 |
|
/* compute area of a contour/polygon */ |
57 |
|
extern double polyArea(const Vert2_list *contour); |
58 |
|
|
59 |
< |
/* decide if point Px/Py is inside triangle defined by |
61 |
< |
* (Ax,Ay) (Bx,By) (Cx,Cy) */ |
59 |
> |
/* decide if point P is inside triangle defined by ABC */ |
60 |
|
extern int insideTriangle(double Ax, double Ay, |
61 |
|
double Bx, double By, |
62 |
|
double Cx, double Cy, |