Эх сурвалжийг харах

* fixed bug in hsv_to_rgb function
* fixed bug in tetrahedralize


Former-commit-id: 5ffa2ac86f9192a5854d1c5c7c662cca02edbbd5

schuellc 12 жил өмнө
parent
commit
f6d07e01d1

+ 3 - 3
include/igl/hsv_to_rgb.cpp

@@ -16,10 +16,10 @@ void igl::hsv_to_rgb(
   T & r, T & g, T & b)
 {
   // From medit
-  double f,p,q,t;
-  int    i,hh;
+  double f,p,q,t,hh;
+  int    i;
   hh = ((int)h % 360) / 60.;
-  i = (int)floor((double)hh);    /* largest int <= h     */
+  i = (int)floor(hh);    /* largest int <= h     */
   f = hh - i;                    /* fractional part of h */
   p = v * (1.0 - s);
   q = v * (1.0 - (s * f));

+ 1 - 1
include/igl/tetgen/tetrahedralize.cpp

@@ -30,7 +30,7 @@ IGL_INLINE int igl::tetrahedralize(
   try
   {
     char * cswitches = new char[switches.size() + 1];
-    std::copy(switches.begin(), switches.end(), cswitches);
+    std::strcpy(cswitches,switches.c_str());
     ::tetrahedralize(cswitches,&in, &out);
     delete[] cswitches;
   }catch(int e)