Loading...
Logo
Processing Forum
Is this code posted somewhere?  I'd like to hack it into a thread that gives me a progress bar, etc.

Thanks!

Alex

Replies(5)

As far as I know the triangulation code is in PGraphics3D, the source of which you can see here:
http://is.gd/M0UHr8

Around line 1575 you'll find the code you're looking for. However, you'll need to understand how it works to successfully extract it into standalone code. A class that would take an arbitrary array of PVector vertices and return a sorted polygon would certainly be useful, but you need to isolate the logic from the rest of PGraphics3D's internal functions.

The source code refers to this C++ code, that might be helpful as well:
http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
You should indicate which library you are talking about, exactly. "triangulation" is a very generic and quite common task...
This is the library that I was interested in hacking.  Works for me so far, but I'm processing large kinect datasets and it would be nice to integrate a little more custom....

http://wiki.processing.org/w/Triangulation
You should keep in mind that triangulation might work very differently for small data sets (i.e. simple polygons) and large data sets such as Kinect point clouds.

You might want to look into QHull http://www.qhull.org/, it's complicated but has features for convex hull and Delaunay triangulation. I seem to recall that someone did an experiment with integrating QHull and Processing, but can't find the link right now.