[CSC 315] Strange Tesselation Error
Andrew J. Pounds
pounds_aj at mercer.edu
Thu Sep 29 19:03:08 EDT 2016
Some of you have noted that when you use the ear-clipping algorithm to
tesselate something like
unfilled
you actually end up with...
filled
This is happening because I may not have been clear on the check related
to "can I draw the line back to the initial vertex". I think in class
I may have made it too simple -- I stated that as long as the line did
not intersect any other lines in the polygon. In addition the line
connecting the point back to the vertex must lie in the INTERIOR of the
polygon.
There are multiple ways to check for this, but the easiest in my
opinion is to check the angle back to the original vertex and the angle
of the next vertex in the list. If the angle to the next vertex in the
list is less than the angle to the initial point, then you can't
tesselate that triangle and you have to move to the next one in the list.
Sit down with a piece of paper and play with it for a few minutes and it
should make sense. If not, see me.
--
Andrew J. Pounds, Ph.D. (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160929/a5ee4f3e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poly1.png
Type: image/png
Size: 8255 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160929/a5ee4f3e/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filled.png
Type: image/png
Size: 7465 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20160929/a5ee4f3e/attachment-0001.png>
More information about the csc315
mailing list