MATLAB: Displaying STL file with colored facets

colorbarcolormappatchplotstl file

I have an STL file of a part for 3D printing, for each facet I had calculated the surface roughness.How to display the STL file with the facets colored according to the value of its specific surface roughness? I want to get something like that

Best Answer

p = patch('faces',F,'vertices',V,'FaceColor',[0.8 0.8 1.0],'FaceLighting','gouraud');
Pass the surface roughness vector as the argument to the 'FaceColor' option.
Related Question