Create concave mesh from array of vertex?


my objective is to create a mesh, from a array of points
(and apply a texture)

left WHITE on the picture : OK WITH ConvexBufferGeometry

    var geometry = new THREE.ConvexBufferGeometry(  arrayPoints);
    var material = new THREE.MeshBasicMaterial( { color: 0xf0fff0 , wireframe:true }   );
    var mesh = new THREE.Mesh( geometry, material );


But its not why i am looking for.
I need concave geometry ( using a GABRIEL GRAPH and drawing all segments )
cf right RED on the picture

        lines = getGabrielGraph (arrayPoints);
        var geometry = new THREE.Geometry();
	for (var i = 0 ; i < lines.length ; ++i )
		geometry.vertices.push(new THREE.Vector3( lines[i][0][0],  lines[i][0][1],  lines[i][0][2]) );
		geometry.vertices.push(new THREE.Vector3( lines[i][1][0],  lines[i][1][1],  lines[i][1][2]) );
	var line = new THREE.Line( geometry, material );

Its almost OK… but i have lines, not a mesh. I want to convert this to a mesh, and apply a texture to the result

  • Is there any new THREE.ConcavBufferGeometry .?

Thanks for helps, documentations, nice link on thje subject

Is there any new THREE.ConcavBufferGeometry?

No. You need to define in your code how your specific points/lines data should be transformed to triangle primitives. There is no generic way to do this.

1 Like