     newNode.doubleSided = true
     @nodesSpheres.push(newNode)
     @trigger "newGeometries", [newNode]
-      
+
   getIndexFromTreeId : (treeId) ->
     unless treeId
       treeId = @route.getTree().treeId

      edgeArray = node.pos.concat(node.neighbors[0].pos)
    else
      edgeArray = node.neighbors[0].pos.concat(node.pos)
    for i in [0...@curIndex]
      found = true
      for j in [0..5]
        found &= Math.abs(@routes[index].geometry.__vertexArray[6 * i + j] - edgeArray[j]) < 0.01
      if found
        edgesIndex = i
        break
    for i in [0..5]
      @routes[index].geometry.__vertexArray[edgesIndex * 6 + i] =
        @routes[index].geometry.__vertexArray[(@curIndex - 2) * 6 + i]
    

    @curIndex[index]--

            @edgesBuffer[index].set( neighbor.pos, (edgesIndex++) * 3 )
            @edgesBuffer[index].set(     node.pos, (edgesIndex++) * 3 )

      if edgesIndex != (2 * (@curIndex[index] - 1)) and !(@curIndex[index] == 0 and edgesIndex == 0)
        console.error("edgesIndex does not equal (2 * (@curIndex[index] - 1) !!!")

      @routes[index].geometry.__vertexArray = @edgesBuffer[index]
