PDA

View Full Version : Triangulation algorithm


Gernot
29th March 2004, 06:05 PM
Hi,

when you triangulate a surface (which is very kind, since you must not do this while editing) the triangles generated are sometimes not nice. It would be good if the program would check for each segment line, if 2 triangles share it that are on the same surface. If so, determine if changing their seperation line might give better angles. See this example:



.__--^--__
<--------->
.--__ __--
v


Better:

.__--|--__
< | >
.--__|__--


See? The shared segment gets swapped. The minimum angle gets a bit bigger.

LiveWire
29th March 2004, 11:24 PM
not a bad idea
my ac3d model loader only loads triangles(its just easyer to work with that way...and faster) so somthing like this would be nice.

philip

Andy
2nd April 2004, 12:23 AM
Since a triangle is always planar, it's difficult (impossible?) for AC3D to predict how you want to split a quad into triangles.

Triangulate , select both triangles and use Surface->flip-triangle-edge.

OR

Split your quad by selecting the two corner vertices and use Vertex->slice surface.

Andy

Gernot
2nd April 2004, 01:50 PM
Ah. You can split them manually. That's enough for the moment. It would be a nice idea if - after the automatic meshing - this would be done once. It's easy. Simply loop through all edges and see it 2 triangles are attached to it. Now see if the other tringle seperation would give 2 better triangles and if so, swap edges. A "good" triangle has all angles as close as possible to 60 degs.

I'm buying today, so I'll have a close look at the SDK and maybe do it myself.

-Gernot