Recently, I've been experimenting with the fromGeometry method to convert regular Geometry objects into BufferGeometry objects. To my surprise, I noticed that the number of vertices increases during this conversion process. For instance, consider the following code snippet:
var geometry = new THREE.BoxGeometry(80, 80, 80, 16, 16, 16);
var bGeometry = new THREE.BufferGeometry();
bGeometry.fromGeometry(geometry);
console.log(bGeometry.getAttribute('position'));
console.log(geometry.vertices.length);
Upon running this code, I observed a Float32Array[27648] as opposed to 9216 which is obtained by dividing it by 3. On the other hand, the original Geometry object has only 1538 vertices. This discrepancy made me wonder if BoxGeometry objects inherently have more vertices or if the compression in Three.js results in different vertex counts between the two types?
This uncertainty arose when I attempted to create a custom attribute based on the number of vertices in my Geometry object but found that my array was too short. It seems that assuming an equal amount of vertices in both Geometry objects may not be accurate due to possible vertex merging and GPU optimization.