src/utils/data3d/buffer/triangulate-2d.js
function eliminateHoles (data, holeIndices, outerNode, dim) {
  var queue = [],
    i, len, start, end, list

  for (i = 0, len = holeIndices.length; i < len; i++) {
    start = holeIndices[i] * dim
    end = i < len - 1 ? holeIndices[i + 1] * dim : data.length
    list = linkedList(data, start, end, dim, false)
    if (list === list.next) {
      list.steiner = true
    }
    list = filterPoints(data, list)
    if (list) {
      queue.push(getLeftmost(data, list))
    }
  }

  queue.sort(function (a, b) {
    return data[a.i] - data[b.i]
  })

  // process holes from left to right
  for (i = 0; i < queue.length; i++) {
    eliminateHole(data, queue[i], outerNode)
    outerNode = filterPoints(data, outerNode, outerNode.next)
  }

  return outerNode
}
function eliminateHoles (data, holeIndices, outerNode, dim) {
  var queue = [],
    i, len, start, end, list

  for (i = 0, len = holeIndices.length; i < len; i++) {
    start = holeIndices[i] * dim
    end = i < len - 1 ? holeIndices[i + 1] * dim : data.length
    list = linkedList(data, start, end, dim, false)
    if (list === list.next) {
      list.steiner = true
    }
    list = filterPoints(data, list)
    if (list) {
      queue.push(getLeftmost(data, list))
    }
  }

  queue.sort(function (a, b) {
    return data[a.i] - data[b.i]
  })

  // process holes from left to right
  for (i = 0; i < queue.length; i++) {
    eliminateHole(data, queue[i], outerNode)
    outerNode = filterPoints(data, outerNode, outerNode.next)
  }

  return outerNode
}
function eliminateHoles ( data , holeIndices , outerNode , dim ) { var queue = [ ] , i , len , start , end , list for ( i = 0 , len = holeIndices . length ; i < len ; i ++ ) { start = holeIndices [ i ] * dim end = i < len - 1 ? holeIndices [ i + 1 ] * dim : data . length list = linkedList ( data , start , end , dim , false ) if ( list === list . next ) { list . steiner = true } list = filterPoints ( data , list ) if ( list ) { queue . push ( getLeftmost ( data , list ) ) } } queue . sort ( function ( a , b ) { return data [ a . i ] - data [ b . i ] } ) // process holes from left to right for ( i = 0 ; i < queue . length ; i ++ ) { eliminateHole ( data , queue [ i ] , outerNode ) outerNode = filterPoints ( data , outerNode , outerNode . next ) } return outerNode }
link every hole into the outer loop, producing a single-ring polygon without holes
link every hole into the outer loop producing a single - ring polygon without holes