It looks like you're new here. If you want to get involved, click one of these buttons!
I am trying to perform an XOR function on two polygons.
I tried using the solution mentioned in the following question and followed instructions on this page:
Here is my attempt on using the EdgeProcessor:
points1 = [pya.Point(0/0.001,-10/0.001), pya.Point(0/0.001,0/0.001), pya.Point(4/0.001,0/0.001), pya.Point(4/0.001, -10/0.001)]
points2 = [pya.Point(-3/0.001,-7/0.001), pya.Point(-3/0.001,0/0.001), pya.Point(5/0.001,0/0.001), pya.Point(5/0.001,-7/0.001)]
a = pya.Polygon(points1)
b = pya.Polygon(points2)
ep = pya.EdgeProcessor()
ep.boolean_p2p(a, b, ep.ModeXor, False, False)
but it gave the following error:
Expected a list or tuple for argument or return type in
EdgeProcessor.boolean_p2p
Thank you for your support.
Jaspreet
Comments
Figured it out.
Here is the code:
Hi,
very good :-)
That is exactly the preferred solution (instead of xor you can write
a ^ b
). The Region object is a newer one that shields you from the trouble with the edge processor and similar things.Matthias