Why I can't create Face3 in ThreeJS Typescript project

I am trying to create Mesh by using Face3. I am using Threejs in typescript project. There are several problems I am facing.

const points = [
     new Face3(-1, 1, -1),//c
     new Face3(-1, -1, 1),//b
     new Face3(1, 1, 1),//a

     new Face3(1, 1, 1),//a
     new Face3(1, -1, -1),//d
     new Face3(-1, 1, -1),//c

     new Face3(-1, -1, 1),//b
     new Face3(1, -1, -1),//d
     new Face3(1, 1, 1),//a

     new Face3(-1, 1, -1),//c
     new Face3(1, -1, -1),//d
     new Face3(-1, -1, 1),//b
]
let geometry = new Geometry();
for (const point of points) {
     geometry.faces.push(point);
}

First of all, I can’t add this geometry into mesh. It gives me error that it is not a BufferGeometry

image

If I try to create a new BufferGeometry from Geomtery, I can’t find property fromGeometry

If these kind of functions has been deprecated, then what is the exact alternative for this? Why there is no proper guideline or instruction available? Is there anyone who can suggest me better solution.

No Face3 anymore, see THREE.Geometry will be removed from core with r125

Use Buffergeometry. Simple example in the Collection of examples from discourse.threejs.org

BeginnerExample

// … step 02: buildt custom geometries …

Another example RemoveTriangles

See also source code of the plane three.js/PlaneGeometry.js at d39d82999f0ac5cdd1b4eb9f4aba3f9626f32ab6 · mrdoob/three.js · GitHub

2 Likes

/cc