Minimum Polygon Distance
Author: | motzi |
Date: | 10 Mar, 2014 |
Category: | plugin |
Credits: |
Download
Description
Get minimal distance of two or more arbitrary convex polygons. Calculation using Rotating Calipers.
Should work with polygons of any edge point number.
Please note that:
- Polygons have to be convex
- Corner points of polygons have to be ordered clockwise
- No collision detection is performed (i.e. overlapping polygons do not have a distance of zero. Probably could use HitTest (2d Polygon)for that.
Outputs a distance matrix containing all distances between all input polygons. Also, the closest points between the polygons are supplied.
Not heavily tested - use with caution! Any feedback or suggestions for improvement is welcome. Work partly commissioned by This.Play