Raycaster Normal Incorrect for Scaled Mesh

Hi, all. I’m having some trouble getting the correct normal of a face intersected by a ray when the mesh has been scaled and am hoping someone can point out what I’m doing wrong.

Here’s a demo: https://codepen.io/macapam689/pen/abbMxGV?editors=0010

The intersect normal is correct for the left hand cylinder, which has not been scaled, but is incorrect for the right hand cylinder which has been scaled in the x axis.

As a side question, when calling computeVertexNormals() on the geometry, the results are odd. You can see this by setting the COMPUTE_VERTEX_NORMALS boolean in the example. Interestingly, the normals for the top vertices of the right hand cylinder point in the direction I would expect the intersect face normal to point.

I’m sure it’s probably something basic but I can’t find the magic combination of search terms to find the answer. Thanks to anyone who can help figure this out.

The normalMatrix has to be calculated from the worldMatrix before it can be applied:

const normalMatrix = new Matrix3().getNormalMatrix( obj.matrixWorld );
normal.applyMatrix3( normalMatrix ).normalize();

Updated pen: https://codepen.io/MekonLips/pen/dyyBJEV?editors=0010