Storing all internal coordinates of rectangle in array?

Storing all internal coordinates of rectangle in array?

Anonymous
Not applicable
313 Views
5 Replies
Message 1 of 6

Storing all internal coordinates of rectangle in array?

Anonymous
Not applicable
Hello everybody,
I am doing my term project at university of alberta. I am developing an algorithem using VBA in AutoCAD. I am trying to store all the x,y coordinates which are enclosed in a rectangle or a closed polygon in an array variable. This problem may be very simple but i am stupid not to understand it.

Thanks in advance

MA Niaz
0 Likes
314 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Since there would be an infinite number of possible x,y coordinates in a
polygon it appears that your question needs clarification. Do you mean the
x,y coordinates of existing entities enclosed by a polygon?

Gary
0 Likes
Message 3 of 6

Anonymous
Not applicable
As Gary pointed out, calculating *every* point is a
daunting task. Since you know the X and Y ordinates of each corner point, simple
comparisons to any given point will determine whether the point is internal to,
or coincident with, the rectangle.


--
There are 10 kinds of people. Those who understand binary and
those who don't.

 

http://code.acadx.com
(Pull the pin
to reply)


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hello
everybody,
I am doing my term project at university of alberta. I am
developing an algorithem using VBA in AutoCAD. I am trying to store all the
x,y coordinates which are enclosed in a rectangle or a closed polygon in an
array variable. This problem may be very simple but i am stupid not to
understand it.

Thanks in advance

MA Niaz

0 Likes
Message 4 of 6

Anonymous
Not applicable
If your polygon is not a rectangle, see the thread in this group titled
"region" by villaco 10/20/2003

The solutions offered therein may be of some help to you.

Gary
0 Likes
Message 5 of 6

Anonymous
Not applicable
Infact i need all the internal points inside a closed polygon or rectangle.
Just consider a closed area, i have a crane to work in that area. My algorithem needs to place crane on each point inside or on the boundery of that area. This way my algorithem will tell me which position is best for crane location.
Thanks
Mniaz
0 Likes
Message 6 of 6

Anonymous
Not applicable
Hi Mniaz,

As Gary pointed out there are an infinite number of Points inside a closed
areas.

You will have to decide on a practical spacing for the points and only
examine points at that spacing.

An approach I used for a similar problem was to draw a hatch with the Hatch
style "DOT" inside the closed polyline.

When you explode the hatch you end up with AutoCAD Points on the layer where
you draw the hatch.

From there you can make a selection of the points and use the point
coordinates as potential crane locations.

The advantage of this process is that you allow AutoCAD to do all the
complex computations of whether the point is inside the polygon or not.

--


Laurie Comerford
CADApps
www.cadapps.com.au


"mniaz" wrote in message
news:f196454.3@WebX.maYIadrTaRb...
> Infact i need all the internal points inside a closed polygon or
rectangle.
> Just consider a closed area, i have a crane to work in that area. My
algorithem needs to place crane on each point inside or on the boundery of
that area. This way my algorithem will tell me which position is best for
crane location.
> Thanks
> Mniaz
0 Likes