It looks like you're new here. If you want to get involved, click one of these buttons!
# A = 1/0, B = 2/0 (example)
a = input(1, 0)
b = input(2, 0)
# run XOR and output to 2/0
x = a ^ b
# copy A to output
ly = pya.Layout()
l1 = ly.layer(1, 0)
l2 = ly.layer(2, 0)
r1 = pya.Region(ly.top_cell().begin_shapes_rec(l1))
r2 = pya.Region(ly.top_cell().begin_shapes_rec(l2))
rxor = r1 ^ r2
Also, like for this XOR operation. I tried to search "XOR", "boolean" etc. I didn't find a page describing boolean operations and what class can be used as input.
Hi, Matthias. I tried the code. It works. Thanks.