|
![](/i/fill.gif) |
Nieminen Juha wrote:
>
> Mark Gordon <mtg### [at] mailbag com> wrote:
> : If the polygons are not convex, recursively lop off pointy bits as
> : triangles until they are.
>
> If you take any three points of the polygon, how can you be sure that
> the triangle defined by them is completely inside the polygon?
I made implicit reference to a "pointy bit test" ... yeah, that's right.
;-)
Assume the polygon is defined as a sequence of points on its periphery.
A triplet of points on the edge of the polygon forms a "pointy bit" (my
jargon) if the interior angle formed at the second point (as measured in
the plane defined by the three points) is less than 180 degrees. If the
interior angle formed at the second point is greater than 180 degrees
it's an, um, "anti-pointy bit". :-) If it's exactly 180, you may as
well remove the middle point as redundant.
Conversion to radians is left as an exercise for the reader. ;-)
Pardon me for being a bit punchy - didn't get much sleep.
--
Mark Gordon
mtg### [at] povray org
Post a reply to this message
|
![](/i/fill.gif) |