preparePolylinesFromTree