Ignore:
Timestamp:
Jul 7, 2009, 9:12:54 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
30212a8
Parents:
d98327
Message:

BUGFIX: Initial edge for starting triangle may be up to TWICE the sphere's radius

Find_second_point_for_tesselation() - now checks norm of vector against 2.*RADIUS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    rd98327 ra811a0  
    27082708            // check if we only have one unique point yet ...
    27092709            if (a != Candidate) {
    2710         // Calculate center of the circle with radius RADIUS through points a and Candidate
     2710              // Calculate center of the circle with radius RADIUS through points a and Candidate
    27112711              Vector OrthogonalizedOben, a_Candidate, Center;
    27122712              double distance, scaleFactor;
     
    27142714              OrthogonalizedOben.CopyVector(&Oben);
    27152715              a_Candidate.CopyVector(&(a->x));
    2716          a_Candidate.SubtractVector(&(Candidate->x));
    2717          OrthogonalizedOben.ProjectOntoPlane(&a_Candidate);
    2718          OrthogonalizedOben.Normalize();
    2719         distance = 0.5 * a_Candidate.Norm();
    2720         scaleFactor = sqrt(((RADIUS * RADIUS) - (distance * distance)));
    2721         OrthogonalizedOben.Scale(scaleFactor);
     2716              a_Candidate.SubtractVector(&(Candidate->x));
     2717              OrthogonalizedOben.ProjectOntoPlane(&a_Candidate);
     2718              OrthogonalizedOben.Normalize();
     2719              distance = 0.5 * a_Candidate.Norm();
     2720              scaleFactor = sqrt(((RADIUS * RADIUS) - (distance * distance)));
     2721              OrthogonalizedOben.Scale(scaleFactor);
    27222722
    27232723              Center.CopyVector(&(Candidate->x));
    2724         Center.AddVector(&(a->x));
    2725         Center.Scale(0.5);
    2726         Center.AddVector(&OrthogonalizedOben);
     2724              Center.AddVector(&(a->x));
     2725              Center.Scale(0.5);
     2726              Center.AddVector(&OrthogonalizedOben);
    27272727
    27282728              AngleCheck.CopyVector(&Center);
     
    27302730              norm = a_Candidate.Norm();
    27312731              // second point shall have smallest angle with respect to Oben vector
    2732               if (norm < RADIUS) {
     2732              if (norm < RADIUS*2.) {
    27332733                angle = AngleCheck.Angle(&Oben);
    27342734                if (angle < Storage[0]) {
     
    27492749          }
    27502750        } else {
    2751         cout << "Linked cell list is empty." << endl;
     2751          cout << "Linked cell list is empty." << endl;
    27522752        }
    27532753      }
Note: See TracChangeset for help on using the changeset viewer.