For some grain maps, checkInside does not return the correct values when using setMTEXpref('insidepoly',true) when used with 'includeBoundary'. However, this does not occur on all maps and it always is the side with the largest X-values of vertices of grains. No issue with inpolygon, setting setMTEXpref('insidepoly',false).
Example:
load('grains.mat')
setMTEXpref('insidepoly',true)
plot(grains)
hold on
plot(grains(grains.isOuterBoundary('delta',1)),'FaceColor','k','lineColor','w')
hold off
setMTEXpref('insidepoly',false)
plot(grains)
hold on
plot(grains(grains.isOuterBoundary('delta',1)),'FaceColor','k','lineColor','w')
hold off
It seems that using a "much" larger tolerance might help
|
ontol = 1e-9*max(Pxmax-Pxmin,Pymax-Pymin); |
but however, than points at the boundary seem to be always inside - even if not desired.
grains.zip

For some grain maps,
checkInsidedoes not return the correct values when usingsetMTEXpref('insidepoly',true)when used with'includeBoundary'. However, this does not occur on all maps and it always is the side with the largest X-values of vertices of grains. No issue with inpolygon, settingsetMTEXpref('insidepoly',false).Example:
It seems that using a "much" larger tolerance might help
mtex/extern/insidepoly/insidepoly.m
Line 127 in 876336f
but however, than points at the boundary seem to be always inside - even if not desired.
grains.zip