return_intersection_of_shapes#
- return_intersection_of_shapes(domain, shape_A, shape_B)#
Compute the intersection of two shapes within a given domain. The function decomposes each shape into polygons representing external boundaries and internal voids. The intersection is computed as the intersection of the exterior polygons, minus the internal holes of both shapes.
- Parameters:
- domainobject
The domain containing the shapes and their components.
- shape_Aint
The ID of the first shape within the domain.
- shape_Bint
The ID of the second shape within the domain.
- Returns:
- list
A list of regions representing the intersection of the two shapes. Each region is represented by its boundary coordinates.
- Raises:
- ValueError
If shape_A or shape_B is not recognized or does not exist in the domain. If the object type of shape_A or shape_B is not ‘shape’.