![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I've been working on closing spline shapes with triangles...
Post a reply to this message
Attachments:
Download 'test_angles.jpg' (74 KB)
Preview of image 'test_angles.jpg'
![test_angles.jpg](/povray.binaries.images/attachment/%3C44eda67a%40news.povray.org%3E/test_angles.jpg?ttop=443866&toff=4300&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi Tim!
> I've been working on closing spline shapes with triangles...
Looks good! What technique for triangulation do you use? I've been
experimenting with triangulation, too. You can find my results at
http://www.wikipov.org/ow.asp?PolyFunctions
Do you have any specific purpose in mind for your triangulation code?
Greetings,
Florian
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] comcast net> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |