Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#31 Varying position of polygons in results Array.


Hi ,I am not sure its a bug but here is what I found ,If I do a difference test for two polys whereas the clip object is inside the subject (that is hole) sometimes it return the subject at the index =1 of the array and on other cases index=0. It goes that way in C++ 4.7 version


  • Angus Johnson
    Angus Johnson

    Hi Michael. Could you please provide a simple example where the 'subject' (by which I presume you mean the outer contour of the solution) is at index 1 (and presumably the hole contour is at index 0).

  • Michael

    What you see here is a result of test where the first set of points is the hole polygon which is contained inside the second set.The names I printed here in fact should be conversely .In the test I pass the second (smaller ) set as the subject and the bigger set (which is here marked as subject) I pass as the clip poly.So at the result the swap places in the array. It doesn' t happen btw ,if I test this hole poly against a simple rectangle...

    Vector3D(-4, 49, 0)
    Vector3D(5, 49, 0)
    Vector3D(15, 45, 0)
    Vector3D(23, 39, 0)
    Vector3D(28, 30, 0)
    Vector3D(30, 20, 0)
    Vector3D(30, 19, 0)
    Vector3D(28, 9, 0)
    Vector3D(23, 0, 0)
    Vector3D(14, -5, 0)
    Vector3D(4, -9, 0)
    Vector3D(-5, -9, 0)
    Vector3D(-15, -5, 0)
    Vector3D(-23, 0, 0)
    Vector3D(-28, 9, 0)
    Vector3D(-30, 20, 0)
    Vector3D(-28, 30, 0)
    Vector3D(-23, 39, 0)
    Vector3D(-14, 45, 0)
    Vector3D(-100, 200, 0)
    Vector3D(-100, -200, 0)
    Vector3D(-31, -200, 0)
    Vector3D(-60, -150, 0)
    Vector3D(-24, -89, 0)
    Vector3D(45, -89, 0)
    Vector3D(80, -150, 0)
    Vector3D(50, -200, 0)
    Vector3D(200, -200, 0)
    Vector3D(200, 200, 0)

  • Angus Johnson
    Angus Johnson

    Thanks Michael. I hope to look at this shortly but I'm currently working on another bug.

  • Michael

    My bad. I haven't explained it well .Forget about the names I gave here to the two sets.Because those mean the places of returning sets.When you pass them into the clipper you should pass the second (clip set) as the subject and the bigger set as the clip which forms a contained hole as you already notices. And you will get what I mean. Then do the same but instead of my subject pass any simple rectangle set and you get polys in the result array swap places.

  • Michael

    Ok,no problem I found a way around.Good also to know that is not a bug :) Thanks for your fast response.



Cancel   Add attachments