Changeset 91b1e79 for molecuilder/src/tesselation.cpp
- Timestamp:
- Jan 11, 2010, 9:16:36 AM (16 years ago)
- Children:
- afa056
- Parents:
- d403a1
- git-author:
- Frederik Heber <heber@…> (01/11/10 09:13:49)
- git-committer:
- Frederik Heber <heber@…> (01/11/10 09:16:36)
- File:
-
- 1 edited
-
molecuilder/src/tesselation.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselation.cpp
rd403a1 r91b1e79 402 402 bool BoundaryTriangleSet::GetIntersectionInsideTriangle(Vector *MolCenter, Vector *x, Vector *Intersection) 403 403 { 404 Info FunctionInfo(__func__);404 Info FunctionInfo(__func__); 405 405 Vector CrossPoint; 406 406 Vector helper; … … 415 415 Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl; 416 416 417 if (Intersection->DistanceSquared(endpoints[0]->node->node) < MYEPSILON) { 418 Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl; 419 return true; 420 } else if (Intersection->DistanceSquared(endpoints[1]->node->node) < MYEPSILON) { 421 Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl; 422 return true; 423 } else if (Intersection->DistanceSquared(endpoints[2]->node->node) < MYEPSILON) { 424 Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl; 425 return true; 426 } 417 427 // Calculate cross point between one baseline and the line from the third endpoint to intersection 418 428 int i=0; 419 429 do { 420 430 if (CrossPoint.GetIntersectionOfTwoLinesOnPlane(endpoints[i%3]->node->node, endpoints[(i+1)%3]->node->node, endpoints[(i+2)%3]->node->node, Intersection, &NormalVector)) { 431 helper.CopyVector(endpoints[(i+1)%3]->node->node); 432 helper.SubtractVector(endpoints[i%3]->node->node); 421 433 CrossPoint.SubtractVector(endpoints[i%3]->node->node); // cross point was returned as absolute vector 434 const double s = CrossPoint.ScalarProduct(&helper)/helper.NormSquared(); 435 Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl; 436 if ((s < -MYEPSILON) || ((s-1.) > MYEPSILON)) { 437 Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl; 438 i=4; 439 break; 440 } 422 441 i++; 423 442 } else
Note:
See TracChangeset
for help on using the changeset viewer.
