P
P
Pavel K2019-10-22 01:25:39
Algorithms
Pavel K, 2019-10-22 01:25:39

What is the optimal algorithm for finding the Minkowski sum?

Greetings!
In general, subject. You need to find a lot and often. Now the built-in ClippingLib is used, but already for 300 points it counts about 4 seconds - a very long time.
What is given: Polygons are non-self-intersecting, convex and non-convex.
In addition to the algorithm in the English Wikipedia, I also found a description of this:
Find the center of mass of each, shift each so that the center of mass is at the origin (let the shift vectors A1 and A2), draw rays from the origin to the vertices of each polygon. We find the intersection points of these rays and polygons, vectorially add all pairs of points on all rays to find the vertices of the desired polygon, shift the resulting polygon by the vector (-A1, -A2). Everything.
How accurate is this algorithm? Will it be faster than the "classic" one? Maybe there is an even better one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2019-10-22
@longclaps

The algorithm is unclear. Here are two convex polygons reduced to the origin - how to resolve the "points of intersection of these rays and polygons"?
There is a feeling that it is possible to give birth to non-singly connected areas - and what to do with this smut?

W
Wataru, 2019-10-22
@wataru

For two non-convex polygons with n and m vertices, the computational complexity is (nm)^2 . For 300 vertices, this is already about a few seconds. You can tighten up a lot and speed up by a few percent. But much faster you will not find anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question