diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h index 73c1c82bd3d..e0a3e555f7c 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h @@ -638,7 +638,9 @@ namespace CGAL { FT get_x(const Point_3& p) const { return m_traits.compute_x_3_object()(p); } FT get_y(const Point_3& p) const { return m_traits.compute_y_3_object()(p); } FT get_z(const Point_3& p) const { return m_traits.compute_z_3_object()(p); } - + + Vector_3 constr_vec() const + { return m_traits.construct_vector_3_object()(NULL_VECTOR); } Vector_3 constr_vec(const Point_3& p, const Point_3& q) const { return m_traits.construct_vector_3_object()(p, q); } diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Sphere.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Sphere.h index 142b9d2c6a3..dd89eb83ab4 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Sphere.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Sphere.h @@ -286,7 +286,7 @@ namespace CGAL { FT &cluster_epsilon, FT min[2], FT max[2]) const { - Vector_3 axis; + Vector_3 axis = this->constr_vec(); FT rad = radius(); // Take average normal as axis for (std::size_t i = 0;iscalar_pdct(vec, d2), this->scalar_pdct(vec, d1)); FT x = FT(0), y = FT(0); concentric_mapping(phi, proj, rad, x, y); + CGAL_assertion( x==x && y==y); // check not nan's min[0] = max[0] = x; min[1] = max[1] = y; @@ -334,6 +335,7 @@ namespace CGAL { phi = atan2(this->scalar_pdct(vec, d2), this->scalar_pdct(vec, d1)); concentric_mapping(phi, proj, rad, x, y); + CGAL_assertion( x==x && y==y); // check not nan's min[0] = (std::min)(min[0], x); max[0] = (std::max)(max[0], x);