| 32 | namespace { |
| 33 | template <typename Facet> |
| 34 | CGAL::Direction_3<Kernel_> newell(Facet& face) { |
| 35 | typename Kernel_::FT a(0), b(0), c(0); |
| 36 | CGAL::Polyhedron_3<Kernel_>::Halfedge_around_facet_const_circulator current_halfedge = face.facet_begin(); |
| 37 | do { |
| 38 | auto& curr = current_halfedge->vertex()->point(); |
| 39 | auto& next = current_halfedge->next()->vertex()->point(); |
| 40 | a += (curr.y() - next.y()) * (curr.z() + next.z()); |
| 41 | b += (curr.z() - next.z()) * (curr.x() + next.x()); |
| 42 | c += (curr.x() - next.x()) * (curr.y() + next.y()); |
| 43 | } while (++current_halfedge != face.facet_begin()); |
| 44 | return CGAL::Direction_3<Kernel_>(a, b, c); |
| 45 | } |
| 46 | |
| 47 | struct Plane_equation { |
| 48 | template <typename Facet> |
no test coverage detected