Minkowski Operations in 2D¤
compas_model.geometry.minkowski2
¤
Functions:¤
bottomleft
¤
det
¤
minkowski_difference_xy
¤
Compute the Minkowski difference of convex polygons A and B in the XY plane.
Parameters:
Returns:
-
Polygon–The polygon representing the difference as the sum of A and -B.
Warnings
Currently only convex polygons are supported.
See Also
Notes
The Minkwoski "difference" of two polygons A and B, can be formulated as the Minkowski sum of A and inverted B: A + (-B). 1
A useful application of the Minkowski difference of two convex polygons A and B is collision detection. If the origin (0, 0) is contained in the difference polygon A + (-B), then a collision between A and B exists.
-
https://en.wikipedia.org/wiki/Minkowski_addition ↩
Examples:
>>> from compas.geometry import Polygon
>>> from compas.geometry import is_point_in_convex_polygon_xy
>>> from compas_model.geometry import minkowski_difference_xy
minkowski_sum_xy
¤
Compute the Minkowski sum of two polygons.
Parameters:
Returns:
-
Polygon–The polygon representing the sum.
Warnings
Currently only convex polygons are supported.