diff --git a/Kinetic_shape_reconstruction/include/CGAL/KSR/utils.h b/Kinetic_shape_reconstruction/include/CGAL/KSR/utils.h index 09b24b5ba97..eb2584aad76 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/KSR/utils.h +++ b/Kinetic_shape_reconstruction/include/CGAL/KSR/utils.h @@ -115,26 +115,6 @@ inline const Vector_d normalize(const Vector_d& v) { return v / static_cast(CGAL::sqrt(CGAL::to_double(dot_product))); } -// Compute angle between two 3D vectors. -template -typename Kernel_traits::Kernel::FT -angle_3d(const Vector_3& v1, const Vector_3& v2) { - - using Traits = typename Kernel_traits::Kernel; - using FT = typename Traits::FT; - - const double a = CGAL::to_double(v1 * v2) / ( - CGAL::sqrt(CGAL::to_double(v1.squared_length())) * - CGAL::sqrt(CGAL::to_double(v2.squared_length())) ); - - if (a < -1.0) { - return static_cast(std::acos(-1.0) / CGAL_PI * 180.0); - } else if (a > 1.0) { - return static_cast(std::acos(+1.0) / CGAL_PI * 180.0); - } else { - return static_cast(std::acos( a) / CGAL_PI * 180.0); - } -} // Intersections. Used only in the 2D version. // For the 3D version, see conversions.h! diff --git a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Initializer.h b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Initializer.h index 9d112205956..b2841e2cdbb 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Initializer.h +++ b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Initializer.h @@ -16,6 +16,7 @@ // #include // CGAL includes. +#include #include #include #include diff --git a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Reconstruction.h b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Reconstruction.h index 3dd7c87d9cd..1eaf98ea668 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Reconstruction.h +++ b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Reconstruction.h @@ -742,7 +742,7 @@ private: CGAL_assertion(idx < m_input_range.size()); const auto& normal = get(m_normal_map_3, idx); - FT angle = KSR::angle_3d(normal, ref); + FT angle = approximate_angle(normal, ref); if (angle > FT(90)) angle = FT(180) - angle; angle = FT(90) - angle; if (angle <= max_accepted_angle) wall_points.push_back(idx); diff --git a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Support_plane.h b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Support_plane.h index 669f743bf30..12cc0a188ab 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Support_plane.h +++ b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Support_plane.h @@ -928,7 +928,7 @@ bool operator==(const Support_plane& a, const Support_plane& b) // } const FT vtol = FT(5); // degrees // TODO: We should put it as a parameter. - FT aval = KSR::angle_3d(va, vb); + FT aval = approximate_angle(va, vb); CGAL_assertion(aval >= FT(0) && aval <= FT(180)); if (aval >= FT(90)) aval = FT(180) - aval;