I am attempting to dynamically add new faces to a mesh, but I keep encountering a console warning:
THREE.BufferAttribute.copyVector3sArray(): vector is undefined
Despite the warning, this example successfully generates a single triangle that is a replica of the first face in the geometry. However, the warning persists and I am unable to resolve it.
var vertices = this.body.geometry.vertices;
var faces = this.body.geometry.faces;
var face = faces[0];
var a = face.a;
var b = face.b;
var c = face.c;
var va = vertices[a].clone();
var vb = vertices[b].clone();
var vc = vertices[c].clone();
vertices = [];
vertices.push(va);
vertices.push(vb);
vertices.push(vc);
this.body.geometry.vertices = vertices;
this.body.geometry.faces = faces;
This issue bears resemblance to this related question, although my scenario does not involve mistakenly assigning a vector to a vertex's index, making that solution unsuitable for me.