get_centroids#
- get_centroids(domain, population=None)#
Retrieve the centroids of specified objects within a domain.
- Parameters:
- domainDomain
The domain containing the objects.
- populationquery-like, optional
Population of objects to retrieve centroids for. If None, centroids for all objects in the domain are retrieved.
- Returns:
- object_centroid_arraynp.ndarray
An array of centroids for the specified objects.
- object_indicesnp.ndarray
An array of the object indices that were used to retrieve the centroids.
Notes
The function first checks if population is None. If so, it retrieves centroids for all objects in the domain. If population is provided, this is interpreted into object_IDs and centroids are returned.