Open
Description
The operation XOR between to circles does not give the correct result:
from compmec.shape import Primitive
circle_left = Primitive.circle(radius = 50, center = (-15, 0))
circle_right = Primitive.circle(radius = 50, center = (15, 0))
circle_xor = circle_left ^ circle_right
Although using this operation we get the correct shape
circle_or = circle_left | circle_right
circle_and = circle_left & circle_right
circle_xor = circle_or - circle_and
The current implementation of __xor__
is theorically correct:
def __xor__(self, other):
return (self - other) | (other - self)