pynetdesign.modelling.utils.are_points_inside#
- pynetdesign.modelling.utils.are_points_inside(grid_coords1, grid_coords2)[source]#
Check if all points in
grid_coords1are insidegrid_coords2.This function checks whether all points in the array
grid_coords1are also present in the arraygrid_coords2. Both arrays should have a shape of(n, 3), where each row represents a 3D coordinate.- Parameters:
- grid_coords1
numpy.ndarray A 2D array of shape (n_grid1, 3) representing the points to check.
- grid_coords2
numpy.ndarray A 2D array of shape (n_grid2, 3) representing the reference points.
- grid_coords1
- Returns:
boolTrueif all points ingrid_coords1are found ingrid_coords2,Falseotherwise.
- Raises:
- ValueError
If
grid_coords1orgrid_coords2does 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