diff --git a/field.py b/field.py index c6cdf21..2619abc 100644 --- a/field.py +++ b/field.py @@ -965,26 +965,20 @@ class Features3d: hit_dir: direction from which the triangle was hit, from inward/outward = +1,-1 [int] ''' from numba import jit - from time import time - + # coords = np.array(coords) assert coords.ndim==2 and coords.shape[1]==3, "'coords' need to be provided as Nx3 array." - + # if not self._kdtree: self.build_kdtree() if self._kdaxis==0: query_axis = [1,2] elif self._kdaxis==1: query_axis = [0,2] elif self._kdaxis==2: query_axis = [0,1] - - t__ = time() + # candidates = self._kdtree.query_ball_point(coords[:,query_axis],self._kdradius).tolist() - print('query',time()-t__) - - t__ = time() cand_num = np.asarray(tuple(map(len,candidates))) cand_arr = np.concatenate(candidates).astype(np.int) - print('remap',time()-t__) - + # raydir = np.zeros((3,),dtype=self._points.dtype) raydir[self._kdaxis] = 1.0 # @@ -1029,9 +1023,7 @@ class Features3d: nearface[ii] = f isinside[ii] = (n%2)!=0 return nearface,isinside - t__ = time() nf,isinside = __get_nearest_face(coords,raydir,cand_arr,cand_num,self._faces,self._points) - print('time:',time()-t__) output = self.feature_from_face(nf) output[np.logical_not(isinside)] = -1 if report: