ladybug_geometry_polyskel.polysplit module

Functions for splitting a polygon into sub-polygons based on skeleton topology.

ladybug_geometry_polyskel.polysplit.perimeter_core_subfaces(face, distance, tolerance=1e-05)[source]

Compute perimeter and core Face3Ds using the straight skeleton of an input Face3D.

Parameters:
  • face – A Face3D to split into perimeter and core sub-faces.

  • distance – Distance to offset perimeter sub-faces.

  • tolerance – Tolerance for point equivalence. (Default: 1e-5).

Returns:

A tuple with two items.

  • perimeter_sub_faces – A list of Face3Ds for perimeter sub-faces.

  • core_sub_faces – A list of Face3D for core sub-faces.

ladybug_geometry_polyskel.polysplit.perimeter_core_subfaces_and_skeleton(face, distance, tolerance=1e-05)[source]

Compute perimeter and core Face3Ds using the straight skeleton of an input Face3D.

Parameters:
  • face – A Face3D to split into perimeter and core sub-faces.

  • distance – Distance to offset perimeter sub-faces.

  • tolerance – Tolerance for point equivalence. (Default: 1e-5).

Returns:

A tuple with two items.

  • skeleton – A list of LineSegment3D for the segments of the straight

    skeleton being used to generate core/perimeter polygons.

  • perimeter_sub_faces – A list of Face3Ds for perimeter sub-faces.

  • core_sub_faces – A list of Face3D for core sub-faces.

ladybug_geometry_polyskel.polysplit.perimeter_core_subpolygons(polygon, distance, holes=None, tolerance=1e-05, flat_core=True)[source]

Compute perimeter and core sub-polygons using the polygon straight skeleton.

Parameters:
  • polygon – A Polygon2D to split into perimeter and core sub-polygons.

  • distance – Distance to offset perimeter sub-polygons.

  • holes – A list of Polygon2D objects representing holes in the polygon. (Default: None).

  • tolerance – Tolerance for point equivalence. (Default: 1e-5).

  • flat_core – A boolean to note whether the core_sub_polys should be returned as a flat list or as a nested list of lists for boundaries and holes within each geometry.

Returns:

A tuple with two items.

  • perimeter_sub_polys – A list of Polygon2Ds for perimeter sub-polygons.

  • core_sub_polys – When flat_core is True, this will be a list of Polygon2D

    where each Polygon2D represents a loop in the core geometry. When flat_core is False, this will be a list of lists where each sub-list contains Polygon2Ds and represents one core geometry. The sub-list will have has at least one Polygon2D in it and, in the event that a core geometry has holes, there will be multiple Polygon2Ds in the sub-list. The first item in the list will be the outer boundary of the geometry and successive items represent hole polygons.

ladybug_geometry_polyskel.polysplit.perimeter_core_subpolygons_and_skeleton(polygon, distance, holes=None, tolerance=1e-05)[source]

Get perimeter and core sub-polygons with line segments for the straight skeleton.

Parameters:
  • polygon – A Polygon2D to split into perimeter and core sub-polygons.

  • distance – Distance to offset perimeter sub-polygons.

  • holes – A list of Polygon2D objects representing holes in the polygon. (Default: None).

  • tolerance – Tolerance for point equivalence. (Default: 1e-5).

Returns:

A tuple with three items.

  • skeleton – A list of LineSegment2D for the segments of the straight

    skeleton being used to generate core/perimeter polygons.

  • perimeter_sub_polys – A list of Polygon2Ds for perimeter sub-polygons.

  • core_sub_polys – A list of lists where each sub-list contains Polygon2Ds

    and represents one core geometry. The sub-list will have has at least one Polygon2D and, in the event that a core geometry has holes, there will be multiple Polygon2Ds in the sub-list. The first item in the list will be the outer boundary of the geometry and successive items represent hole polygons.