Is there is a way to export mesh in figure to stl or obj???

25 visualizzazioni (ultimi 30 giorni)
Hello I have a matlab code as i below that result 3d mesh, I wonder is there is any simple way that give me an option to export it to 3D object as stl or obj or any else 3d extension
if true
% Img = imread('MK2.jpg');
Img=double(Img(:,:,1));
sigma=1.5;
G=fspecial('gaussian',15,sigma);
Img_smooth=conv2(Img,G,'same');
[Ix,Iy]=gradient(Img_smooth);
f=Ix.^2+Iy.^2;
g=1./(1+f);
c0=2;
initialfunc=c0*ones(size(Img));
initialfunc(10:95, 8:100)=-c0;
phi=initialLSF;
figure(1);
mesh(-phi);
hold on; contour(phi, [0,0], 'r','LineWidth',2);
title('M1');
view([-80 35]);
imagesc(Img,[0, 255]); axis off; axis equal; colormap(gray); hold on; contour(phi, [0,0], 'r');
end
end
alfa=0;
iter_refine = 10;
.
.
.
figure;
mesh(-finalLSF);
hold on; contour(phi, [0,0], 'r','LineWidth',2);
str=['Final level set function, ', num2str(iter_outer*iter_inner+iter_refine), ' iterations'];
title(str);
axis off;
end
end

Risposte (2)

Young Dae
Young Dae il 14 Set 2018

Walter Roberson
Walter Roberson il 27 Dic 2017
Note: mesh are surf that have face color turned off.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by