Looking for some library for triangulating polyine / path

Hello,

Anyone knows if there is any library for triangulating polyline / path with some thickness?
Something like that:

I know algorithm for it is not complicated and i will be able to code it, but first i would like to know
if there is anything already available.

Thanks!

For any non-intersecting polygon, you can make it into triangles by considering the first vertex to be the common vertex of all triangles. Then iterate on the remaining vertices (from 1 to n - 2) and get (s, i, i + 1) into a new triangle. This is the simplest algorithm and should always work.

Btw why you need a library when this is just one simple function?

I’m not sure if i understand you correctly, but i don’t want to triangulate polygon. I want to make make polygon / triangles from path giving it some thickness.

For example something like that (from 3 points on path):
http://labs.hyperandroid.com/wp-content/uploads/2015/03/basic-tessellation-3.png

In result you’re getting 5 triangles.

Hi,
What you’re trying to do is called buffering.
Look up JTS Java topology suite. It does it very well.


Cheers,
Keith

EDIT: Lookup the buffer method here: