POV-Ray : Newsgroups : povray.binaries.images : Polygon Triangulation : Re: Polygon Triangulation Server Time
5 Nov 2024 14:24:28 EST (-0500)
  Re: Polygon Triangulation  
From: Charles C
Date: 27 Aug 2006 21:25:00
Message: <web.44f24539c8a93aabc667cf480@news.povray.org>
Nice work. It looks like you're doing the right way what I took the cheap
way out on...   I borrowed the 3rd dimension to make "cone-ish" end caps,
and just threw the extra baggage where it didn't matter.  That wouldn't
work so well if it were out in the open.... See:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.44da3528986df5f73869c6770%40news.povray.org%3E/

Charles

"Tim Attwood" <tim### [at] comcastnet> wrote:
> > Looks good! What technique for triangulation do you use? I've been
> > experimenting with triangulation, too.
>
> The polygon is evaluated from a spline, after checking that the shape
> is closed, it checks if the shape is defined clockwise or
> counter-clockwise by finding the left-most point (at least one) and
> figuring the angles. If it's counter-clockwise it reverses the array of
> points.
>
> Method 1, for the polygon on the right, doesn't create any inside
> points, but finds the inside angle nearest to 60 degrees, then tests
> for a point inside the triangle, and removes the ear. Rinse-repeat.
>
> Method 2, for the polygon on the left does the same thing, but if
> the ratio of the longest side to the shortest side of the ear was below
> a number (4 in the image) then it created two triangles, split at the
> midpoint, and moved the "current" point (in a "last--current--next"
> triangle)
> to the midpoint of "last--next".
>
> >You can find my results at
> > http://www.wikipov.org/ow.asp?PolyFunctions
>
> Cool, I'll have to look thru polyfunctions!
>
> > Do you have any specific purpose in mind for your triangulation code?
>
> I was just going to close an end cap on an extruded spline mesh, but
> became interested in the math involved while reading Wikipedia.
>
> At first I had a macro similar to Side_Of_Line, but abandoned it in favor
> of the inside angle, if the angle is greater or equal to 180 it's convex...
>
> Sometimes VAngleD is warning about acos ranges, and sometimes the
> return from the sort was degenerates.
>
> I used Heron's formula for the area of a triangle to test for degenerates,
> it might be finding very small triangles too, which is fine by me, since
> it seems bad to have triangles too small. Normalizing the vectors is
> a neat trick though.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.