diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 7d43dbf4c2d..1182470f801 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -2650,7 +2650,7 @@ namespace CommonKernelFunctors { { CGAL_kernel_precondition(! K().collinear_3_object()(p,q,r) ); Vector_3 res = CGAL::cross_product(q-p, r-p); - res = res / CGAL::approximate_sqrt(res.squared_length()); + res = res / sqrt(res.squared_length()); return res; } }; diff --git a/Stream_support/include/CGAL/IO/GOCAD.h b/Stream_support/include/CGAL/IO/GOCAD.h index 07b4b6dec07..c2e0844d6b1 100644 --- a/Stream_support/include/CGAL/IO/GOCAD.h +++ b/Stream_support/include/CGAL/IO/GOCAD.h @@ -331,6 +331,13 @@ bool write_GOCAD(std::ostream& os, * \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin + * \cgalParamNBegin{point_map} + * \cgalParamDescription{a property map associating points with floating point coordinates to the elements of the point set `points`} + * \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + * of the iterator of `PointRange` and value type is a point type with floating point coordinates} + * \cgalParamDefault{`CGAL::Identity_property_map`} + * \cgalParamNEnd + * * \cgalParamNBegin{stream_precision} * \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} * \cgalParamType{int} diff --git a/Stream_support/include/CGAL/IO/OBJ.h b/Stream_support/include/CGAL/IO/OBJ.h index a856c4e6cbf..f00381a8333 100644 --- a/Stream_support/include/CGAL/IO/OBJ.h +++ b/Stream_support/include/CGAL/IO/OBJ.h @@ -314,6 +314,13 @@ bool read_OBJ(const std::string& fname, * \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin + * \cgalParamNBegin{point_map} + * \cgalParamDescription{a property map associating points with floating point coordinates to the elements of the point set `points`} + * \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + * of the iterator of `PointRange` and value type is a point type with floating point coordinates} + * \cgalParamDefault{`CGAL::Identity_property_map`} + * \cgalParamNEnd + * * \cgalParamNBegin{stream_precision} * \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} * \cgalParamType{int} diff --git a/Stream_support/include/CGAL/IO/OFF.h b/Stream_support/include/CGAL/IO/OFF.h index ff17f202bba..dc11fb82e31 100644 --- a/Stream_support/include/CGAL/IO/OFF.h +++ b/Stream_support/include/CGAL/IO/OFF.h @@ -267,6 +267,13 @@ bool read_OFF(const std::string& fname, * \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin + * \cgalParamNBegin{point_map} + * \cgalParamDescription{a property map associating points with floating point coordinates to the elements of the point set `points`} + * \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + * of the iterator of `PointRange` and value type is a point type with floating point coordinates} + * \cgalParamDefault{`CGAL::Identity_property_map`} + * \cgalParamNEnd + * * \cgalParamNBegin{stream_precision} * \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} * \cgalParamType{int} @@ -308,6 +315,13 @@ bool write_OFF(std::ostream& os, * \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin + * \cgalParamNBegin{point_map} + * \cgalParamDescription{a property map associating points with floating point coordinates to the elements of the point set `points`} + * \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + * of the iterator of `PointRange` and value type is a point type with floating point coordinates} + * \cgalParamDefault{`CGAL::Identity_property_map`} + * \cgalParamNEnd + * * \cgalParamNBegin{stream_precision} * \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} * \cgalParamType{int} diff --git a/Stream_support/include/CGAL/IO/STL.h b/Stream_support/include/CGAL/IO/STL.h index 1e2850fb994..dfa3ecded7e 100644 --- a/Stream_support/include/CGAL/IO/STL.h +++ b/Stream_support/include/CGAL/IO/STL.h @@ -319,10 +319,10 @@ bool write_STL(std::ostream& os, const Vector_3 n = collinear(p,q,r) ? Vector_3(1,0,0) : unit_normal(p,q,r); - const float coords[12] = { static_cast(to_double(n.x())), static_cast(to_double(n.y())), static_cast(to_double(n.z())), - static_cast(to_double(p.x())), static_cast(to_double(p.y())), static_cast(to_double(p.z())), - static_cast(to_double(q.x())), static_cast(to_double(q.y())), static_cast(to_double(q.z())), - static_cast(to_double(r.x())), static_cast(to_double(r.y())), static_cast(to_double(r.z())) }; + const float coords[12] = { static_cast(n.x()), static_cast(n.y()), static_cast(n.z()), + static_cast(p.x()), static_cast(p.y()), static_cast(p.z()), + static_cast(q.x()), static_cast(q.y()), static_cast(q.z()), + static_cast(r.x()), static_cast(r.y()), static_cast(r.z()) }; for(int i=0; i<12; ++i) os.write(reinterpret_cast(&coords[i]), sizeof(coords[i])); diff --git a/Stream_support/include/CGAL/IO/polygon_soup_io.h b/Stream_support/include/CGAL/IO/polygon_soup_io.h index c1239c9f3e1..c9b7eff3b13 100644 --- a/Stream_support/include/CGAL/IO/polygon_soup_io.h +++ b/Stream_support/include/CGAL/IO/polygon_soup_io.h @@ -142,6 +142,13 @@ bool read_polygon_soup(const std::string& fname, * \param np optional \ref bgl_namedparameters "Named Parameters" described below * * \cgalNamedParamsBegin + * \cgalParamNBegin{point_map} + * \cgalParamDescription{a property map associating points with floating point coordinates to the elements of the point set `points`} + * \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type + * of the iterator of `PointRange` and value type is a point type with floating point coordinates} + * \cgalParamDefault{`CGAL::Identity_property_map`} + * \cgalParamNEnd + * * \cgalParamNBegin{verbose} * \cgalParamDescription{indicates whether output warnings and error messages should be printed or not.} * \cgalParamType{Boolean} diff --git a/Stream_support/test/Stream_support/issue_9071.cpp b/Stream_support/test/Stream_support/issue_9071.cpp index ac166f6ad0b..94b23c4581d 100644 --- a/Stream_support/test/Stream_support/issue_9071.cpp +++ b/Stream_support/test/Stream_support/issue_9071.cpp @@ -2,13 +2,16 @@ #include #include +#include #include using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Epick = CGAL::Exact_predicates_inexact_constructions_kernel; int main() { std::vector points; std::vector> polygons; - CGAL::IO::write_polygon_soup("xxx.off", points, polygons, CGAL::parameters::stream_precision(17)); + auto pm = CGAL::make_cartesian_converter_property_map(CGAL::make_identity_property_map(Kernel::Point_3())); + CGAL::IO::write_polygon_soup("xxx.off", points, polygons, CGAL::parameters::stream_precision(17).point_map(pm)); return 0; }