(bbox, ptsarr, **kwargs)
return points_inside
Finds the list of points contained inside the voxel boundaries.

    Ref: https://math.stackexchange.com/a/1552579

    :param bbox: bounding box of the voxel
    :type bbox: list, tuple
    :param ptsarr: points to be checked
    :type ptsarr: list, tuple
    :return: list of points inside the voxel
    :rtype: list
Finds the list of points contained inside the voxel boundaries.
Finds the list of points contained inside the voxel boundaries .
def get_points_inside_voxel(bbox, ptsarr, **kwargs):
    """ Finds the list of points contained inside the voxel boundaries.

    Ref: https://math.stackexchange.com/a/1552579

    :param bbox: bounding box of the voxel
    :type bbox: list, tuple
    :param ptsarr: points to be checked
    :type ptsarr: list, tuple
    :return: list of points inside the voxel
    :rtype: list
    """
    # Get keyword arguments
    tol = kwargs.get('tol', 10e-8)

    # Make bounding box vertices more readable
    bbmin = [b - tol for b in bbox[0]]
    bbmax = [b + tol for b in bbox[1]]

    # Initialize an empty list
    points_inside = []

    # Find basis vectors
    i = [bbmax[0] - bbmin[0], 0, 0]
    j = [0, bbmax[1] - bbmin[1], 0]
    k = [0, 0, bbmax[2] - bbmin[2]]

    # Find dot products
    idi = linalg.vector_dot(i, i)
    jdj = linalg.vector_dot(j, j)
    kdk = linalg.vector_dot(k, k)

    for pt in ptsarr:
        v = [p - b for p, b in zip(pt, bbmin)]
        # Bigger than and equal to will include the border and,
        # since we have a padding on the boundary box, we only
        # need to include the lower boundary below
        vdi = linalg.vector_dot(v, i)
        vdj = linalg.vector_dot(v, j)
        vdk = linalg.vector_dot(v, k)
        if idi > vdi >= 0.0 and jdj > vdj >= 0.0 and kdk > vdk >= 0.0:
            points_inside.append(pt)
    return points_inside
def get_points_inside_voxel ( bbox , ptsarr , * * kwargs ) : # Get keyword arguments tol = kwargs . get ( 'tol' , 10e-8 ) # Make bounding box vertices more readable bbmin = [ b - tol for b in bbox [ 0 ] ] bbmax = [ b + tol for b in bbox [ 1 ] ] # Initialize an empty list points_inside = [ ] # Find basis vectors i = [ bbmax [ 0 ] - bbmin [ 0 ] , 0 , 0 ] j = [ 0 , bbmax [ 1 ] - bbmin [ 1 ] , 0 ] k = [ 0 , 0 , bbmax [ 2 ] - bbmin [ 2 ] ] # Find dot products idi = linalg . vector_dot ( i , i ) jdj = linalg . vector_dot ( j , j ) kdk = linalg . vector_dot ( k , k ) for pt in ptsarr : v = [ p - b for p , b in zip ( pt , bbmin ) ] # Bigger than and equal to will include the border and, # since we have a padding on the boundary box, we only # need to include the lower boundary below vdi = linalg . vector_dot ( v , i ) vdj = linalg . vector_dot ( v , j ) vdk = linalg . vector_dot ( v , k ) if idi > vdi >= 0.0 and jdj > vdj >= 0.0 and kdk > vdk >= 0.0 : points_inside . append ( pt ) return points_inside