Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1622 - trunk/Model/Groups


Chronological Thread 
  • From: thiago@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1622 - trunk/Model/Groups
  • Date: Thu, 9 Aug 2007 22:07:57 -0600 (MDT)

Author: thiago
Date: Thu Aug  9 22:07:56 2007
New Revision: 1622

Modified:
   trunk/Model/Groups/Mesh.cc
Log:
Mesh class now handles all types of triangle degeneracies (I
hope!). Used to handle only triangles collapsed to a point. Now also
handle triangles collapsed onto a line.

Modified: trunk/Model/Groups/Mesh.cc
==============================================================================
--- trunk/Model/Groups/Mesh.cc  (original)
+++ trunk/Model/Groups/Mesh.cc  Thu Aug  9 22:07:56 2007
@@ -255,8 +255,10 @@
     const Vector& a = vertices[index0];
     const Vector& b = vertices[index1];
     const Vector& c = vertices[index2];
-
-    if (a==b || a==c || b==c) {
+    
+    //degenerate if triangle is collapsed onto a line or point.
+    if ( Cross(a-b, c-b) == Vector::zero() ) {
+      
       //this triangle is degenerate. Let's remove it.
       vertex_indices[i+0] = vertex_indices[vertex_indices.size()-3];
       vertex_indices[i+1] = vertex_indices[vertex_indices.size()-2];




  • [MANTA] r1622 - trunk/Model/Groups, thiago, 08/10/2007

Archive powered by MHonArc 2.6.16.

Top of page