Datasets:

ArXiv:
License:
File size: 300 Bytes
24702c6
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from shapely.geometry import Polygon
from shapely import affinity


def is_included(points_0, points_1, soft=0.2):
    polygon_0 = Polygon(points_0)
    polygon_1 = Polygon(points_1)
    polygon_1 = affinity.scale(polygon_1, xfact=1. - soft, yfact=1. - soft)
    return polygon_0.contains(polygon_1)