title: ThreeJS 3D points to "flat" geometry (each point connects to closest points)
body: <p>I'm drawing a 3d shape with several Vector3 Points with THREE.ConvexGeometry. This way it's creating a 3d object but what I'm actually trying to create is a «3d plane». Heres a wireframe example of what the code generates. My aim is to get a plain shape (red line) only and not the whole volume.</p>
  
  <p><a href="https://i.stack.imgur.com/yUTTs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yUTTs.jpg" alt="enter image description here"></a></p>
  
  <p>The code is:</p>
  
  <pre><code>var material = new THREE.MeshPhongMaterial( {
      color: 0xff0000, 
      shading: THREE.FlatShading,
      wireframe: true
  } );
  material.side = THREE.DoubleSide;
  
  
  let meshPoints = shapeData.meshPoints; //this is a variable
  let points = [];
  for (let i = 0; i &lt; meshPoints.length; i++) {points.push(new THREE.Vector3(meshPoints[i][0],meshPoints[i][1],meshPoints[i][2]));        }
  let geometry = new THREE.ConvexGeometry( points );
  
  var mesh = new THREE.Mesh( geometry, material );
  mesh.name = shapeData.name;
  
  mesh.material.transparent = true;
  mesh.material.opacity = 0.2;
  
  window.scene.add( mesh );
  </code></pre>