Install libpolyclipping22 by entering the following commands in the terminal:
sudo apt update sudo apt install libpolyclipping22
polygon clipping, polygon offsetting and polyline offsetting library
The Clipper library performs polygon clipping, polygon offsetting and polyline offsetting. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Also, there are no restrictions on the types of polygons that can be clipped - they can have holes, be self-intersecting, have coincident edges etc.