alecjacobson / gptoolbox

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

mex problems of gptoolbox #4

Closed yqwang2006 closed 8 years ago

yqwang2006 commented 9 years ago

I'm using the gptoolbox to generate some sdf data from 'off' files. However, the gptoolbox would make MATLAB crash. First, I compiled the signed_distance_isosurface.cpp in 'mex' dir using next command:

' mex -g -largeArrayDims -DMEX CXXFLAGS="\$CXXFLAGS -std=c++11"... -I/usr/local/igl/libigl/include ... -I/usr/include/eigen3 ... -I/usr/include ... -L/usr/lib ... -lCGAL -lCGAL_Core -lgmp -lmpfr... -lboost_thread -lboost_system ... signed_distance_isosurface.cpp'

This process would not generate any errors. However, MATLAB would crash when I tried to run a demo. The demo code is:

addpath('mesh'); addpath('mex'); [V,F,UV,C,N] = readOFF( 'bed.off'); [OV,OF] = signed_distance_isosurface(V,F);

The error is shown in next fig. Could you please help me? Thanks.

image

alecjacobson commented 9 years ago

Which Eigen Version do you have? Which CGAL version? Which Matlab?

On Thu, May 28, 2015 at 11:26 PM, yqwang2006 notifications@github.com wrote:

I'm using the gptoolbox to generate some sdf data from 'off' files. However, the gptoolbox would make MATLAB crash. First, I compiled the signed_distance_isosurface.cpp in 'mex' dir using next command:

' mex -g -largeArrayDims -DMEX CXXFLAGS="\$CXXFLAGS -std=c++11"... -I/usr/local/igl/libigl/include ... -I/usr/include/eigen3 ... -I/usr/include ... -L/usr/lib ... -lCGAL -lCGAL_Core -lgmp -lmpfr... -lboost_thread -lboost_system ... signed_distance_isosurface.cpp'

This process would not generate any errors. However, MATLAB would crash when I tried to run a demo. The demo code is:

addpath('mesh'); addpath('mex'); [V,F,UV,C,N] = readOFF( 'bed.off'); [OV,OF] = signed_distance_isosurface(V,F);

The error is shown in next fig. Could you please help me? Thanks.

[image: image] https://cloud.githubusercontent.com/assets/7324348/7875864/614757a0-05f5-11e5-8297-8ea59d00d38a.png

— Reply to this email directly or view it on GitHub https://github.com/alecjacobson/gptoolbox/issues/4.

yqwang2006 commented 9 years ago

The dependent lib versions are: cgal: 4.6 boost: 1.58 eigen: 3.2.4

yqwang2006 commented 9 years ago

matlab: 2014b

alecjacobson commented 9 years ago

Can you share your chair?

On Fri, May 29, 2015 at 12:05 AM, yqwang2006 notifications@github.com wrote:

matlab: 2014b

— Reply to this email directly or view it on GitHub https://github.com/alecjacobson/gptoolbox/issues/4#issuecomment-106677477 .

yqwang2006 commented 9 years ago

OK, I'll send you by email due to github doesn't support the file type.

alecjacobson commented 9 years ago

Seems to be a bug. For now I'd suggest removing any degenerate faces from your input mesh.

alecjacobson commented 8 years ago

This no longer crashes (at least by 4ced5ebaf6a78c0837f40b9b01f2e07616950cc2 but probably much earlier).

alecjacobson commented 8 years ago

BTW, I used:

[OV,OF] = signed_distance_isosurface(V,F,'SignedDistanceType','unsigned','Level',0.3,'DistanceBound',0.004,'RadiusBound',0.004);

to generate this:

image