Ignore:
Timestamp:
Nov 28, 2009, 3:07:42 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
1db34af
Parents:
f7490d
git-author:
Frederik Heber <heber@…> (11/28/09 14:58:40)
git-committer:
Frederik Heber <heber@…> (11/28/09 15:07:42)
Message:

Correction of degenerated polygons is working.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselationhelpers.cpp

    rf7490d r2dff2d  
    956956  }
    957957
     958  Log() << Verbose(0) << "Polygon is " << *P << endl;
    958959  // create each pair, get the endpoints and check whether *P is contained.
    959960  int counter = 0;
     
    969970        for (int i=0;i<3;i++)
    970971          PairTrianglenodes.endpoints.insert((*PairWalker)->endpoints[i]);
    971         Log() << Verbose(1) << "Current pair of triangles: " << PairTrianglenodes << "." << endl;
    972         // now check
    973         if (PairTrianglenodes.ContainsPresentTupel(P)) {
    974           counter++;
    975           Log() << Verbose(1) << "Matches with " << *P << endl;
     972        const int size = PairTrianglenodes.endpoints.size();
     973        if (size == 4) {
     974          Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl;
     975          // now check
     976          if (PairTrianglenodes.ContainsPresentTupel(P)) {
     977            counter++;
     978            Log() << Verbose(0) << "  ACCEPT: Matches with " << *P << endl;
     979          } else {
     980            Log() << Verbose(0) << "  REJECT: No match with " << *P << endl;
     981          }
    976982        } else {
    977           Log() << Verbose(1) << "No match with " << *P << endl;
     983          Log() << Verbose(0) << "  REJECT: Less than four endpoints." << endl;
    978984        }
    979985      }
    980986    }
    981     PairTrianglenodes.endpoints.clear();
     987    Trianglenodes.clear();
    982988  }
    983989  return counter;
     
    10101016{
    10111017  Info FunctionInfo(__func__);
    1012   for(PointSet::iterator Runner = P1->endpoints.begin(); Runner != P1->endpoints.end(); Runner++) {
    1013     P1->endpoints.insert((*Runner));
     1018  pair <PointSet::iterator, bool> Tester;
     1019  for(PointSet::iterator Runner = P2->endpoints.begin(); Runner != P2->endpoints.end(); Runner++) {
     1020    Tester = P1->endpoints.insert((*Runner));
     1021    if (Tester.second)
     1022      Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl;
    10141023  }
    10151024  P2->endpoints.clear();
Note: See TracChangeset for help on using the changeset viewer.