convexity#
- convexity(domain, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, add_as_label=True, label_name='Convexity', cmap='viridis')#
Returns the convexity of shape objects in the domain. Convexity is defined as the area of the shape divided by the area of the convex hull. Add results as a label if required.
- Parameters:
- domainobject
The domain containing the objects and vertices.
- populationquery-like, optional
The query to select specific objects. Can be of type query, list, tuple, array, or int. Defaults to None.
- include_boundariesarray-like, query-like, or None, optional
Boundaries to include in the analysis. Defaults to None.
- exclude_boundariesarray-like, query-like, or None, optional
Boundaries to exclude from the analysis. Defaults to None.
- boundary_exclude_distancefloat, optional
Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.
- add_as_labelbool, optional
Whether to add the convexity results as a label to the domain. Defaults to True.
- label_namestr, optional
The name of the label to add. Defaults to ‘Convexity’.
- cmapstr, optional
The colormap to use if adding labels. Defaults to ‘viridis’.
- Returns:
- convexitieslist
A list of convexity values for the selected objects.
- object_indiceslist
A list of indices of the selected objects.