|
@@ -64,3 +64,36 @@ IGL_INLINE void igl::copyleft::cgal::assign_scalar(
|
|
|
{
|
|
|
d = c;
|
|
|
}
|
|
|
+
|
|
|
+IGL_INLINE void igl::copyleft::cgal::assign_scalar(
|
|
|
+ const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
|
|
|
+ CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & d)
|
|
|
+{
|
|
|
+ d = cgal;
|
|
|
+}
|
|
|
+
|
|
|
+IGL_INLINE void igl::copyleft::cgal::assign_scalar(
|
|
|
+ const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
|
|
|
+ double & d)
|
|
|
+{
|
|
|
+ const auto interval = CGAL::to_interval(cgal);
|
|
|
+ d = interval.first;
|
|
|
+ do {
|
|
|
+ const double next = nextafter(d, interval.second);
|
|
|
+ if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break;
|
|
|
+ d = next;
|
|
|
+ } while (d < interval.second);
|
|
|
+}
|
|
|
+
|
|
|
+IGL_INLINE void igl::copyleft::cgal::assign_scalar(
|
|
|
+ const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
|
|
|
+ float& d)
|
|
|
+{
|
|
|
+ const auto interval = CGAL::to_interval(cgal);
|
|
|
+ d = interval.first;
|
|
|
+ do {
|
|
|
+ const float next = nextafter(d, float(interval.second));
|
|
|
+ if (CGAL::abs(cgal-d) < CGAL::abs(cgal-next)) break;
|
|
|
+ d = next;
|
|
|
+ } while (d < float(interval.second));
|
|
|
+}
|