round_polygon

Contents

round_polygon#

zeroheliumkit.src.utils.round_polygon(polygon: Polygon, round_radius: float, **kwargs) Polygon[source]#

Rounds the corners of a polygon by applying a buffer operation.

Parameters:
Returns:

A new polygon with rounded corners.

Return type:

Polygon

Example

>>> polygon = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
>>> rounded_polygon = round_polygon(polygon, round_radius=0.1)
>>> print(rounded_polygon)
    POLYGON ((0.1 0, 0.9 0, 1 0.1, 1 0.9, 0.9 1, 0.1 1, 0 0.9, 0 0.1, 0.1 0))