ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I find out if a point is inside a polygon?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
487 Views, 4 Replies

How can I find out if a point is inside a polygon?

I want to know how you guys find out a point if it is inside a polygon and
that's not
since a sometime i found it from AND website but it's just allowed only for
MCAD

what i use with ARX

thanks for read and sorry for my fooling words
4 REPLIES 4
Message 1 of 5
dgoceva
in reply to: Anonymous

You should be used AcGeBoundBlock2d (or AcGeBoundBlock3d)class, that has cointains() method.
Message 3 of 5
Anonymous
in reply to: Anonymous

Halloo,

The AcGeBoundBlock2d solution dose not work for every polygon, especially if
it is not rectangle or box.
If you do have OMF you can use AecGeRing::pointInRing after you converted the
polyline to a ring.
If you don't have OMF then I think you need to create a function by your self.

Regards,
Andrei

honesty man wrote:

> I want to know how you guys find out a point if it is inside a polygon and
> that's not
> since a sometime i found it from AND website but it's just allowed only for
> MCAD
>
> what i use with ARX
>
> thanks for read and sorry for my fooling words
Message 4 of 5
Anonymous
in reply to: Anonymous

1. draw a ray from your point in any direction
2. count how many times does your ray intersect with edges of your polygon
2.1. if count is odd (1, 3, 5, 7, ...) then the point is inside polygon
2.2. if count is even or zero (0, 2, 4, 6, ...) the point is outside
polygon


"honesty man" wrote in message
news:D7EB38CA39FAC407C2A142FF8C0F1ABA@in.WebX.maYIadrTaRb...
> I want to know how you guys find out a point if it is inside a polygon and
> that's not
> since a sometime i found it from AND website but it's just allowed only
for
> MCAD
>
> what i use with ARX
>
> thanks for read and sorry for my fooling words
>
>
Message 5 of 5
Anonymous
in reply to: Anonymous

See the discussion thread on 3/9/02 called "Point inside my
entity". There is a sample program that shows how to use the
intersectWith function of AcDbEntity.

Paul Kohut

"honesty man" wrote in message
news:D7EB38CA39FAC407C2A142FF8C0F1ABA@in.WebX.maYIadrTaRb...
> I want to know how you guys find out a point if it is inside a polygon and
> that's not
> since a sometime i found it from AND website but it's just allowed only
for
> MCAD
>
> what i use with ARX
>
> thanks for read and sorry for my fooling words
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost