08-11-2005 09:21 AM
08-11-2005 09:30 AM
Depending on how the area is defined, it may be fairly easy to write code to calculate this.
Is this IMAQ? Picture Control? VI coords? Something else?
How are you defining the area? Rectangle? Circle? Array of coordinates?
08-11-2005 09:48 AM
The area that I obtain is irregular and this defined one for points (for example for 20).
it is not a regular area as a square or an I circulate.
With this area I have to create a mesh of points in their interior, and I want that the one limits it is the area.
08-12-2005 02:23 AM
The IMAQ tools can probably do this, but since I don't use it, I'll give you a direction.
I just came up with a much simpler solution, but I will include my original idea as well just in case. The simple solution is this - Create a picture control even if you're not using one. You don't even need to see it. Use the coordinates array with Draw Multiple Lines to draw a filled shape, then use Picture to Pixmap, unflatten the pixmap and check the value of the pixel. If it's black, it's in the shape. If it's white it isn't. Simple as that.
My original thought:
This is probably not the most efficient way to do this, but I think it should work. I will assume that you use the picture control, but this can probably be adapted for other coordinates. One additional assumption is that the points are in order in the array and that there are no intersecting lines.
The method is basically this - First, use a for loop with an unbundle to seperate the X and Y arrays and check if either the X or Y of your point is outside this range. If either of them is outside the range, your point is not in the shape.
Then, you could start using geometry to calculate to start calculating the distance from that point to all the lines of the shape, find the closest one and go from there.
08-15-2005 10:34 PM
08-17-2005 12:15 PM
08-17-2005 11:39 PM
You're welcome... Glad it worked for you.
Randy