When attempting to create a regular octagon, I encountered an unusual triangle with this code:
var geom = new THREE.Geometry();
geom.vertices.push( new THREE.Vector3(100, 250, 0));
geom.vertices.push( new THREE.Vector3(250, 100, 0));
geom.vertices.push( new THREE.Vector3(250, -100, 0));
geom.vertices.push( new THREE.Vector3(100, -250, 0));
geom.vertices.push( new THREE.Vector3(-100, 250, 0));
geom.vertices.push( new THREE.Vector3(-250, -100, 0));
geom.vertices.push( new THREE.Vector3(-250, 100, 0));
geom.vertices.push( new THREE.Vector3(-100, 250, 0));
geom.faces.push( new THREE.Face3(0, 1, 2));
geom.faces.push( new THREE.Face3(0, 2, 3));
geom.faces.push( new THREE.Face3(0, 3, 4));
geom.faces.push( new THREE.Face3(0, 4, 5));
geom.faces.push( new THREE.Face3(0, 5, 6));
geom.faces.push( new THREE.Face3(0, 6, 7));
var material = new THREE.MeshBasicMaterial();
var mesh = new THREE.Mesh( geom, material);
mesh.position.set(0, 0, -1000);
scene.add(mesh);
In addition, one of the vertices of the resulting triangle seems to be located in a position not specified in the code. It appears that only the last face added is being displayed, but my expectation was to see all faces connecting to form a regular octagon.