Changeset af20f3 for molecuilder/src


Ignore:
Timestamp:
Apr 22, 2010, 8:09:48 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
d2390d
Parents:
f07455
Message:

BUGFIX in Tesselation::FindThirdPointForTesselation() - ThirdPoint of the base triangle must never have the smaller angle, but must always be the backside (i.e. the other center).

  • this fixes a bug with CNTorus (16,0) with (56,1) (l,r) working and (57,1) not, due to angle suddenly being 0 for the same as the base triangle.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.cpp

    rf07455 raf20f3  
    32783278                        alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
    32793279                        Otheralpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, OtherNewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
    3280                         alpha = min(alpha, Otheralpha);
     3280                        if ((ThirdPoint != NULL) && (Candidate == ThirdPoint->node)) { // in that case only the other circlecenter is valid
     3281                          if (OldSphereCenter.DistanceSquared(&NewSphereCenter) < OldSphereCenter.DistanceSquared(&OtherNewSphereCenter))
     3282                            alpha = Otheralpha;
     3283                        } else
     3284                          alpha = min(alpha, Otheralpha);
    32813285
    32823286                        // if there is a better candidate, drop the current list and add the new candidate
Note: See TracChangeset for help on using the changeset viewer.