Пример #1
0
def to_polygon_vertices(polygon: Polygon) -> Iterable[Point]:
    return chain(polygon.border.vertices,
                 flatten(hole.vertices for hole in polygon.holes))
Пример #2
0
def to_polygon_edges(polygon: Polygon) -> Iterable[Segment]:
    return chain(to_contour_segments(polygon.border),
                 flatten(map(to_contour_segments, polygon.holes)))
Пример #3
0
def to_multipolygon_vertices(multipolygon: Multipolygon) -> Iterable[Point]:
    return flatten(map(to_polygon_vertices, multipolygon.polygons))
Пример #4
0
def to_multiregion_edges(multiregion: Multiregion) -> Iterable[Segment]:
    return flatten(map(to_region_edges, multiregion))
Пример #5
0
def to_multipolygon_edges(multipolygon: Multipolygon) -> Iterable[Segment]:
    return flatten(map(to_polygon_edges, multipolygon.polygons))