Browse Source

Merge pull request #298 from s-koch/python_bindings

Python bindings: Fixed 705 and compilation problems

Former-commit-id: 67e25b0e56f883c6cef045b3da95872535cbabd1
Daniele Panozzo 9 years ago
parent
commit
2d69fd1489
2 changed files with 5 additions and 1 deletions
  1. 4 0
      python/modules/py_igl_viewer.cpp
  2. 1 1
      python/tutorial/705_MarchingCubes.py

+ 4 - 0
python/modules/py_igl_viewer.cpp

@@ -8,6 +8,10 @@
 #include <igl/viewer/ViewerData.h>
 #include <igl/viewer/OpenGL_state.h>
 #include <igl/serialize.h>
+#ifdef IGL_VIEWER_WITH_NANOGUI
+#include "../../../external/nanogui/include/nanogui/formhelper.h"
+#include "../../../external/nanogui/include/nanogui/screen.h"
+#endif
 
 void python_export_igl_viewer(py::module &m)
 {

+ 1 - 1
python/tutorial/705_MarchingCubes.py

@@ -45,7 +45,7 @@ if __name__ == "__main__":
     res = (s * ((Vmax - Vmin) / (Vmax - Vmin).maxCoeff())).castint()
 
     def lerp(res, Vmin, Vmax, di, d):
-        return Vmin[d] + di / (res[d] - 1) * (Vmax[d] - Vmin[d])
+        return Vmin[d] + float(di) / (res[d] - 1) * (Vmax[d] - Vmin[d])
 
     # create grid
     print("Creating grid...")