Changes in src/boundary.cpp [8f215d:b32dbb]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/boundary.cpp ¶
r8f215d rb32dbb 620 620 for (TriangleMap::iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) 621 621 { // go through every triangle, calculate volume of its pyramid with CoG as peak 622 x = runner->second->getEndpoint(0) - runner->second->getEndpoint(1);623 y = runner->second->getEndpoint(0) - runner->second->getEndpoint(2);624 const double a = x.Norm();625 const double b = y.Norm();626 const double c = runner->second->getEndpoint(2).distance(runner->second->getEndpoint(1));622 x = (*runner->second->endpoints[0]->node->node) - (*runner->second->endpoints[1]->node->node); 623 y = (*runner->second->endpoints[0]->node->node) - (*runner->second->endpoints[2]->node->node); 624 const double a = sqrt(runner->second->endpoints[0]->node->node->DistanceSquared(*runner->second->endpoints[1]->node->node)); 625 const double b = sqrt(runner->second->endpoints[0]->node->node->DistanceSquared(*runner->second->endpoints[2]->node->node)); 626 const double c = sqrt(runner->second->endpoints[2]->node->node->DistanceSquared(*runner->second->endpoints[1]->node->node)); 627 627 const double G = sqrt(((a + b + c) * (a + b + c) - 2 * (a * a + b * b + c * c)) / 16.); // area of tesselated triangle 628 x = runner->second->getPlane().getNormal(); 629 x.Scale(runner->second->getEndpoint(1).ScalarProduct(x)); 628 x = Plane(*(runner->second->endpoints[0]->node->node), 629 *(runner->second->endpoints[1]->node->node), 630 *(runner->second->endpoints[2]->node->node)).getNormal(); 631 x.Scale(runner->second->endpoints[1]->node->node->ScalarProduct(x)); 630 632 const double h = x.Norm(); // distance of CoG to triangle 631 633 const double PyramidVolume = (1. / 3.) * G * h; // this formula holds for _all_ pyramids (independent of n-edge base or (not) centered peak) … … 1039 1041 // // Purges surplus triangles. 1040 1042 // TesselStruct->RemoveDegeneratedTriangles(); 1041 1042 // check envelope for consistency1043 status = CheckListOfBaselines(TesselStruct);1043 // 1044 // // check envelope for consistency 1045 // status = CheckListOfBaselines(TesselStruct); 1044 1046 1045 1047 // store before correction
Note:
See TracChangeset
for help on using the changeset viewer.