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

gtHexagonalUnitCell : added caxis calculation and better drawing of cryst axes


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 00bc77c8
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ app.numbers = false;
app.patch = false;
app.sampleaxes = false;
app.crystaxes = false;
app.caxis = false;
app.view = [103 20];
app.add_vertices = false;
......@@ -64,6 +65,9 @@ if app.add_vertices
vertices(end+1,:) = [0 0 (z1(1)-z0(1))/4*3];
end
caxis(1,:) = [0 0 z0(1)-c/4];
caxis(2,:) = [0 0 z1(1)+c/4];
faces = {[1 2 8 7]; [4 5 11 10]; [5 6 12 11]; [2 3 9 8]; [3 4 10 9]; [6 1 7 12];...
[1 2 3 4 5 6]; [7 8 9 10 11 12];}; %
hkl = [1 0 -1 0; -1 0 1 0; 0 -1 1 0; 0 1 -1 0; -1 1 0 0; 1 -1 0 0; ...
......@@ -92,7 +96,7 @@ end
orig=repmat([0 0 z0(1)],4,1);
xcrys=[1;-0.5;-0.5;0];
ycrys=[0;0.866;-0.866;0];
zcrys=[z0(1);z0(1);z0(1);z1(1)+0.4];
zcrys=[z0(1);z0(1);z0(1);z0(1)+1];
lcrys={'a1 [2-1-10]';...
'a2 [-12-10]';...
'a3 [-1-120]';...
......@@ -108,9 +112,15 @@ if app.draw
for ii=1:length(x0)
plot3([x0(ii) x0(ii)],[y0(ii) y0(ii)],[z0(ii) z1(ii)], 'b-', 'LineWidth', 1)
end
if app.caxis
line([0 0],[0 0],[z0(1)-c/4 z1(1)+c/4])
end
% cryst axes
if app.crystaxes
quiver3(orig(:,1),orig(:,2),orig(:,3),xcrys,ycrys,zcrys,0,'k')
quiver3(0,0,z0(1),1,0,0,0,'k')
quiver3(0,0,z0(1),-0.5,0.866,0,0,'k')
quiver3(0,0,z0(1),-0.5,-0.866,0,0,'k')
quiver3(0,0,z0(1),0,0,1,0,'k')
text(xcrys-0.1,ycrys+0.1,zcrys,lcrys,'Color',[0 0 0])
end
view(app.view)
......@@ -144,17 +154,18 @@ if app.draw
end % end draw
if nargout == 1
data.vertices = vertices;
data.faces = faces;
data.vertices = vertices;
data.caxis = caxis;
data.faces = faces;
data.faces_sides = faces_sides;
data.faces_end = faces_end;
data.facecolors = faceHexColors;
data.hkl = hkl;
data.orig = orig;
data.xcrys = xcrys;
data.ycrys = ycrys;
data.zcrys = zcrys;
data.lcrys = lcrys;
data.facecolors = faceHexColors;
data.hkl = hkl;
data.orig = orig;
data.xcrys = xcrys;
data.ycrys = ycrys;
data.zcrys = zcrys;
data.lcrys = lcrys;
if app.draw
data.hf = gcf;
if app.patch
......
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