首页 > 解决方案 > 如何在 Matlab 中重新缩放 STL 曲面

问题描述

我在 Matlab 中使用函数 stlread 导入了一个 STL 文件。

我的问题是,我们如何使用任意尺寸因子重新缩放它(例如,假设您想将其尺寸减半)?

这是我的一段代码,其中导入和查看了 stl:

fv = stlread ( 'Femur_Head.stl' );


patch(fv,'FaceColor',       [0.8 0.8 1.0], ...
         'EdgeColor',       'none',        ...
         'FaceLighting',    'gouraud',     ...
         'AmbientStrength', 0.15);

% Add a camera light, and tone down the specular highlighting
camlight('headlight');
material('dull');

axis([-50 50 -50 50 0 80]);
 
view([-135 35]);
 
title('Femur Head');
 
xlabel('X');ylabel('Y');zlabel('Z');
 
% Fix the axes scaling, and set a nice view angle
 
axis('image');
view([-135 35]);
 
hold on

看法:

在此处输入图像描述

标签: matlabstlmatlab-figurematlab-guide

解决方案


推荐阅读