05-25-2010 09:44 PM
Hi all,
Irregular Polygon defined by XY Points (vertices). This polygon has certain dimensions. Ultimately I would like to resize the polygon so that the sides of the new polygon are a fixed distance from the original polygon.
I'm not sure if I just shift X,Y co-ordinates the desired distance (in the right direction - considering that the polygon can be any orientation) or I need to consider angles from a reference vertex as well..
Can anybody help me with this?
I have attached a VI with initialised cluster of polygon XY vertices.
Thanks a lot,
Battler.
05-25-2010 10:36 PM - edited 05-25-2010 10:39 PM
Update.
Is it as simple as attached VI?
If it is then I hope it helps somebody else and I can stop talking to myself now 😉
05-26-2010 01:26 AM
battler. wrote:Ultimately I would like to resize the polygon so that the sides of the new polygon are a fixed distance from the original polygon.
I'm not sure if I just shift X,Y co-ordinates the desired distance (in the right direction - considering that the polygon can be any orientation) or I need to consider angles from a reference vertex as well..
05-26-2010 05:52 AM
Hi altenbach,
I want to define another polygon which is a fixed (the same) distance from the edge (right the way around) of the original polygon.
altenbach wrote:generally no fixed distance of translation that would apply to all sides
That worries me..
Thanks for your help.
05-26-2010 06:04 AM
A problem may be at the corners.
Even though the distance between the sides of the original and new polygon is the required (in this example) distance = 2. At the corners the distance is not maintained.
05-26-2010 07:25 AM - edited 05-26-2010 07:27 AM
05-26-2010 10:59 AM
battler. wrote:I need to Offset the Polygon as described here.
05-26-2010 04:52 PM
I will have a go at it today.
05-27-2010 06:47 PM
A common method is to use a Minkowski sum of two polygons (the main polygon P and another offset polygon). Basically you run the offset polygon around the outside edge of P and use convolution to create the new polygon with offset.
It is tricky to implement a robust algorithm using Minkowski sums especially with floats. There is some example (although incomplete) code in "Computational Geometry in C", J. O'Rourke - an excellent text BTW - for a Minkowski sum between convex polygon and square offset polygon.
Anyway to cut a long story short, I'll post some info to discuss:
05-27-2010 07:00 PM - edited 05-27-2010 07:03 PM
The problem is at the vertexes (both convex and concave) where the offset distance is enlarged. Note that the Polygon in my application consists of straight-line segments.