Adding normal maps to bufferGeometry shapes in THREE

Solution for Adding normal maps to bufferGeometry shapes in THREE
is Given Below:

I’m trying to add normal map (in this case wood texture) to custom part I’ve created using THREE.BufferGeometry() and vertices.

For this particular part:

//edit initially I left out this part while posting. My script sees this folder and gives no errors
const woodPattern = new THREE.TextureLoader();
const woodTexture = woodPattern.load('/textures/wood_pattern.jpg');

const frame_upper_part_geometry = new THREE.BufferGeometry();
const frame_upper_part_positions = [
     0.8,  0.8,  0.95,
    -0.8,  0.8,  0.95,
    -0.8,  0.8,  0.75,

    -0.8,  0.8,  0.75,
     0.8,  0.8,  0.75,
     0.8,  0.8,  0.95,
     
     0.6,  0.6,  0.95,
    -0.6,  0.6,  0.95,
    -0.6,  0.6,  0.75,
 
    -0.6,  0.6,  0.75,
     0.6,  0.6,  0.75,
     0.6,  0.6,  0.95,

     0.8,  0.8,  0.95,
     0.6,  0.6,  0.95,
     0.6,  0.6,  0.75,
     
     0.6,  0.6,  0.75,
     0.8,  0.8,  0.75,
     0.8,  0.8,  0.95,

     -0.8,  0.8,  0.95,
     -0.6,  0.6,  0.95,
     -0.6,  0.6,  0.75,
     
     -0.6,  0.6,  0.75,
     -0.8,  0.8,  0.75,
     -0.8,  0.8,  0.95,

     0.8,  0.8,  0.75,
    -0.8,  0.8,  0.75,
    -0.6,  0.6,  0.75,

    -0.6,  0.6,  0.75,
     0.6,  0.6,  0.75,
     0.8,  0.8,  0.75,
];
frame_upper_part_geometry.setAttribute( 
    'position', 
    new THREE.Float32BufferAttribute( frame_upper_part_positions, 3 ) 
);
frame_upper_part_geometry.computeVertexNormals();
const frame_material = new THREE.MeshStandardMaterial({normalMap:woodTexture})
frame_material.side = THREE.DoubleSide;
frame_material.color = new THREE.Color(0x654321)
const frame_upper_part = new THREE.Mesh(frame_upper_part_geometry, frame_material)
scene.add(frame_upper_part)

I get no errors, however adding normal map doesnt seem to change a thing, even though if I added it the same way with predefined geometry in THREE itself, it should work. Am I missing something?

result I’m getting, no errors, however effects of normal map are not present.

You are not generating any texture coordinates for the custom geometry. Hence, applying textures won’t work as expected. Texture coordinates are stored in the called uv buffer attribute.