Rotation cube plotting

671 views
Skip to first unread message

Vicky Liu

unread,
Aug 8, 2016, 9:25:28 AM8/8/16
to MTEX
Hello,

I saw some pretty figures in the paper to represent a grain orientation using the rotation cube, like this:

and these cubes (or hexagonal prisms for hcp) also can be plotted in the corresponding inverse pole figure: (this example is hcp.)

This is a clear, intuitive visual expression for grain orientations. 

I just wonder is there any code in MTEX can achieve this kind of expression method?

Thank you in advance!


Regards, 

Liu




adam.cr...@gmail.com

unread,
Jan 14, 2018, 12:18:02 PM1/14/18
to MTEX
I haven't found an easy way to do it in mtex, but I wrote a small python notebook to do something similar. 

I'm still working out some of the bugs with it, but I'd be willing to share if you're interested.

Ralf Hielscher

unread,
Jan 14, 2018, 3:08:25 PM1/14/18
to MTEX
Hi Adam,

in the current developer branch you can do things like below. The code is:

// define a crystal shape
cS  
= crystalShape.quartz

// some random orientations
ori = orientation.rand(30,cs)

// plot the pole figure
plotPDF
(ori,0.4*(ori*cS),Miller(0,0,0,1,cs))


 This works in principle also for inverse pole figures. I do only wonder what I should plot their: a pole figure is in specimen coordinates, i.e. it makes sense to plot a crystal rotated into specimen coordinates to represent its orientation. However, inverse pole figures are in crystal coordinates. How should I visualize here a crystal orientation. It would only make sense to plot the specimen shape rotates into crystal coordinates.

Ralf.





marcel...@uni-kassel.de

unread,
Jan 17, 2018, 5:17:23 AM1/17/18
to MTEX

I have a comparable question concerning this topic and so I hope it is OK to use this thread here. Is it possible in MTEX to generate an IPF-Z with an crystal lattice overlay at defined points, like in the figure attached? In OIM there is such a function to visualize the crystal orientation in the IPF-Z, but I found nothing similar in MTEX besides visualizing grain directions by arrows.



Thanks in advance for your help,
Marcel

Ralf Hielscher

unread,
Jan 17, 2018, 5:29:04 AM1/17/18
to MTEX
The following code plots a crystal with a certain orientation at coordinates x,y .

cs = crystalSymmetry(432)
ori
= orientation('Euler',10*degree,20*degree,30*degree,cs)
cS
= crystalShape.cube(cs)
plot
([x,y] + ori * cS)

Remember, that this requires the developer version of MTEX.

Ralf.

marcel...@uni-kassel.de

unread,
Jan 17, 2018, 10:26:35 AM1/17/18
to MTEX
Thank you very much Mr. Hielscher for your prompt response.
I have one follow-up question: Your code works quite well and I can generate a cubic crystal. However, I was unable to generate a crystal with a certain orientation with respect to my IPF-Z. That means, I import my .ctf and plot the IPF-Z using

ebsd = loadEBSD(fname,CS,'interface','ctf')
oM
= ipdfHSVOrientationMapping(ebsd('Aluminum'));
oM
.inversePoleFigureDirection = zvector;
color
= oM.orientation2color(ebsd('Aluminum').orientations);
plot
(ebsd('Aluminum'),color)

to determine the coordinates of interested points in different grains, let's say (x1/y1), (x2/y2). How can I import these coordinates into your code to generate different crystals with respect to the grain orientation?

plot([x1,y1] + ori * cS)
results in the same crystal as

plot([x2,y2] + ori * cS)

even tough the points belong to different grains and so exhibit different orientations. I already tried some modifications of your code to reference the coordinates to ebsd('Aluminum') but without success until now.

Thanks in advance,
Marcel
 
 

Ralf Hielscher

unread,
Jan 17, 2018, 3:01:56 PM1/17/18
to MTEX
Hi Marcel,

in my code the orientation was stored in the variable ori. If you want to use the orientation of you EBSD data you may use the following syntax to extract it

ori = ebsd(x,y).orientations

Ralf.

adam.cr...@gmail.com

unread,
Jan 18, 2018, 9:32:06 AM1/18/18
to MTEX

Remember, that this requires the developer version of MTEX.

Looks like the developer version isn't quite set for macs yet (see below).

>> install_mtex
I found another version of MTEX and remove it from the current search path!
initialize  MTEX 4.5.3  ....Warning: missing binary pf2odf
> In check_installation>fast_check_binaries (line 98)
  In check_installation>check_binaries (line 36)
  In check_installation (line 16)
  In startup_mtex (line 74)
  In install_mtex (line 13)

