How to get the angles across a 3D surface?

조회 수: 3 (최근 30일)
Mohamed Ibraheem
Mohamed Ibraheem 2022년 8월 19일
답변: DGM 2025년 4월 4일
I want to create a colorbar for the angle variations across an STL 3D surface. How can this be done effectively such as in the attached image?

답변 (1개)

DGM
DGM 2025년 4월 4일
I think this is what was meant.
unzip pringle_top.stl.zip % for the forum
% an STL file
T = stlread('pringle_top.stl');
% get the elevation angle for each face
fn = faceNormal(T);
th = acosd(fn(:,3)./vecnorm(fn,2,2));
% it's easier to set up scaled FVCData for a trisurf()
trisurf(T,'facevertexcdata',th);
axis equal; grid on; view(10,28)
xlabel('X'); ylabel('Y'); zlabel('Z')
colorbar

카테고리

Help CenterFile Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by