I have a polyshape vector "pv" consisting of 4 adjacent triangles:
Why is it that when the polyshape vector elements are ordered one way, the "union" operation successfully consolidates them, whereas in the reverse order, it does not?
load tstcase_pv
pv1=pv([4,1,2,3]);
plot(union(pv1))
load tstcase_pv
pv1=pv([4,1,2,3]);
plot(union(pv1))
As an additional observation, I find that if the union is performed incrementally on two of the "pv(i)" at a time, using a for-loop, the problem does not manifest. Moreover, this is irrespective of the loop order.
load tstcase_pv
u=polyshape();
for i=randperm(4);
u=union(u,pv(i));
end
plot(u)