Return true if a given edge is convex and false otherwise
| 333 | |
| 334 | // Return true if a given edge is convex and false otherwise |
| 335 | bool QuickHull::testIsConvexEdge(const QHHalfEdgeStructure::Edge* edge, decimal epsilon) { |
| 336 | |
| 337 | // Get the two neighbor faces |
| 338 | assert(edge->twinEdge != nullptr); |
| 339 | QHHalfEdgeStructure::Face* face1 = edge->face; |
| 340 | QHHalfEdgeStructure::Face* face2 = edge->twinEdge->face; |
| 341 | |
| 342 | // We test if the center of face1 is below the face2 plane |
| 343 | if (computePointToPlaneDistance(face1->centroid, face2->normal, face2->centroid) >= -epsilon) return false; |
| 344 | |
| 345 | // We test if the center of face2 is below the face1 plane |
| 346 | if (computePointToPlaneDistance(face2->centroid, face1->normal, face1->centroid) >= -epsilon) return false; |
| 347 | |
| 348 | // If both tests are true, the edge is convex |
| 349 | return true; |
| 350 | } |
| 351 | |
| 352 | // Find the horizon (edges) forming the separation between the faces that are visible from the new vertex and the faces that are not visible |
| 353 | void QuickHull::findHorizon(const Vector3& vertex, QHHalfEdgeStructure::Face* face, |
nothing calls this directly
no test coverage detected