1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
%% Netoyage
close all,
clear all,
clc
%% load the mesh
name ='D:/Desktop/MAP/Travail_Julie/primitives/off/sphere_1M_poly.off';
options.name = name; % useful for displaying
[vertex,faces] = read_mesh(name);
name_save= 'sphere_1M_poly-maille.jpg'; % nom pour enregistrer
name_save2= 'sphere_1M_poly-smooth_10.jpg';
%% display the mesh
clf;
plot_mesh(vertex, faces);
shading faceted;
axis on equal;
grid;
view([-45,45,-45]); %coordonées cartésiennes (x,y,z)
camproj('orthographic');
lighting('none');
%% save mesh object
set(gcf,'PaperPosition',[0, 0, 10, 13]) %dimensions de l'exportation en cm (150dpi)
saveas(gcf,(name_save))
%% compute the curvature
options.curvature_smoothing = 10;
options.verb = 0;
[Umin,Umax,Cmin,Cmax,Cmean,Cgauss,Normal] = compute_curvature(vertex,faces,options);
%% display
% colormap 'jet' 'hsv' 'hot' 'cool' 'spring' 'summer' 'autumn'
%'autumn' 'winter' 'gray' 'bone' 'copper' 'pink' 'lines'
%% Gaussian curvature
%clf;
figure;
%plot_mesh(vertex, faces); %Imprimer séparément
subplot(1,5,1);
options.face_vertex_color= perform_saturation(Cgauss,1.2); %variable écrasée
options.face_vertex_color_gauss= perform_saturation(Cgauss,1.2); %sauvegarde valeurs echelle colorimétrique
plot_mesh(vertex,faces,options);
%shading interp;
colormap jet(256);
title('Gaussian curvature');
axis on equal;
grid;
%caxis([-2 2.5]); %bloque les limites de l'echelle
view([-45,45,-45])
camproj('orthographic');
colorbar('location','southoutside');
lighting ('none');
%% Mean curvature
%figure;plot_mesh(vertex, faces);
subplot(1,5,3); %Attention '5' triche pour laisser espace entre figure
options.face_vertex_color= perform_saturation(Cmean,1.2);
options.face_vertex_color_mean= perform_saturation(Cmean,1.2);
plot_mesh(vertex, faces, options);
%shading interp;
colormap jet(256);
title('Mean curvature');
axis on equal;
%caxis([-2 2.5]); %bloque les limites de l'echelle
view([-45,45,-45]);
camproj('orthographic');
grid;
colorbar('location','southoutside');
lighting ('none');
%% Total curvature
%figure; plot_mesh(vertex, faces);
subplot(1,5,5);
options.face_vertex_color = perform_saturation(abs(Cmin)+abs(Cmax),1.2);
options.face_vertex_color_total = perform_saturation(abs(Cmin)+abs(Cmax),1.2);
plot_mesh(vertex, faces, options);
%shading interp;
colormap jet(256);
title('Total curvature');
axis on equal;
%caxis([-2 2.5]); %bloque les limites de l'echelle
view([-45,45,-45])
camproj('orthographic')
grid;
colorbar('location','southoutside');
lighting ('none');
%% save
set(gcf,'PaperPosition',[0, 0, 30, 10]) %dimensions de l'exportation en cm (150dpi)
saveas(gcf,(name_save2)) |
Partager