title: How to create a geometry out of an array in JavaScript with Three.js?
body: <p>Which one is the best (fastest) method to create a geometry out of this data-array? I create the Array on-the-fly and can also create a object instead of an array. Everything that I can do to improve this would be perfect.</p>
  
  <p><strong>Data (x,y,z):</strong> </p>
  
  <pre><code>var data = [            
      [-500,0,-500],
      [-496,0,-500],
      [-492,0,-500],
      //..
      [488,0,496],
      [492,0,496],
      [496,0,496]
  ];
  //data.length: 62500
  </code></pre>
  
  <p><strong>My way:</strong></p>
  
  <pre><code>var geo = new THREE.Geometry();
  for(i = 0; i &lt; data.length; i++)
      geo.vertices.push(data[i][0],data[i][1],data[i][2]);
  </code></pre>
  
  <p>And then I loop trough all vertices and create the faces to get a terrain (like the following picture, but not flat)</p>
  
  <p><img src="https://i.stack.imgur.com/F8dxP.png" alt="Geometry"></p>