I created a custom mesh. That works so far. Regarding to the face creation I realized it by a switch operation. If I have 4 Vertices (0,1,2),(0,2,3) and so on...
switch (coordinates_updated.vertices.length) {
case 5://wall
geometry.faces.push(
new THREE.Face3(0, 1, 2),
new THREE.Face3(0, 2, 3));
break;
case 6:
geometry.faces.push(
new THREE.Face3(0, 1, 2),// make a triangle
new THREE.Face3(0, 2, 3),
new THREE.Face3(0, 3, 4));
break;
...
But now some error occurs for more complex buildings! See the image building My problem is I have for each building different numbers of vertices. I need a kind of method that can create the faces automatically ( no switch operation) and without overlaps.
Can anyone give some advice or tips how to do this? Are there some methods which are handle this kind of problem?