Ideally I need algorithm that can return bool if one polygon
overlapped/intersected by another. But I do not know math.
After some googling I found topic on SO[1] about point
inside/outside polygon. It's not directly what I need, but as
temporal solution would be enough.
Maybe somebody alrea
On Tue, Jul 26, 2016 at 01:32:00PM +, Suliman via Digitalmars-d-learn wrote:
> Ideally I need algorithm that can return bool if one polygon
> overlapped/intersected by another. But I do not know math.
Are you talking about triangles, or general polygons? Are the polygons
convex or arbitrary?
I have arbitrary polygon. I need any solution. Performance is
does not matter at current moment.
On Tue, Jul 26, 2016 at 05:38:43PM +, Suliman via Digitalmars-d-learn wrote:
> I have arbitrary polygon. I need any solution. Performance is does not
> matter at current moment.
In that case, maybe you'd want to look at:
https://en.wikipedia.org/wiki/Vatti_clipping_algorithm
Note, ho
On Tuesday, 26 July 2016 at 17:38:43 UTC, Suliman wrote:
I have arbitrary polygon. I need any solution. Performance is
does not matter at current moment.
A polygon is made up of lines. For a point to be inside a convex
polygon, it must be to the "right" of all the lines with
clockwise orienta
On Tue, Jul 26, 2016 at 06:39:58PM +, Gorge Jingale via Digitalmars-d-learn
wrote:
> On Tuesday, 26 July 2016 at 17:38:43 UTC, Suliman wrote:
> > I have arbitrary polygon. I need any solution. Performance is does not
> > matter at current moment.
>
> A polygon is made up of lines. For a point
On Tuesday, 26 July 2016 at 19:08:09 UTC, H. S. Teoh wrote:
On Tue, Jul 26, 2016 at 06:39:58PM +, Gorge Jingale via
Digitalmars-d-learn wrote:
On Tuesday, 26 July 2016 at 17:38:43 UTC, Suliman wrote:
> I have arbitrary polygon. I need any solution. Performance
> is does not matter at curren
The algorithm is to draw a horizontal (or vertical) half line
starting at your point and count the number of polygon edges
crossed by the line. If that number is even, the point is outside
the polygon, if it's odd, the point is inside.
Let (x,y) be the point to test and (x1,y1)(x2,y2) the end
On Wednesday, 27 July 2016 at 08:40:15 UTC, chmike wrote:
The algorithm is to draw a horizontal (or vertical) half line
starting at your point and count the number of polygon edges
crossed by the line. If that number is even, the point is
outside the polygon, if it's odd, the point is inside.
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
...
Big thanks!
Ehm... Now I should add iteration on array of points in first
and second polygon? If it's not hard for you could you show how
it should look please.
Sorry, I may have misunderstood the initial problem. You were
askin
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
On Wednesday, 27 July 2016 at 08:40:15 UTC, chmike wrote:
The algorithm is to draw a horizontal (or vertical) half line
starting at your point and count the number of polygon edges
crossed by the line. If that number is even, the point
On Wednesday, 27 July 2016 at 12:47:14 UTC, chmike wrote:
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
...
Big thanks!
Ehm... Now I should add iteration on array of points in first
and second polygon? If it's not hard for you could you show
how it should look please.
Sorry, I
On Wednesday, 27 July 2016 at 14:56:13 UTC, Suliman wrote:
On Wednesday, 27 July 2016 at 12:47:14 UTC, chmike wrote:
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
clip
Sorry, its my issue I am thinging about polygons, but for me
would be enought points.
The problem is next. I am
On Tuesday, 26 July 2016 at 13:32:00 UTC, Suliman wrote:
Ideally I need algorithm that can return bool if one polygon
overlapped/intersected by another. But I do not know math.
After some googling I found topic on SO[1] about point
inside/outside polygon. It's not directly what I need, but as
14 matches
Mail list logo