Skip to content
Snippets Groups Projects
Commit abba9a81 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Twins: finally fixed orientation prediction also for hexagonal, in case of Cartesian axis

parent e19425fe
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,10 @@ function [allshkls, allhklinds, mult, hklsp, thtype] = gtCrystSignedHKLs(hkl, s
% Loop through input hkl types
for ii = 1:num_axes
% for ii_hkl = 1:num_symm_ops
% old_shkls(ii_hkl * 2 - 1, :) = hkl(ii, :) * symm(:, :, ii_hkl);
% old_shkls(ii_hkl * 2, :) = - old_shkls(ii_hkl * 2 - 1, :);
% end
% Apply all symmmetry operators to the hkl type to get signed hkl-s
shkls = zeros(num_symm_ops * 2, num_indexes);
tmp_shkl = hkl(ii, :) * reshape(symm, num_indexes, num_indexes * num_symm_ops);
......
function g_twins = gtTwinOrientations(R_vector, twin_angle, twin_axis, spacegroup, lp, plot_variants)
function g_twins = gtTwinOrientations(R_vector, twin_angle, twin_axis, spacegroup, lp, axis_in_cart, plot_variants)
% GTTWINORIENTATIONS
% g_twins = gtTwinOrientations(R_vector, twin_angle, twin_axis, spacegroup, lp, [plot_variants])
% ------------------------------------------------------------------------------------------------
......@@ -20,6 +20,9 @@ function g_twins = gtTwinOrientations(R_vector, twin_angle, twin_axis, spacegrou
%
% Version 002 10-01-2013 by LNervo
if (~exist('axis_in_cart', 'var') || isempty(axis_in_cart))
axis_in_cart = true;
end
if (~exist('plot_variants', 'var') || isempty(plot_variants))
plot_variants = false;
end
......@@ -32,6 +35,10 @@ function g_twins = gtTwinOrientations(R_vector, twin_angle, twin_axis, spacegrou
% Symmetry equivalents
symm = gtCrystGetSymmetryOperators(crystal_system, spacegroup);
if (strcmpi(crystal_system, 'hexagonal') && axis_in_cart)
twin_axis = gtCart2Hex(twin_axis, lp);
end
[twin_axes, ~, num_axes] = gtCrystSignedHKLs(twin_axis, symm);
num_axes_comps = size(twin_axes, 2);
......
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