<commit_before>
###
Computes surface UV for a grid of points
###
meshUV = (arr) ->

    if !arr instanceof NJ.NDArray
        throw new error.NumjisException('argument is not a NDArray object')

    if !(arr.ndim == 2 || arr.ndim == 3)
        throw new error.NumjisException('Array dimensions should be 2 or 3, got: ' + arr.ndim)
    
    height = arr.shape[0]
    width = arr.shape[1]

    UV = new NJ.NDArray([height, width, 2], NJ.float32)

    for r in [0...height]
        for c in [0...width]

            UV.data[UV.flat([r, c, 0])] = r / (height-1)
            UV.data[UV.flat([r, c, 1])] = c / (width-1)

    return UV


###
Computes vertex indices for each triangle in a surface
###
meshFaces = (arr) ->
    
    if !arr instanceof NJ.NDArray<commit_msg>Fixed the order of UV coordinates.<commit_after>
###
Computes surface UV for a grid of points
###
meshUV = (arr) ->

    if !arr instanceof NJ.NDArray
        throw new error.NumjisException('argument is not a NDArray object')

    if !(arr.ndim == 2 || arr.ndim == 3)
        throw new error.NumjisException('Array dimensions should be 2 or 3, got: ' + arr.ndim)
    
    height = arr.shape[0]
    width = arr.shape[1]

    UV = new NJ.NDArray([height, width, 2], NJ.float32)

    for r in [0...height]
        for c in [0...width]
            UV.data[UV.flat([r, c, 0])] = c / (width-1)
            UV.data[UV.flat([r, c, 1])] = (height-1-r) / (height-1)

    return UV


###
Computes vertex indices for each triangle in a surface
###
meshFaces = (arr) ->
    
    if !arr instanceof NJ.NDArray
{'fraction_non_alphanumeric': 0.1467008327994875, 'fraction_numerical': 0.01985906470211403, 'mean_word_length': 2.3663793103448274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4694639', 'n_tokens_mistral': 569, 'n_tokens_neox': 531, 'n_words': 172}