LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Polygon_Size Increase Fixed Distance from Points

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.

0 Kudos
Message 1 of 13
(4,517 Views)

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 😉

Message Edited by battler. on 05-25-2010 10:39 PM
0 Kudos
Message 2 of 13
(4,504 Views)

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..


 

 
 Sorry, I don't understand your definition of the problem. Could you be a bit more specific.
 
First you talk about resizing, but later about shifting. If you resize the polygon, there is generally no fixed distance of translation that would apply to all sides, so I am confused. Do you also allow rotations?
 
Here's a quick and very simple VI that allows you to scale, translate, and rotate the polygon. I am not sure if that's what you want. 
 
 
Message 3 of 13
(4,492 Views)

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.

0 Kudos
Message 4 of 13
(4,478 Views)

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.

 

Polygon distance issue.jpg

0 Kudos
Message 5 of 13
(4,473 Views)

I need to Offset the Polygon as described here.

 

offset polygon with circle.jpg

Message Edited by battler. on 05-26-2010 07:27 AM
0 Kudos
Message 6 of 13
(4,459 Views)

battler. wrote:

I need to Offset the Polygon as described here.


 

Ah, now we are getting somewhere. It's all in the right description! This looks quite fancy!
 
(I probably won't have time today to look into this.)
0 Kudos
Message 7 of 13
(4,445 Views)

I will have a go at it today.

0 Kudos
Message 8 of 13
(4,429 Views)

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:

0 Kudos
Message 9 of 13
(4,401 Views)

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.

 

Polygon Offset.jpg

Message Edited by battler. on 05-27-2010 07:03 PM
0 Kudos
Message 10 of 13
(4,399 Views)