nl_tokens: Assembles orthogonal or diagonal patterns into the final area image .
pl_tokens: function assemble ( base , patterns , edges , size , orthogonal , target ) { const p = new Vector2 ( ) ; const dstData = target . data ; const dstWidth = target . width ; let i , l ; let x , y ; let c , d ; let edge ; let pattern ; let srcData , srcWidth ; for ( i = 0 , l = patterns . length ; i < l ; ++ i ) { edge = edges [ i ] ; <mask> = patterns [ i ] ; srcData = pattern . data ; srcWidth = pattern . width ; for ( y = 0 ; y < size ; ++ y ) { for ( x = 0 ; x < size ; ++ x ) { p . fromArray ( edge ) . multiplyScalar ( size ) ; p . add ( base ) ; p . x += x ; p . y += y ; c = ( p . y * dstWidth + p . x ) * 2 ; /* The texture coordinates of orthogonal patterns are compressed
  				quadratically to reach longer distances for a given texture size. */ d = orthogonal ? ( ( y * y * srcWidth + x * x ) * 2 ) : ( ( y * srcWidth + x ) * 2 ) ; dstData [ c ] = srcData [ d ] ; dstData [ c + 1 ] = srcData [ d + 1 ] ; } } } }