FBX geometry not matching visually


I have a GLTF model that I exported as FBX from Revit, imported into Blender, and then exported as GLTF. When I load the model into Three.js, I notice an issue with the mesh positions.

I inspect the mesh.geometry.attributes.position.array to get the coordinates of the meshes. However, the points don’t match the visual model—they appear scaled or transformed, even though I didn’t apply any transformations.

Here’s the code I use to check the positions:

model.traverse((child) => {
    if (child.isMesh) {
        if (child.userData.name.includes('329762')) {
            console.log(child.geometry.attributes.position.array);
        }
    }
});

I want to use child.position.add(number) to update the mesh position, but this doesn’t change the geometry. Therefore, I need to iterate through the points and adjust them directly, but the geometry seems incorrect.

child.geometry.attributes.position.array is a flat array of point [x,y,z,x,y,z,x,y,z…]
you read 3 at a time…

let vec = new THREE.Vector3();
let a = child.geometry.attributes.position.array;
for(let i=0;i<a.length;i+=3){
vec.set(a[i],a[i+1],a[i+2]);
child.localToWorld(vec);
   // here vec should now be the world space coordinate of the geometry vertex.
}

would i use it like this?

              child.position.add(offset);
              let vec = new THREE.Vector3();
              let a = child.geometry.attributes.position.array;
              for (let i = 0; i < a.length; i += 3) {
               child.set(a[i], a[i + 1], a[i + 2]);
                child.localToWorld(vec);
                // here vec should now be the world space coordinate of the geometry vertex.
              }

Yes that looks right.
It doesn’t always work to access the array directly, but for simple cases it does.
If the geometry is interleaved, then you have to use the accessors instead…