Reputation: 8277
I don't know if the process has a specific name. I want to get the polygon which is created by translating a polygon. Is there an algorithm for this. For example:
.
Convex hull works for convex polygons but I want a general solution. Also I would be happy to hear if there is a way to get the polygon created by rotating.
Upvotes: 2
Views: 139
Reputation: 221
It appears you are looking for the Minkowski sum of your polygon and the line segment describing your movement.
The CGAL library package 2D Minkowski Sums can compute them for instance.
Upvotes: 4
Reputation: 46990
Given the explanation you gave in comments, the straightforward approach is this:
Let v be a vector describing the linear movement
For each edge (p,q) in the polygon
construct quadrilateral (p, q, q+v, p+v)
Compute the union of all the quadrilaterals plus the original polygon
Computing polygon unions is a well-studied problem with efficient algorithms.
Upvotes: 2