combine_shapes#
- combine_shapes(domain, shapes_identifier_A, shapes_identifier_B=None, operation='union', collection_name=None, delete_existing=False, return_IDs=False, verbose=False)#
Combine two shapes in the domain using a specified operation.
- Parameters:
- domaindomain
Domain within which to combine shapes.
- shapes_identifier_Alist or np.ndarray or query-like
Identifier for the first set of shapes. Should be a 1D array or a query-like object.
- shapes_identifier_Blist or np.ndarray or query-like, optional
Identifier for the second set of shapes. Should be a 1D array or a query-like object. Only specified if operation is ‘subtract’
- operationstr, optional
The operation to perform on the shapes. Options are ‘subtract’, ‘add’, ‘intersection’, ‘union’. Default is ‘union’.
- collection_namestr, optional
Name of a collection to add new shapes to. If None, shapes will be added to the default collection.
- delete_existingbool, optional
If True, delete the old objects from the domain and add the new combined shape. Default is False. Properties (labels, collections, etc.) will be inherited where they match between the two shapes, or otherwise excluded.
- return_IDsbool, optional
If True, return a list of new object IDs created by combine_shapes.
- verbosebool, optional
If True, print more useful information when doing differences. Default is False.
- Returns:
- IDsndarray, optional
If return_IDs is True, returns an array of object IDs corresponding to the newly created shapes
- Raises:
- ValueError
If the operation is not recognized, or if the identifiers are not valid, or if more than one shape is passed in each identifier.
- NotImplementedError
If the operation ‘union’ or ‘add’ is selected, or if the function is not fully implemented.
Notes
This function currently only supports combining two shapes at a time. The behavior for lists of multiple shapes is not yet defined.