function rotatePoint(centerX, centerY, distance, angleInDegrees) { const angleInRadians = angleInDegrees * (Math.PI / 180); const x = centerX + (distance * Math.cos(angleInRadians)); const y = centerY + (distance * Math.sin(angleInRadians)); return { x, y, z : 0 }; } let obj = [ "16mm_2in", "16mm_2in_np", "16mm_3in", "16mm_3in_np", "8mm_2in", "8mm_2in_np", "8mm_3in", "8mm_3in_np", "35mm_2in", "35mm_2in_np", "35mm_3in", "35mm_3in_np" ]; let meta = { objects : [] } for (let i = 0; i < 12; i++) { meta.objects.push ({ name : obj[i], material : "white_plastic", position : rotatePoint(0, 0, 160, i * (360 / 12)), rotation : { x : 0, y : 90, z : i * (360 / 12) } }); } console.log(JSON.stringify(meta, null, '\t'))