Exemplo n.º 1
0
    def within_index(self, other):
        """ Return indices of the points that are within the shape """
        other = _a.asarrayd(other)
        other.shape = (-1, 3)

        # First check
        tmp = dot(other - self.center[None, :], self._iv)
        tol = 1.e-12

        # Get indices where we should do the more
        # expensive exact check of being inside shape
        # I.e. this reduces the search space to the box
        return indices_in_sphere(tmp, 1. + tol)
Exemplo n.º 2
0
    def within_index(self, other, tol=1.e-8):
        r""" Return indices of the points that are within the shape

        Parameters
        ----------
        other : array_like
           the object that is checked for containment
        tol : float, optional
           absolute tolerance for boundaries
        """
        other = _a.asarrayd(other)
        other.shape = (-1, 3)

        # First check
        tmp = dot(other - self.center[None, :], self._iv)

        # Get indices where we should do the more
        # expensive exact check of being inside shape
        # I.e. this reduces the search space to the box
        return indices_in_sphere(tmp, 1. + tol)