Advance copies of the iterator

This commit is contained in:
Andreas Fabri 2021-02-10 10:53:37 +00:00
parent e87432f257
commit 6335c1068c
1 changed files with 7 additions and 2 deletions

View File

@ -112,11 +112,13 @@ void normal_vector_newell_3( IC first, IC last, Vector& n )
// three.
{
CGAL_assertion( !CGAL::is_empty_range( first, last));
if(internal_nef::is_triangle_3(first)) {
n = orthogonal_vector(*first,*(++first),*(++first));
n = orthogonal_vector(*first,*(std::next(first)),*(std__next(first,2)));
return;
}
typedef typename Kernel_traits<Vector>::Kernel R;
// Compute facet normals via the Newell-method as described in
// Filippo Tampieri: Newell's Method for Computing the Plane
@ -140,11 +142,14 @@ template <class IC, class Vector, class VertexPointMap>
void normal_vector_newell_3( IC first, IC last, VertexPointMap vpm, Vector& n )
{
CGAL_assertion( !CGAL::is_empty_range( first, last));
if(internal_nef::is_triangle_3(first)) {
n = orthogonal_vector(get(vpm,*first),get(vpm,*(++first)),get(vpm,*(++first)));
n = orthogonal_vector(get(vpm,*first),get(vpm,*(std::next(first))),get(vpm,*(std::next(first,2))));
return;
}
typedef typename Kernel_traits<Vector>::Kernel R;
// Compute facet normals via the Newell-method as described in
// Filippo Tampieri: Newell's Method for Computing the Plane