I am trying to use Clipper, an open source polygon clipping library, to clip an open polygon with a closed polygon.
I am using the python wrapper of pyclipper. My code is as follows:
import pyclipper
subj = [[-10, 5], [20, 5]]
clip = [[0, 0], [0, 10], [10, 10], [10, 0]]
pc = pyclipper.Pyclipper()
pc.AddPath(clip, pyclipper.PT_CLIP, True)
pc.AddPath(subj, pyclipper.PT_SUBJECT, False)
solution = pc.Execute(pyclipper.CT_INTERSECTION, pyclipper.PFT_EVENODD, pyclipper.PFT_EVENODD)
print(solution)
It seems to run up until the Execute function, then it just quits with no error message. What am I doing wrong?