********************************************************************************
  MTEX binary check failed!
 
  The original error message was:
  Error using call_extern (line 30)
  Can not find file "odf2pf" at directory
   /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/bin/maci64
 
  Check the following options:
  * Compile the binaries yourself.
  * Ask the maintainer for help!

********************************************************************************
Warning: Name is nonexistent or not a directory:
/Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/maci64
> In path (line 109)
  In addpath (line 86)
  In check_installation>check_mex (line 110)
  In check_installation (line 19)
  In startup_mtex (line 74)
  In install_mtex (line 13)
Warning: missing mex-file S1Grid_find.mexmaci64
> In check_installation>fast_check_mex (line 190)
  In check_installation>check_mex (line 113)
  In check_installation (line 19)
  In startup_mtex (line 74)
  In install_mtex (line 13)

--------------------------------------------------------------------------------
Checking mex files failed!
> Trying now to recompile mex files.
... compile S1Grid_find.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/S1Grid_find.c failed!
... compile S1Grid_find_region.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/S1Grid_find_region.c failed!
... compile S2Grid_find.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/S2Grid_find.c failed!
... compile S2Grid_find_region.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/S2Grid_find_region.c failed!
... compile SO3Grid_dist_region.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/SO3Grid_dist_region.c failed!
... compile SO3Grid_find.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/SO3Grid_find.c failed!
... compile SO3Grid_find_region.c
Compiling /Users/creuzige/Documents/MATLAB/Mtex_versions/mtex-develop/c/mex/SO3Grid_find_region.c failed!
Warning: missing mex-file S1Grid_find.mexmaci64
> In check_installation>fast_check_mex (line 190)
  In check_installation>check_mex (line 159)
  In check_installation (line 19)
  In startup_mtex (line 74)
  In install_mtex (line 13)

********************************************************************************
  MTEX: Couldn't get the mex files working!
  
  The original error message was:
  Error using mex
No supported compiler or SDK was found. For options, visit  http://www.mathworks.com/support/compilers/R2015a/maci64.html.
 
  Contact author for help!

********************************************************************************

adam.cr...@gmail.com

unread,
Jan 18, 2018, 9:44:27 AM1/18/18
to MTEX
 This works in principle also for inverse pole figures. I do only wonder what I should plot their: a pole figure is in specimen coordinates, i.e. it makes sense to plot a crystal rotated into specimen coordinates to represent its orientation. However, inverse pole figures are in crystal coordinates. How should I visualize here a crystal orientation. It would only make sense to plot the specimen shape rotates into crystal coordinates.


To me, the inverse pole figure should show the crystal orientation as viewed from the sample axis specified in the inverse pole figure. I can't quite tell if that's the same as your statement. I like how Marcel's example below looks, where you can see the green grains have a near 110 crystal plane/direction out of the figure.  It's a much more concrete example for wider audiences than the color key alone.  And also addresses some of the limitations of the inverse pole figure, in that you only show one of the sample axes per figure.

ruediger Kilian

unread,
Jan 18, 2018, 9:50:21 AM1/18/18
to mtex...@googlegroups.com
Hi Adam
just copy the the relevant binaries from c/bin and c/mex from your release version or just the entire folder c and it will work.
Cheers,
Rüdiger

ruediger Kilian

unread,
Jan 18, 2018, 10:20:19 AM1/18/18
to mtex...@googlegroups.com
Hi Adam,
I think that’s a misunderstanding. A single inverse polefigure just shows the one crystal direction that is parallel to the given specimen direction, not the entire crystal orientation. So if you’d like to plot a little wire crystal shape on your map - and the map ins in specimen coordinates, the wire crystal shape is rotated in specimen coordinates according to the orientation of the point in the map.
If you like, you can colorcode each crystal shape according to the color in the map, have a look at this demo: https://gist.github.com/kilir/7185b038d105f8328af173b33669a5d5
Cheers,
Rüdiger


marcel...@uni-kassel.de

unread,
Jan 19, 2018, 9:33:03 AM1/19/18
to mtex...@googlegroups.com
I found another code for drawing unit cells overlaid on an EBSD Map rotated by Euler angles. Have a look at UnitCellOverlay

Ba
sed on the discussion above, I have a follow-up question:
My EBSD map shows a fractured specimen and I am interested in the plane the crack is growing in the green grain in the middle. A CT analysis reveals that the crack plane is constant, i.e. the 3rd component can be neglected. Even tough the cubes show the orientation of the grain, it is difficult to determine the plane of crack growth based on this depiction. My first thought was to plot the pole figures with resprect to the crack extension direction. Is there any function in MTEX for such purposes or has anyone another idea?

Reply all
Reply to author
Forward
0 new messages