Skip to content
Snippets Groups Projects
Commit a12223c4 authored by Laura Nervo's avatar Laura Nervo
Browse files

gtPlotGrainUnitCell : better drawing of patches


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 5f19e50c
No related branches found
No related tags found
No related merge requests found
......@@ -14,31 +14,36 @@ function [hp,hl] = gtPlotGrainUnitCell(vertices, caxis, faces, cmap, hlight, lin
%
% OUTPUT:
% hp = patch handle
% hl = c-axis handle
% hl = c-axis handle (if existing)
%
% Version 002 06-06-2013 by LNervo
facecolor = repmat(cmap,size(faces,1),1);
% draws the patches
hp = patch('vertices', vertices, 'faces', faces, ...
'FaceVertexCData', facecolor, 'FaceColor', 'flat', ...
'EdgeColor', linecolor, 'FaceAlpha', alpha);
if iscell(faces)
hp = cellfun(@(num) ...
patch('Vertices', vertices, 'Faces', num, ...
'FaceColor', cmap, ...
'EdgeColor', linecolor, 'FaceAlpha', alpha), faces );
else
facecolor = repmat(cmap,size(faces,1),1);
hp = patch('Vertices', vertices, 'Faces', faces, ...
'FaceColor', facecolor, ...
'EdgeColor', linecolor, 'FaceAlpha', alpha);
end
% draw the caxis
if ~isempty(caxis)
hl = line(caxis(:,1),caxis(:,2),caxis(:,3),'Color','k');
hl = line(caxis(:,1),caxis(:,2),caxis(:,3),'Color',linecolor);
else
hl = [];
end
if hlight
set(hp, 'LineWidth',2)
if hlight, set(findobj(gcf,'type','line'), 'LineWidth',2); end
set(hp,'LineWidth',2)
if hlight, set(hl, 'LineWidth',2); end
else
set(hp, 'LineWidth',1)
if hlight, set(findobj(gcf,'type','line'), 'LineWidth',1); end
set(hp,'LineWidth',1)
if hlight, set(hl, 'LineWidth',1); end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment