nl_tokens: Recursively places a point into the octree .
pl_tokens: function put ( point , data , octree , octant , depth ) { let children = octant . children ; let exists = false ; let done = false ; let i , l ; if ( octant . contains ( point , octree . bias ) ) { if ( children === null ) { if ( octant . points === null ) { octant . points = [ ] ; octant . data = [ ] ; } else { for ( i = 0 , l = octant . points . length ; ! exists && i < l ; ++ i ) { exists = octant . points [ i ] . equals ( point ) ; } } if ( exists ) { octant . data [ i - 1 ] = data ; done = true ; } else if ( octant . points . length < octree . maxPoints || depth === octree . maxDepth ) { octant . points . push ( point . clone ( ) ) ; octant . data . push ( data ) ; ++ octree . pointCount ; done = true ; } else { octant . split ( ) ; octant . redistribute ( octree . bias ) ; <mask> = octant . children ; } } if ( children !== null ) { ++ depth ; for ( i = 0 , l = children . length ; ! done && i < l ; ++ i ) { done = put ( point , data , octree , children [ i ] , depth ) ; } } } return done ; }