get_object_components#

get_object_components(domain, component_dimension=0, population=None)#

Extracts components of specified dimension from objects in a given domain.

Parameters:
domainobject

The domain containing objects from which components are to be extracted.

component_dimensionint, optional

The dimension of the components to extract (default is 0).

populationlist, np.ndarray, or query-like object, optional

Identifiers for the objects to extract components from. If None, all objects are considered.

Returns:
all_componentslist

A list of components for each object specified by objects_identifier.

object_indicesnp.ndarray

An array of object indices that were processed.

Raises:
ValueError

If component_dimension is greater than the domain dimension.

NotImplementedError

If the requested operation is not implemented for the given object type or component dimension.

Notes

  • The function currently supports objects of type ‘point’, ‘line’, and ‘shape’.

  • For ‘line’ and ‘shape’ objects, the function can return vertices or line segments based on component_dimension.

  • For ‘shape’ objects, polygon extraction is not implemented for component_dimension > 1.

Examples

>>> components, indices = get_object_components(domain, component_dimension=1, objects_identifier=[1, 2, 3])