Грубовато но дееспособно
var stroka = "{\n( -128 -128 128 ) ( -128 768 128 ) ( 0 768 128 )\n( -128 768 0 ) ( -128 -128 0 ) ( 0 -128 0 )\n( -128 -128 0 ) ( -128 768 0 ) ( -128 768 128 )\n( 0 768 0 ) ( 0 -128 0 ) ( 0 -128 128 )\n( -128 768 0 ) ( 0 768 0 ) ( 0 768 128 )\n( 0 -128 0 ) ( -128 -128 0 ) ( -128 -128 128 )\n}";
alert(stroka);
alert(stroka.replace("{\n( ","[{").replace(" )\n}","}]").replace(/\n/gi,",").replace(/ \) \( /g,"},{").replace(/ \),\( /g,"},{").replace(/ /g,","));