ladybug_geometry_polyskel.offset module¶
Functions for offsetting a polygon using the straight skeleton.
- ladybug_geometry_polyskel.offset.offset_perimeter_polygons(polygon, distance, tolerance=1e-05)[source]¶
Get a list of Polygon2Ds along the perimeter of an input polygon.
These can be used to split the input polygons into core/perimeter shapes. Assuming that the input is not self-intersecting, the resulting shapes should have all self-intersections resolved through the straight skeleton.
- Parameters:
polygon – A Polygon2D to be offset inwards or outwards by a given distance.
distance – The distance inwards that the polygon will be offset. Positive values will always be offset inwards while negative ones will be offset outwards.
tolerance – Tolerance for point equivalence. (Default: 1e-5).
- ladybug_geometry_polyskel.offset.offset_polygon(polygon, distance, tolerance=1e-05)[source]¶
Offset a Polygon2D by a given distance inwards or outwards.
Assuming that the input is not self-intersecting, the resulting shapes should have all self-intersections resolved through the straight skeleton. However, if the distance is large enough, the result may be an empty list.
- Parameters:
polygon – A Polygon2D to be offset inwards or outwards by a given distance.
distance – The distance inwards that the polygon will be offset. Positive values will always be offset inwards while negative ones will be offset outwards.
tolerance – Tolerance for point equivalence. (Default: 1e-5).
- ladybug_geometry_polyskel.offset.offset_skeleton(polygon, distance, tolerance=1e-05)[source]¶
Get a list of LineSegment2D for the straight used to offset a polygon.
- Parameters:
polygon – A Polygon2D to be offset inwards or outwards by a given distance.
distance – The distance inwards that the polygon will be offset. Positive values will always be offset inwards while negative ones will be offset outwards.
tolerance – Tolerance for point equivalence. (Default: 1e-5).