minkowskiSum

Compute the Minkowski sum of any two polygons or polyshapes, convex or concave.
99 Downloads
Aktualisiert 1 Dez 2022

Lizenz anzeigen

The Minkowski sum of two polygons
is simply computed for two convex polygons, but if they may be more general with concavities, the sum is slightly more complex. minkowskiSum will work for any pair of polygons (even self-intersecting polygons), returning a polyshape as a result.
Pa = polyshape([-1 2;0 2;-0.75 2.25;-1 3]);
Pb = polyshape([1 0;2 0;3 1;4 3;2 .3]);
plot(Pa)
hold on
plot(Pb)
MSumShape = minkowskiSum(Pa,Pb)
MSumShape =
polyshape with properties:
Vertices: [8×2 double]
NumRegions: 1
NumHoles: 0

Zitieren als

John D'Errico (2024). minkowskiSum (https://www.mathworks.com/matlabcentral/fileexchange/121478-minkowskisum), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2022b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0