How can I plot a 3D solid figure (not just 3d surface)

조회 수: 61 (최근 30일)
lingfeng zhou
lingfeng zhou 2016년 11월 18일
편집: David 2022년 9월 14일
I want to generate some solid models for 3D Printing. And the stl file is needed.

답변 (2개)

KSSV
KSSV 2016년 11월 18일

David
David 2022년 9월 14일
편집: David 2022년 9월 14일
I use surf2solid from https://www.mathworks.com/matlabcentral/fileexchange/42876-surf2solid-make-a-solid-volume-from-a-surface-for-3d-printing and Sven's stlwrite from https://www.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-write-ascii-or-binary-stl-files -- not the Matlab 2018b stlwrite(). Then if I open the stl file in PrusaSlicer:
n = 30;
[X,Y] = meshgrid(linspace(0,1,2*n+1));
L = (40/51/0.9)*membrane(1,n);
figure, subplot(2,2,[1 3]), title 'Thin surface'
surf(X,Y,L,'EdgeColor','none'); colormap pink; axis image; camlight
subplot(2,2,2), title 'Block elevation'
[f,v] = surf2solid(X,Y,L,'elevation',min(L(:))-0.05); axis image; camlight; camlight
fv_block = struct('faces',f,'vertices',v);
subplot(2,2,4), title 'Thickness'
surf2solid(X,Y,L,'thickness',-0.1); axis image; camlight;
stlwriteSven('test.stl',fv_block)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by