Re: Exporting grain boundaries as x-y coordinates

171 views
Skip to first unread message

fl.ba...@googlemail.com

unread,
Apr 8, 2013, 1:36:21 PM4/8/13
to mtex...@googlegroups.com
Dear Andrew,

the vertices of the grain boundary are stored in the field 'V'. In a GrainSet the fields 'x', 'y', 'z' respectively, refer to the spatial ebsd coordinates. so to access vertices of a specific grain one can use

V = get( grains(subset) ,'V');
plot
(V(:,1),V(:,2),'.')

however, a move conveniant way would be to make use of the incidency matrix vertices incident to grains

I_VG = get(g,'i_vg');

then

V = V(any(I_VG,2),:);
plot
(V(:,1),V(:,2),'.')
axis
('equal','tight')

nevertheless, the resulting V is not an ordered field. To get Vertices right, you can access the polygons by

V     = get(grains,'V')
order
= get(grains,'boundaryEdgeOrder')

and then it relates by

V(order{1},:)

since some grains may have holes, some cells of the order variable may contain severel cells. Note that the indices used in the order variable are global, so be sure you use the right V.

florian.
Reply all
Reply to author
Forward
0 new messages