@@ -328,46 +328,4 @@ namespace diffCheck::segmentation
328328 }
329329 };
330330
331- // bool DFSegmentation::IsPointOnFace(
332- // std::shared_ptr<diffCheck::geometry::DFMesh> face,
333- // Eigen::Vector3d point,
334- // double associationThreshold)
335- // {
336- // /*
337- // To check if the point is in the face, we take into account all the triangles forming the face.
338- // We calculate the area of each triangle, then check if the sum of the areas of the tree triangles
339- // formed by two of the points of the referencr triangle and our point is equal to the reference triangle area
340- // (within a user-defined margin). If it is the case, the triangle is in the face.
341- // */
342- // std::vector<Eigen::Vector3i> faceTriangles = face->Faces;
343- // for (Eigen::Vector3i triangle : faceTriangles)
344- // {
345- // Eigen::Vector3d v0 = face->Vertices[triangle[0]];
346- // Eigen::Vector3d v1 = face->Vertices[triangle[1]];
347- // Eigen::Vector3d v2 = face->Vertices[triangle[2]];
348- // Eigen::Vector3d n = (v1 - v0).cross(v2 - v0);
349- // double normOfNormal = n.norm();
350- // n.normalize();
351-
352- // Eigen::Vector3d projectedPoint = point - n * (n.dot(point - v0)) ;
353-
354- // double referenceTriangleArea = normOfNormal*0.5;
355- // Eigen::Vector3d n1 = (v1 - v0).cross(projectedPoint - v0);
356- // double area1 = n1.norm()*0.5;
357- // Eigen::Vector3d n2 = (v2 - v1).cross(projectedPoint - v1);
358- // double area2 = n2.norm()*0.5;
359- // Eigen::Vector3d n3 = (v0 - v2).cross(projectedPoint - v2);
360- // double area3 = n3.norm()*0.5;
361- // double res = (area1 + area2 + area3 - referenceTriangleArea) / referenceTriangleArea;
362-
363- // // arbitrary value to avoid false positives (points that, when projected on the triangle, are in it, but that are actually located too far from the mesh to actually belong to it)
364- // double maxProjectionDistance = std::min({(v1 - v0).norm(), (v2 - v1).norm(), (v0 - v2).norm()});
365-
366- // if (std::abs(res) < associationThreshold && (projectedPoint - point).norm() < maxProjectionDistance)
367- // {
368- // return true;
369- // }
370- // }
371- // return false;
372- // }
373331} // namespace diffCheck::segmentation
0 commit comments