How to get the angles across a 3D surface?

3 visualizaciones (últimos 30 días)
Mohamed Ibraheem
Mohamed Ibraheem el 19 de Ag. de 2022
Respondida: DGM el 4 de Abr. de 2025
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?

Respuestas (1)

DGM
DGM el 4 de Abr. de 2025
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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by