ofxTriangle icon indicating copy to clipboard operation
ofxTriangle copied to clipboard

Orig triangle

Open ofZach opened this issue 12 years ago • 1 comments

ok this is more of a provocation then PR, but if ofxTriangle uses triangle++, it's using a heavily modified version of triangle the doesn't really allow for adding of steiner points, or any of the great features in triangle for producing good meshes.

for example, you can set angle constraints, etc to wind up with triangles like this:

http://i.imgur.com/ivUm4.png

where triangle has added the inner points. there's alot of info here:

https://www.cs.cmu.edu/~quake/triangle.switch.html

I'm working on a tool that requires a really good mesh:

https://github.com/ofZach/puppetWork

so I'm thinking to push this a bit further....

Anyway, I feel like ofxTriangle could easily be rewritten to use the orig triangle as I've done here and add some functionality for prohibiting steiner points ( output number of points = input number of points) and / or setting angle / area constraints. Triangle++ is pretty limited, and as I started to hack at it, it's also using a really heavily modified triangle code (with all kinds of oddities, like namespaces thrown in, etc), so it's cleaner to use the original triangle version.

ofZach avatar Nov 21 '12 10:11 ofZach

ps: added some updates now, so that there some info about the points in the new mesh, as well as indices stored in the triangles and I've added an ofMesh output, which is useful too.... all of this needs testing and some discussion.

here's a simple test of a shape from triangulation into ofxPuppet, this is going to be fun :)

http://i.imgur.com/OY92I.png

ofZach avatar Nov 21 '12 12:11 ofZach