pynetdesign.modelling.utils.are_points_inside#

pynetdesign.modelling.utils.are_points_inside(grid_coords1, grid_coords2)[source]#

Check if all points in grid_coords1 are inside grid_coords2.

This function checks whether all points in the array grid_coords1 are also present in the array grid_coords2. Both arrays should have a shape of (n, 3), where each row represents a 3D coordinate.

Parameters:
grid_coords1numpy.ndarray

A 2D array of shape (n_grid1, 3) representing the points to check.

grid_coords2numpy.ndarray

A 2D array of shape (n_grid2, 3) representing the reference points.

Returns:
bool

True if all points in grid_coords1 are found in grid_coords2, False otherwise.

Raises:
ValueError

If grid_coords1 or grid_coords2 does not have the required shape of (n, 3).

Examples

>>> grid_coords1 = np.array([[1, 2, 3], [4, 5, 6]])
>>> grid_coords2 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> are_points_inside(grid_coords1, grid_coords2)
True
>>> grid_coords1 = np.array([[1, 2, 3], [10, 11, 12]])
>>> grid_coords2 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> are_points_inside(grid_coords1, grid_coords2)
False