GithubHelp home page GithubHelp logo

Comments (8)

alecjacobson avatar alecjacobson commented on July 24, 2024
repmat('blue',size(V,1),1)

should be

repmat(blue,size(V,1),1)

from gptoolbox.

FeazAlkadi avatar FeazAlkadi commented on July 24, 2024

I did so, as following:

clf;
hold on;
t = tsurf(F,V,'EdgeColor','none',fsoft, 'FaceVertexCData',repmat(blue,size(V,1),1),'FaceAlpha',1+(iso<0)(0.35-1),fphong);
ts = tsurf(SF,SV,'EdgeAlpha',0.2+(iso<0)
(0-0.2),fsoft,'FaceVertexCData',repmat(orange,size(SV,1),1),fphong,'FaceAlpha',1+(iso>0)(0.2-1));
apply_ambient_occlusion(ts);
hold off;
axis equal;
view(-20,20)
camlight;
t.SpecularStrength = 0.04;
l = light('Position',[5 -5 10],'Style','local');
add_shadow(t,l,'Color',0.8
[1 1 1],'Fade','local','Ground',[0 0 -1 min([V(:,3);SV(:,3)])]);
set(gca,'pos',[0 0 1 1])
set(gca,'Visible','off');
set(gcf,'Color','w');
drawnow;

And now i got this error !

Attempt to execute SCRIPT ambient_occlusion as a function:
C:\Users\faa23\Desktop\3D_DiskTop\MatlabCodes\iges (original)\ambient_occlusion.m

Error in apply_ambient_occlusion/apply_ambient_occlusion_helper (line 79)
AO = ambient_occlusion(V,F,O,N,samples);

Error in apply_ambient_occlusion (line 150)
[AOii,Cii] = apply_ambient_occlusion_helper(tii,AOii,Cii,factor,unoriented);

Error in STLoffset (line 31)
apply_ambient_occlusion(ts);

Do you have an idea what would be the problem ?

from gptoolbox.

FeazAlkadi avatar FeazAlkadi commented on July 24, 2024

SORRY, I posted the wrong error in the previous comment. I just updated that.

from gptoolbox.

alecjacobson avatar alecjacobson commented on July 24, 2024

have you changed ambient_occlusion.m? Do you have another file called ambient_occlusion.m in your path?

from gptoolbox.

FeazAlkadi avatar FeazAlkadi commented on July 24, 2024

No i didn't. And I don't have another file.
Does it need to be compiled too?
because I tried to compile it as oqilipo advised me to do for the function signed_distance as follow:

clearvars

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';

%%

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 there was a an error as follow:

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 that I did find any folder called embree2 in libigl !!!

from gptoolbox.

alecjacobson avatar alecjacobson commented on July 24, 2024

from gptoolbox.

FeazAlkadi avatar FeazAlkadi commented on July 24, 2024

Thank you so much Alec.
I hope someone can step up here :)

from gptoolbox.

FeazAlkadi avatar FeazAlkadi commented on July 24, 2024

Do you think think I should close this and open a new issue?

from gptoolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.