How to turn 3D surface into STL file with surface?
이전 댓글 표시
The attached MATLAB code produces a 3D surface. How can I give the surface some thickness and export it as an STL file?
% Data points forming a figure eight in 3D space
x = [-54 -58 -47 -43 -54 -65 -61 -50 -54];
y = [ 20 32 38 26 20 13 1 7 20];
z = [ 82 76 82 88 82 76 82 88 82];
% Plot the data points and write their serial numbers
n = length(x);
plot3(x,y,z,'r-*'), axis equal
hold on
for i = 1:n, text(x(i),y(i),z(i),num2str(i)), end
% Create and plot a periodic spline (space curve) through the data points
n = length(x);
t = 0:n-1;
ppx = csape(t,x,'periodic');
ppy = csape(t,y,'periodic');
ppz = csape(t,z,'periodic');
fxc = @(t) fnval(ppx,t);
fyc = @(t) fnval(ppy,t);
fzc = @(t) fnval(ppz,t);
fplot3(fxc,fyc,fzc,[0 n-1],'b','LineWidth',3)
% Create and plot a parametric surface based on the spline
fxs = @(s,t) s.*fxc(t);
fys = @(s,t) s.*fyc(t);
fzs = @(s,t) s.*fzc(t);
fsurf(fxs,fys,fzs,[0 1 0 n-1])
legend('Data points','Space curve (spline)','Surface')
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!