cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
psylo
Contributor

Point inside a polygon using Polygon Operations Macro

Hi !

First of all, english isn't my native langage, forgive me if my message isn't correct english

I post a message in official Graphisoft forum (http://gdl.graphisoft.com) but without any answer yet ...

----

I try to display a grid of items in a custom polygon.

I define a polygon with 3 hotspots, then I test a grid of points with the Polygon Operations Macro to know if the point are inside. I draw the item if the point is inside or on the contour of the polygon.

I often encounter strange results. Some points are considered on the contour of the polygon even they are not …

I did not find where the error or the bug is, it happens only with specific value.

I enclose a simplified version of the object with default values causing the problem …

Did someone or object of the official library use this macro for this purpose? Have you ever noticed this bad behavior ? Is there a way around this problem?

Thank you in advance,
SimPey.
3 Replies 3
psylo
Contributor
Example image
test polygon operation macro.jpg
Pertti Paasky
Expert
Try this:
Lines 41-42
! IF ret=1 OR ret=3 OR ret=4 THEN
IF ret=1 OR ret=4 THEN
Maybe ret=3 means that the point is on the line but not necessarily between the points.
Perhaps You should test it properly but it worked fine by me.
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
psylo
Contributor
Hello !

I forgot to update this message with Graphisoft official response I got on the GDL forum (http://gdl.graphisoft.com/forums/topic/point-inside-a-polygon-using-polygon-operations-macro/).

You have well spotted the problem: the macro will not only find if a point is on a segment of the contour but also on the lines formed by the segments of the contour.

Too bad ! It looks like a bug to me but I do not think it will being fixed!

Thanks for your help.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!