Changeset 447896 for molecuilder/src


Ignore:
Timestamp:
Apr 22, 2010, 2:13:32 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
424d3fe
Parents:
fda112
Message:

BUGFIX of Tesselation::AddTesselationLine() - comparing Vector against Vector is numerically unstable.

  • Instead of checking the Vector of both Centers by operator==, we use DistanceSquared().
  • This fixes a bug in tesselating bpti with radius 1.5, where three lines remained open due to not being correctly associated with their degenerated other sides.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.cpp

    rfda112 r447896  
    18001800        // get open line
    18011801        for (TesselPointList::const_iterator CandidateChecker = Finder->second->pointlist.begin(); CandidateChecker != Finder->second->pointlist.end(); ++CandidateChecker) {
    1802           if ((*(CandidateChecker) == candidate->node) && (OptCenter == NULL || *OptCenter == Finder->second->OptCenter)) { // stop searching if candidate matches
     1802          if ((*(CandidateChecker) == candidate->node) && (OptCenter == NULL || OptCenter->DistanceSquared(&Finder->second->OptCenter) < MYEPSILON )) { // stop searching if candidate matches
     1803            DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Candidate " << *(*CandidateChecker) << " has the right center " << Finder->second->OptCenter << "." << endl);
    18031804            insertNewLine = false;
    18041805            WinningLine = FindLine->second;
    18051806            break;
     1807          } else {
     1808            DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *(*CandidateChecker) << "'s center " << Finder->second->OptCenter << " does not match desired on " << *OptCenter << "." << endl);
    18061809          }
    18071810        }
Note: See TracChangeset for help on using the changeset viewer.