Polygon from points

I think you need to sort points by degrees.If in future you will have rotated plane (normal), then you need rotate it back to top view and apply it to points and then sort it.
image

After var bufferPoints = []; add:

       for(var n=0;n<pointsOfIntersection.length;n++){
       pointsOfIntersection[n].angle=Math.atan2(pointsOfIntersection[n].x,pointsOfIntersection[n].z);
       }
       pointsOfIntersection.sort((a,b)=>b.angle-a.angle);

image