nl_tokens: TODO : this belongs in its own lib
pl_tokens: function G ( cmd , coords ) { var parts = [ 'G' + cmd , ] ; for ( var coord <mask> coords ) { if ( coords . hasOwnProperty ( coord ) ) { var lcoord = coord . toLowerCase ( ) ; if ( lcoord === 'x' ) { coords [ coord ] += offsetX ; } else if ( lcoord == 'y' ) { coords [ coord ] += offsetY ; } parts . push ( coord . toUpperCase ( ) + ( ( negate ) ? - coords [ coord ] : coords [ coord ] ) ) ; } } if ( ! coords . f && ! coords . F ) { parts . push ( 'F' + feedRate ) ; } gcode . push ( parts . join ( ' ' ) ) ; }