<commit_before>(ns hard.mesh
  (:import
    [UnityEngine Color]))

(defn gobj? [x] (instance? UnityEngine.GameObject x))

(defn vertices [gob] 
  (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))))

(defn vertices! [gob ar] 
  (set! (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))) ar))

(defn vertex-color! [gob col]
  (when (gobj? gob)
    (when-let [meshfilter (.GetComponent gob UnityEngine.MeshFilter)]
      (let [mesh (.sharedMesh meshfilter) 
          verts (.vertices mesh)
          colors (into-array (take (count verts) (repeat col)))]
        (set! (.colors mesh) colors) nil))))


(defn vertex-colors! [gob c]
  (when (gobj? gob)
    (when-let [meshfilter (.GetComponent gob UnityEngine.MeshFilter)]
      (let [mesh (.mesh meshfilter)
          verts (.vertices mesh)
          fn (cond (fn? c) c
                :else (fn [_ _ _ _] c))
          colors (into-array (doall 
                (for [idx (range (count verts))
                  :let [v (.GetValue verts idx)
                      x (.x v)
                      y (.y v)
                      z (.z v)]]
                  (fn x y z idx))))]
        (set! (.colors mesh) colors) <commit_msg>hint mesh fn<commit_after>(ns hard.mesh
  (:import
    [UnityEngine Color]))

(defn gobj? [x] (instance? UnityEngine.GameObject x))

(defn vertices [^UnityEngine.GameObject gob] 
  (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))))

(defn vertices! [^UnityEngine.GameObject gob ^UnityEngine.Vector3|[]| ar] 
  (set! (.vertices (.mesh (.GetComponent gob UnityEngine.MeshFilter))) ar))

(defn vertex-color! [gob col]
  (when (gobj? gob)
    (when-let [meshfilter (.GetComponent gob UnityEngine.MeshFilter)]
      (let [mesh (.sharedMesh meshfilter) 
          verts (.vertices mesh)
          colors (into-array (take (count verts) (repeat col)))]
        (set! (.colors mesh) colors) nil))))


(defn vertex-colors! [gob c]
  (when (gobj? gob)
    (when-let [meshfilter (.GetComponent gob UnityEngine.MeshFilter)]
      (let [mesh (.mesh meshfilter)
          verts (.vertices mesh)
          fn (cond (fn? c) c
                :else (fn [_ _ _ _] c))
          colors (into-array (doall 
                (for [idx (range (count verts))
                  :let [v (.GetValue verts idx)
                      x (.x v)
                      y (.y v)
                      z (.z v)]]
                  (fn x y z idx))))]
        (set! (.colors mesh) colors) 
{'fraction_non_alphanumeric': 0.14157851912123678, 'fraction_numerical': 0.0004068348250610252, 'mean_word_length': 2.062266500622665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3642274', 'n_tokens_mistral': 806, 'n_tokens_neox': 750, 'n_words': 243}