Point inside a polygon using Polygon Operations Macro
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-06-08 02:54 PM
2016-06-08
02:54 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-06-08 02:56 PM
2016-06-08
02:56 PM
Example image
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-07-11 05:10 PM
2016-07-11
05:10 PM
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.
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.
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-07-12 11:28 AM
2016-07-12
11:28 AM
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.
I forgot to update this message with Graphisoft official response I got on the GDL forum (
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.