Closed FeazAlkadi closed 6 years ago
You can do this in a slow way using ray_mesh_intersect
To do this quickly, I'd use libigl's ray_mesh_intersect instead. You could have a look at mex/ambient_occlusion.cpp for clues on how to do that.
Sounds good.
I tried to compile ambient_occlusion.cpp but I'm having a problem with that
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');
I always get 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 I couldnot find embree2 in libigl at all !!! Do you have any suggestion ? Thanks a lot
I only have libigl/external/embree in the file i downloaded. embree is empty folder I think you are right, I didn't clone all the submodules !!
Where can i find the instructions, please?
it's a subdirectory. Please read this entire line:
libigl/external/embree/include/embree2/rtcore.h
try
git submodule update --init
in your libigl folder
yes, this is what i mean
libigl/external/embree
is empty, Nothing in it.
and sorry for that, But i'm not an expert with Matlab, so I don't know what do you mean by :
try
git submodule update --init
in your libigl folder
I mean how can I do that in the command window or in a script?
I think i should close this issue since there is another open issue for compiling ambient_occlusion.cpp with windows 7.
Thanks Alec.
Hello Alec,
I was just wondering if you have made a function that works like the function (projpartIGES) from igestoolbox by Per Bergström
https://www.mathworks.com/matlabcentral/fileexchange/13253-iges-toolbox
As shown in the attached pictures,this function creates grid points in 2D (green color)and project them onto the surface of an object in IGS file format,and return points in 3D (Red color) with dimensions according to the object surface.
For my application: I'm looking for a function that does exactly the same thing BUT for a body made of triangle mesh (V and F). And has the ability to make two different grid spacing one for Primary direction (dp) and the other for Secondary direction (ds).
Here I'm also attaching the code for the example with small modifications: I'm not sure if you need to compile makeIGESmex for this example.
As usual, Thank you so much for the great help.
Top View
3D View