diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h index 0dcff62901b..41e4cf3d5df 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h @@ -177,7 +177,7 @@ struct Sizing_field_with_aabb_tree << ", index=#" << CGAL::IO::oformat(id) << "): "; } #endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY - double result = d_; + FT result = d_; if(dim == 0) { if(dt.dimension() < 1) { #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY @@ -218,7 +218,7 @@ struct Sizing_field_with_aabb_tree } const FT dist = CGAL_NTS sqrt(CGAL::squared_distance( nearest, p)); // std::cerr << (std::min)(dist / FT(1.5), d_) << "\n"; - result = (std::min)(dist / FT(2), result); + result = (std::min)(dist * FT(0.5), result); // now search in the AABB tree typename Corners_indices::const_iterator ids_it = corners_indices.find(p); @@ -240,10 +240,10 @@ struct Sizing_field_with_aabb_tree if(projection_traits.found()) { result = - (std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + (std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * CGAL_NTS sqrt(CGAL::squared_distance(p, - projection_traits.closest_point())), + projection_traits.closest_point()))), result); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY { @@ -312,10 +312,10 @@ struct Sizing_field_with_aabb_tree projection_traits.closest_point_and_primitive().second)) == 0); result = - (std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + (std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * CGAL_NTS sqrt(CGAL::squared_distance(p, - projection_traits.closest_point())), + projection_traits.closest_point()))), result); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY @@ -479,9 +479,9 @@ struct Sizing_field_with_aabb_tree std::cerr << " closest_point: " << closest_intersection << "\n" << " distance = " << CGAL_NTS sqrt(sqd_intersection) << std::endl; #endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY - double new_result = - (std::min)(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * - CGAL_NTS sqrt(sqd_intersection), + FT new_result = + (std::min)(FT(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + CGAL_NTS sqrt(sqd_intersection)), d_); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY