On Jul 6, 2012, at 11:01 PM, crdueck wrote: > I've begun working on an analysis function for the sketch primitive. To > compute its area, Sean suggested creating a tesselation. Could someone > describe the method for doing this? My first take at it would be to > choose one vertice and draw a line from each other vertice to it to > create a "fan" of triangles, but this wouldnt account for the circular > arcs or bezier segments that can be part of a sketch. hopefully someone > can point me in the right direction :)
A few methods come to mind, but you might want to start with some variation of this method: http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html It's not an exact fit, but underlying method is promising even if you have to expand it a bit to support curves and arcs. If that's a no-go, a classical method would be Bloomenthal polygonalization: http://www.gelinlik2013.net/pdf/implicit/1.pdf There you'd subdivide and carve up arcs/circles/bezier until they're piecewise "flat" and count up your areas. Technically an approximation, but it's a method whose quality can be readily bounded. Alternatively, you subdivide until you've bounded a piece of the curve on only one side and calculate the exact area under/over the curve. Cheers! Sean ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel