I changed versions of the 121 to 125 and there were problems with the modification of vertices in THREE.BoxGeometry

Hello, I switched to version 125 and I get errors when trying to modify, e.g.
cube_geom.faces [0] .materialIndex = tex_px;
After looking at what’s in BoxGeometry now, it turns out that there is no such thing as faces.

Now how do I modify materialIndex and how to disable faces.
In 121 I did something like this:
cube_geom.faces.splice (a, 2);
cube_geom.faceVertexUvs [0] .splice (a, 2);

Starting from r125 Geometry has been removed and replaced everywhere with BufferGeometry (all [Shape]Geometry are now producing BufferGeometry instances.)

To modify faces / vertices / normals you should now modify the buffers.

In the Collection of examples from discourse.threejs.org

ColorWave
BeginnerExample // … step 07: dynamic geometry

ModifyGeometry

ChangeIndexBuffer

So I understand that to make a cube I have to add to this:
const vertices = new Float32Array ([
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,

1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
-1.0, -1.0, 1.0,

]);
the other 10 vertices?
And write down:
geometry.setAttribute (‘position’, new THREE.BufferAttribute (vertices, 3));
Speed up the buffer geometry solution?
Because I do not know whether to stay with version 125?

I noticed that this library changes very often, there is no consistency in its design.

1 Like

It doesn’t look like this has been answered, but what’s the new solution to splice one of the faces from a geometry?
I couldn’t find anything in the links provided above.

see Deleting face of mesh - #8 by hofk