mt.geo.join_volume
Registry to store all the functions to join the interior volumes of two geometric objects in the same space.
Functions
join_volume()
: Joins the interior volumes of two geometric objects in the same space.register_join_volume()
: Registers a function to join_volume an object of type A and object of type B.
- mt.geo.join_volume.join_volume(obj1, obj2)
Joins the interior volumes of two geometric objects in the same space.
- Parameters:
obj1 (object) – first object to join
obj2 (object) – second object to join
- Returns:
intersection_volume (float) – the volume of the intersection of the two objects’ interior regions
obj1_only_volume (float) – the volume of the interior of obj1 that does not belong to obj2
obj2_only_volume (float) – the volume of the interior of obj2 that does not belong to obj1
union_volume (float) – the volume of the union of the two objects’ interior regions
- Raises:
NotImplementedError – if the join_volume function has not been registered using function register_join_volume
- mt.geo.join_volume.register_join_volume(type1, type2, func)
Registers a function to join_volume an object of type A and object of type B.
- Parameters:
type1 (type) – type or class of the first object to join_volume
type2 (type) – type or class of the second object to join_volume
func (function) – join_volume function to register