mirror of https://github.com/CGAL/cgal
Take care of collinear points when computing a facet normal
This commit is contained in:
parent
97f2ff7ef8
commit
6b1e578377
|
|
@ -16,7 +16,9 @@ typename Kernel::Vector_3 compute_facet_normal(const Facet& f)
|
|||
const Point& curr = he->vertex()->point();
|
||||
const Point& next = he->next()->vertex()->point();
|
||||
Vector n = CGAL::cross_product(next-curr,prev-curr);
|
||||
normal = normal + (n / std::sqrt(n*n));
|
||||
if((n*n) > 0.000000001){
|
||||
normal = normal + (n / std::sqrt(n*n));
|
||||
}
|
||||
}
|
||||
return normal / std::sqrt(normal * normal);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue