title: How do I calculate which vertice is the closest to a 3D point?
body: <p><a href="https://i.stack.imgur.com/Ooh8W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ooh8W.png" alt="enter image description here"></a></p>
  
  <p>Goal:</p>
  
  <p><strong>I want to find out which vertice/vertex is the closest to the point I clicked.</strong></p>
  
  <p>Setup:</p>
  
  <ul>
  <li>Perspective camera</li>
  <li>Icosahedron geometry (basicmeshmaterial -> wireframe)</li>
  <li>Rotating geometry</li>
  <li>Raycaster</li>
  </ul>
  
  <p>Code I already have for the click handler:</p>
  
  <pre><code>mouse = new THREE.Vector2();
  mouse.x = (event.clientX / renderer.domElement.clientWidth) * 2 - 1;
  mouse.y = - (event.clientY / renderer.domElement.clientHeight) * 2 + 1;
  
  raycaster.setFromCamera(mouse, camera);
  
  const intersects = raycaster.intersectObject(icosahedron);
  
  // 3D point: intersects[0].point
  // Object face: intersects[0].face
  </code></pre>
  
  <p>Thanks!</p>