const ret1 = []; const ret2 = []; for (const points of pointsList) { ret1.push({ x: points.right.x, y: points.right.y}); ret2.unshift({ x: points.left.x, y: poi