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