Skip to main content
added URLs into main answer.
Source Link

I have actually implemented it myself with a simple scanline algorithm. It doesnt grant the best results, but its good enough for me. From what I remember:

  1. You just have to sort your vertices along the X.

  2. Create column spans with the ordered vertices (thus, making it monotone polygons).

  3. And finally, find the diagonals lines connecting the vertices along the spans.

Is it clear?

EDIT: I don't know if amPlease dont mind the mess: http://code.google.com/p/bzk3/source/browse/#svn%2Ftrunk%2Fsource%2Fcommon%2Fsrc%2Fbr%2Fodb%2Flibsvg (look for it at svn/trunk/source/common/src/br/odb/libsvg/)

In fact, I allowedused to postprovide a link to my open source implementation of thisstandalone runnable jar just for that. More details at: https://sites.google.com/site/montysprojects/current-projects/svgtriangulator

I have actually implemented it myself with a simple scanline algorithm. It doesnt grant the best results, but its good enough for me. From what I remember:

  1. You just have to sort your vertices along the X.

  2. Create column spans with the ordered vertices (thus, making it monotone polygons).

  3. And finally, find the diagonals lines connecting the vertices along the spans.

Is it clear? I don't know if am I allowed to post a link to my open source implementation of this.

I have actually implemented it myself with a simple scanline algorithm. It doesnt grant the best results, but its good enough for me. From what I remember:

  1. You just have to sort your vertices along the X.

  2. Create column spans with the ordered vertices (thus, making it monotone polygons).

  3. And finally, find the diagonals lines connecting the vertices along the spans.

Is it clear?

EDIT: Please dont mind the mess: http://code.google.com/p/bzk3/source/browse/#svn%2Ftrunk%2Fsource%2Fcommon%2Fsrc%2Fbr%2Fodb%2Flibsvg (look for it at svn/trunk/source/common/src/br/odb/libsvg/)

In fact, I used to provide a standalone runnable jar just for that. More details at: https://sites.google.com/site/montysprojects/current-projects/svgtriangulator

Source Link

I have actually implemented it myself with a simple scanline algorithm. It doesnt grant the best results, but its good enough for me. From what I remember:

  1. You just have to sort your vertices along the X.

  2. Create column spans with the ordered vertices (thus, making it monotone polygons).

  3. And finally, find the diagonals lines connecting the vertices along the spans.

Is it clear? I don't know if am I allowed to post a link to my open source implementation of this.