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