(Three.js) how can i get indices from STL file after load stl file with loader?

i have a question,
i want to get vertices and indices from stl file from STLLoader of Three.js.
i can get vertices but, i can’t get indices…

i tried


but the index attribute is null….

is there any chance to get indices..?

and i tried for loop

//arr = devided vertices array in 3 elements
// ex) arr =[[x1,y1,z1],[x2,y2,z2]...,] 
//but there are same elements ex) [[x1,y1,z1],..,[x1,y1,z1]]
// so i remove same elements and that called "node" array

//if node's element and arr's elment is same, take that index and push it to "indices" array.
//but it takes so much time..... if vertices array is too big.
for (let i = 0; i < arr.length; i++) {
    for (let j = 0; j < node.length; j++) {
      if (String(arr[i]) === String(node[j])) {

i really need your help.

Read more here: Source link