瀏覽代碼

To double fix + typo?

Former-commit-id: 23198324c177f33a3dea1fe27290ad282a134c8c
Qingnan Zhou 9 年之前
父節點
當前提交
8db5a190ec

+ 4 - 1
include/igl/copyleft/cgal/assign_scalar.cpp

@@ -18,7 +18,10 @@ IGL_INLINE void igl::copyleft::cgal::assign_scalar(
   const typename CGAL::Epeck::FT & cgal,
   double & d)
 {
-  d = CGAL::to_double(cgal);
+  const auto interval = CGAL::to_interval(cgal);
+  assert(nextafter(interval.first, interval.second) == interval.second);
+  d = (cgal-interval.first) < (interval.second-cgal)?
+    interval.first:interval.second;
 }
 
 IGL_INLINE void igl::copyleft::cgal::assign_scalar(

+ 1 - 1
include/igl/copyleft/cgal/piecewise_constant_winding_number.cpp

@@ -12,7 +12,7 @@
 #include <algorithm>
 
 template < typename DerivedV, typename DerivedF>
-IGL_INLINE bool igl::piecewise_constant_winding_number(
+IGL_INLINE bool igl::copyleft::cgal::piecewise_constant_winding_number(
   const Eigen::PlainObjectBase<DerivedV> & V,
   const Eigen::PlainObjectBase<DerivedF> & F)
 {