alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

Compiling ambient_occlusion function with Windows #47

Open FeazAlkadi opened 6 years ago

FeazAlkadi commented 6 years ago

I'm trying to compile the function ambient_occlusion with Microsoft Visual C++ 2015 and Matlab 2017b on Windows 7 as following:

clearvars

clc
path_to_eigen='C:\Users\faa23\Desktop\3D_DiskTop\MatlabCodes\iges (original)\eigen-eigen-';
% Check if the eigen path is correct
assert(exist([path_to_eigen '\Eigen\Core'],'file')==2)

path_to_libigl='C:\Users\faa23\Desktop\3D_DiskTop\MatlabCodes\iges (original)\libigl';
 %Check if the libig path is correct
assert(exist([path_to_libigl '\include\igl\embree\EmbreeIntersector.h'],'file')==2)
%%

MEXOPTS={'-v','-largeArrayDims','-DMEX'};

EIGEN_INC= ['-I' path_to_eigen];

LIBIGL_INC=['-I' path_to_libigl '\include'];
LIBIGL_FLAGS='-DIGL_SKIP';
LIBIGL_LIB={'-DIGL_SKIP'};
LIBIGL_LIBMATLAB='-DIGL_SKIP';
LIBIGL_LIBCGAL='-DIGL_SKIP';
LIBIGL_LIBCORK='-DIGL_NO_CORK';
LIBIGL_BASE={LIBIGL_INC, LIBIGL_FLAGS,LIBIGL_LIB{:}, LIBIGL_LIBMATLAB};

mex( ...
  MEXOPTS{:}, ...
  LIBIGL_BASE{:},EIGEN_INC, ...
  'ambient_occlusion.cpp');

But I got this error:

Error using mex ambient_occlusion.cpp c:\users\faa23\desktop\3d_disktop\matlabcodes\iges (original)\libigl\include\igl\EPS.h(16): warning C4305: 'initializing': truncation from 'double' to 'float' c:\users\faa23\desktop\3d_disktop\matlabcodes\iges (original)\libigl\include\igl\EPS.h(17): warning C4305: 'initializing': truncation from 'double' to 'float' c:\users\faa23\desktop\3d_disktop\matlabcodes\iges (original)\libigl\include\igl\embree\EmbreeIntersector.h(24): fatal error C1083: Cannot open include file: 'embree2/rtcore.h': No such file or directory

Error in STLoffset (line 25) mex( ...

The thing is there is no folder called embree2 in libigl Hope someone can help with this. Thank you all