Is this Minkowski Sum result correct?

109 Views Asked by At

enter image description here

Is this Minkowski Sum result correct?

enter image description here

I expected a filled shape as it happens when the two polygons don't overlap (longer translation vector).

Full discussion here: https://github.com/AngusJohnson/Clipper2/discussions/417

EDIT: Result of the same data with a longer vector:

enter image description here

1

There are 1 best solutions below

1
On

What you get is the Minkowski sum of the border of a non-closed regular pentagon and a horizontal line segment (you haven't specified to your software that the polygon was closed : you have given it vertices ABCDE instead of ABCDEA).

The longer the horizontal segment, the larger the "crab's claws" aspect : when the horizontal line segment reaches a certain length (here above $L\approx 1.2$ : see Fig. 2), the "crab claws" overlap, eventualy filling the space between them when $L$ is large enough (Fig. 3).

Instead of generating "flat" surfaces, I have generated it by plotting many instances of sums of a point in the first shape and a point in the second shape.

enter image description here

Fig. 1 : Case of a segment with length $L=0.2$.

enter image description here

Fig. 2 : Case of a segment with length $L=1.2$.

enter image description here

Fig. 3 : Case of a segment with length $L=2.2$.

Matlab program having generated these figures :

e=exp(i*2*pi/5); % powers of e represent pentagon vertices
L=0.2;
for n=1:10000 
   % random element on the line segment :
   s=L*rand; 
   % random element on the (non-closed) pentagon :
   k=floor(4*rand);r=rand;
   p=(e^(-3/4))*(r*e^k+(1-r)*e^(k+1));
   M(n)=p+s; % n-th point in Minkowski sum
end;
plot(M,'.b');hold on;
plot((e^(-3/4))*e.^(0:4),'k','linewidth',8);
plot([0,V],[0,0],'k','linewidth',8);axis equal;axis off