Skip to content

Merge grains having boundaries in common #605

Discussion options

You must be logged in to vote

Hi,
if I understand you correctly, the following should be an example of what your try to do:

mtexdata twins;
grains = ebsd.calcGrains('angle',1*degree');
cinc = grains.isInclusion;

% that looks a bit complicated
gbm = grains(cinc).boundary(all(ismember(grains(cinc).boundary.grainId,grains(cinc).id),2))

migrains = merge(grains,gbm)

plot(grains(cinc))
hold on
plot(gbm,'linecolor','r')
hold on% merge inclusions
plot(migrains(migrains.isInclusion).boundary,'linecolor','g')
hold off

Cheers,
Rüdiger

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Saoussen-ouhiba
Comment options

Answer selected by Saoussen-ouhiba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants