From dd6cf454dc483cc7bd3f764f60182d0a112017b2 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 17 Jan 2020 09:58:44 +0100 Subject: [PATCH] add precision(17) to most examples involving surface_mesh or polyhedron. --- BGL/examples/BGL_LCC/copy_lcc.cpp | 1 + BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp | 2 ++ BGL/examples/BGL_surface_mesh/write_inp.cpp | 1 + .../examples/Polygon_mesh_processing/corefinement_LCC.cpp | 1 + .../examples/Polygon_mesh_processing/corefinement_SM.cpp | 1 + .../corefinement_consecutive_bool_op.cpp | 1 + .../corefinement_difference_remeshed.cpp | 2 ++ .../Polygon_mesh_processing/corefinement_mesh_union.cpp | 1 + .../corefinement_mesh_union_and_intersection.cpp | 2 ++ .../corefinement_mesh_union_with_attributes.cpp | 1 + .../Polygon_mesh_processing/corefinement_polyhedron_union.cpp | 1 + .../isotropic_remeshing_of_patch_example.cpp | 1 + .../examples/Polygon_mesh_processing/mesh_smoothing_example.cpp | 1 + .../Polygon_mesh_processing/orient_polygon_soup_example.cpp | 2 ++ .../Polygon_mesh_processing/random_perturbation_SM_example.cpp | 1 + .../examples/Polygon_mesh_processing/refine_fair_example.cpp | 2 ++ .../Polygon_mesh_processing/shape_smoothing_example.cpp | 1 + .../examples/Polygon_mesh_processing/stitch_borders_example.cpp | 1 + .../Polygon_mesh_processing/surface_mesh_intersection.cpp | 1 + .../Polygon_mesh_processing/triangulate_faces_example.cpp | 1 + Polyhedron/examples/Polyhedron/polyhedron_prog_cut_cube.cpp | 2 +- Polyhedron/examples/Polyhedron/polyhedron_prog_subdiv.cpp | 2 +- .../Polyhedron/polyhedron_prog_subdiv_with_boundary.cpp | 2 +- Surface_mesh/examples/Surface_mesh/sm_join.cpp | 2 +- Surface_mesh/test/Surface_mesh/sm_ply_io.cpp | 1 - 25 files changed, 29 insertions(+), 5 deletions(-) diff --git a/BGL/examples/BGL_LCC/copy_lcc.cpp b/BGL/examples/BGL_LCC/copy_lcc.cpp index d47c0216fbb..ecc43fefc59 100644 --- a/BGL/examples/BGL_LCC/copy_lcc.cpp +++ b/BGL/examples/BGL_LCC/copy_lcc.cpp @@ -55,6 +55,7 @@ int main(int argc, char* argv[]) CGAL::copy_face_graph(T1, S, CGAL::parameters::vertex_to_vertex_output_iterator(std::inserter(v2v, v2v.end())) .halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end()))); std::ofstream out("reverse.off"); + out.precision(17); out << S; } return 0; diff --git a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp index 76aa1235c54..3f9e7b76bef 100644 --- a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp +++ b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp @@ -43,6 +43,7 @@ int main(int argc, char* argv[]) { CGAL::copy_face_graph(S, T1); std::ofstream out("sm.off"); + out.precision(17); out << T1; } @@ -81,6 +82,7 @@ int main(int argc, char* argv[]) boost::unordered_map f2f; CGAL::copy_face_graph(T1, S, std::inserter(v2v, v2v.end()), std::inserter(h2h, h2h.end())); std::ofstream out("reverse.off"); + out.precision(17); out << S; CGAL::copy_face_graph(T1, S, CGAL::parameters::vertex_to_vertex_map(boost::make_assoc_property_map(v2v)) .halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())) diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index fce8f932b11..ba9e3545bb5 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -20,6 +20,7 @@ int main() CGAL::make_quad(Point(0,0,1), Point(1,0,1),Point(1,1,1),Point(0,1,1), sm); std::ofstream out("out.inp"); + out.precision(17); CGAL::write_inp(out, sm, "out.inp", "S4R"); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp index f7239c96f24..5abd976cb9a 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp @@ -34,6 +34,7 @@ int main(int argc, char* argv[]) << num_vertices(mesh2) << "\n"; std::ofstream output("mesh1_refined.off"); + output.precision(17); CGAL::write_off(output, mesh1); output.close(); output.open("mesh2_refined.off"); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp index 3eacde99ed9..77244f43fa6 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp @@ -41,6 +41,7 @@ int main(int argc, char* argv[]) << num_vertices(mesh2) << "\n"; std::ofstream output("mesh1_refined.off"); + output.precision(17); output << mesh1; output.close(); output.open("mesh2_refined.off"); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp index cf90534b84a..bbe55ca4cbc 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp @@ -136,6 +136,7 @@ int main(int argc, char* argv[]) { std::cout << "Intersection and union were successfully computed\n"; std::ofstream output("inter_union.off"); + output.precision(17); output << mesh2; return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp index 3a5068aa00b..f12868c033a 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp @@ -67,6 +67,7 @@ int main(int argc, char* argv[]) { std::cout << "Difference was successfully computed\n"; std::ofstream output("difference.off"); + output.precision(17); output << mesh1; } else{ @@ -111,6 +112,7 @@ int main(int argc, char* argv[]) params::edge_is_constrained_map(is_constrained_map) ); std::ofstream output("difference_remeshed.off"); + output.precision(17); output << mesh1; return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp index f03403dd58b..150a1db0782 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp @@ -37,6 +37,7 @@ int main(int argc, char* argv[]) { std::cout << "Union was successfully computed\n"; std::ofstream output("union.off"); + output.precision(17); output << out; return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp index 359dd989a2c..dda4e2f1f96 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp @@ -55,6 +55,7 @@ int main(int argc, char* argv[]) { std::cout << "Union was successfully computed\n"; std::ofstream output("union.off"); + output.precision(17); output << out_union; } else @@ -64,6 +65,7 @@ int main(int argc, char* argv[]) { std::cout << "Intersection was successfully computed\n"; std::ofstream output("intersection.off"); + output.precision(17); output << out_intersection; } else diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp index 142902bf63a..05e5d219ba9 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp @@ -94,6 +94,7 @@ int main(int argc, char* argv[]) { std::cout << "Union was successfully computed\n"; std::ofstream output("union.off"); + output.precision(17); output << out; return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp index c6080f57f03..96d76e874a6 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp @@ -39,6 +39,7 @@ int main(int argc, char* argv[]) { std::cout << "Union was successfully computed\n"; std::ofstream output("union.off"); + output.precision(17); output << out; return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp index 52ce2fae96f..504dd5745f6 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp @@ -74,6 +74,7 @@ int main(int argc, char* argv[]) ); std::ofstream out("out.off"); + out.precision(17); out << mesh; std::cout << "Remeshing done." << std::endl; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp index 6a1d5c2199a..ac081ec84ef 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp @@ -48,6 +48,7 @@ int main(int argc, char** argv) .edge_is_constrained_map(eif)); std::ofstream output("mesh_smoothed.off"); + output.precision(17); output << mesh; std::cout << "Done!" << std::endl; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp index 3c073c82c8b..2eec424e91c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp @@ -44,11 +44,13 @@ int main(int argc, char* argv[]) CGAL::Polygon_mesh_processing::orient_to_bound_a_volume(mesh); std::ofstream out("tet-oriented1.off"); + out.precision(17); out << mesh; out.close(); CGAL::Polygon_mesh_processing::reverse_face_orientations(mesh); std::ofstream out2("tet-oriented2.off"); + out2.precision(17); out2 << mesh; out2.close(); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp index 8d4d69dbe98..e040195334f 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp @@ -33,6 +33,7 @@ int main(int argc, char* argv[]) PMP::parameters::vertex_point_map(mesh.points()).geom_traits(K())); std::ofstream out("data/eight_perturbed.off"); + out.precision(17); out << mesh; out.close(); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp index 253e76bb122..23b9af70099 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp @@ -62,6 +62,7 @@ int main(int argc, char* argv[]) CGAL::Polygon_mesh_processing::parameters::density_control_factor(2.)); std::ofstream refined_off("refined.off"); + refined_off.precision(17); refined_off << poly; refined_off.close(); std::cout << "Refinement added " << new_vertices.size() << " vertices." << std::endl; @@ -75,6 +76,7 @@ int main(int argc, char* argv[]) std::cout << "Fairing : " << (success ? "succeeded" : "failed") << std::endl; std::ofstream faired_off("faired.off"); + faired_off.precision(17); faired_off << poly; faired_off.close(); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp index fe6501c877e..6d5e7f75bd5 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp @@ -41,6 +41,7 @@ int main(int argc, char* argv[]) .vertex_is_constrained_map(vcmap)); std::ofstream output("mesh_shape_smoothed.off"); + output.precision(17); output << mesh; std::cout << "Done!" << std::endl; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp index 89ff02c4405..bd364a60773 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp @@ -34,6 +34,7 @@ int main(int argc, char* argv[]) std::cout << "\t Number of facets :\t" << mesh.size_of_facets() << std::endl; std::ofstream output("mesh_stitched.off"); + output.precision(17); output << std::setprecision(17) << mesh; return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp index d519723fd02..20ccbf2da0f 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp @@ -43,6 +43,7 @@ int main(int argc, char* argv[]) //dump polylines std::ofstream output("intersection_polylines.cgal"); + output.precision(17); for(const std::vector& polyline : polylines) { output << polyline.size() << " "; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp index 94d1a0f8aff..63528119d44 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp @@ -32,6 +32,7 @@ int main(int argc, char* argv[]) std::cerr << "Error: non-triangular face left in mesh." << std::endl; std::ofstream cube_off(outfilename); + cube_off.precision(17); cube_off << mesh; return 0; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_cut_cube.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_cut_cube.cpp index c244c1c1c74..04ba2ad4f51 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_cut_cube.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_cut_cube.cpp @@ -66,6 +66,6 @@ int main() { Point( 0.0, 0.0, 1.5), Point( 0.0, 0.5, 0.0)); CGAL::polyhedron_cut_plane_3( P, h, pl); - std::cout << P; + std::cout <