| 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) | |