Skip to content
Snippets Groups Projects
Commit 8ace80a1 authored by Yoann Guilhem's avatar Yoann Guilhem Committed by Nicola Vigano
Browse files

Add some flexibility to gtCrystVector2SST

parent 66659a43
No related branches found
No related tags found
No related merge requests found
......@@ -76,13 +76,11 @@ if size(r_vectors,2) == 4
end
r_vectors = r_vectors.';
% Get the symmetry operators
% Get the crystal system
if isempty(par.crystal_system)
parameters = load('parameters.mat');
par.crystal_system = parameters.parameters.cryst(phaseid).crystal_system;
end
tmp = gtCrystGetSymmetryOperators(par.crystal_system);
symm = {tmp.g3};
% Compute all orientation matrices g
% Gcry = g Gsam
......@@ -90,10 +88,10 @@ symm = {tmp.g3};
all_g = gtMathsRod2RotMat(r_vectors);
% Compute LDc = LD expressed in the crystal CS
LDc = gtVectorLab2Cryst(LD, sam2crys);
LDc = gtVectorLab2Cryst(LD, all_g);
% Get the color and vector in the SST triangle
[map, Vsst, ~, Vc_symm] = gtCrystVector2SST(LDc, par.crystal_system, symm, par.saturate);
[map, Vsst, ~, Vc_symm] = gtCrystVector2SST(LDc, par.crystal_system, [], par.saturate);
cmap = [ 0 0 0 ; map ];
......
......@@ -475,7 +475,6 @@ methods (Access = public)
end
obj.Nphases = length(crystal_systems);
symm = cell(1, 10);
for iphase=1:obj.Nphases
% Get crystal system
try
......@@ -486,12 +485,11 @@ methods (Access = public)
end
syst = crystal_systems{iphase};
% Get symmetry operators
symm = gtCrystGetSymmetryOperators(syst);
% Store phase crystal system and symmetry operators
obj.p_crystalSystem{iphase} = syst;
obj.p_symm{iphase} = {symm.g3};
% Get symmetry operators
obj.p_symm{iphase} = gtCrystGetSymmetryOperators(syst);
end
end
......
......@@ -7,9 +7,9 @@ function [rgb, Vsst, Vsst_p, Vc_symm] = gtCrystVector2SST(Vc, crystal_system, sy
% INPUT:
% Vc = <double> Row vectors expressed in crystal frame
% crystal_system = <string> Crystal system type ('cubic'|'hexagonal')
% symm = <cell_array> Symmetry operators
%
% OPTINAL INPUT:
% OPTIONAL INPUT:
% symm = <cell> Symmetry operators (recomputed if empty)
% saturate = <logical> Saturate or not the RGB output {true}
%
% OUTPUT:
......@@ -28,6 +28,10 @@ function [rgb, Vsst, Vsst_p, Vc_symm] = gtCrystVector2SST(Vc, crystal_system, sy
saturate = true;
end
% Get symmetry operators and store g3 operators into an array
if ~exist('symm', 'var') || isempty(symm)
symm = gtCrystGetSymmetryOperators(crystal_system);
end
symm = reshape(cell2mat({symm.g3}), 3, 3, []);
% All equivalents by symm
......
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