code: def _walk_polyline(tid, intersect, T, mesh, plane, dist_tol):
      
      T = set(T)
      p = []
      # Loop until we have explored all the triangles for the current
      # polyline
      while True:
          p.append(intersect[1])
  
          tid, intersections, T = get_next_triangle(mesh, T, plane,
                                                    intersect, dist_tol)
          if tid is None:
              break
  
          # get_next_triangle returns triangles that our plane actually
          # intersects (as opposed to touching only a single vertex),
          # hence the assert
          assert len(intersections) == 2
  
          # Of the two returned intersections, one should have the
          # intersection point equal to p[-1]
          if la.norm(intersections[0][1] - p[-1]) < dist_tol:
              intersect = intersections[1]
          else:
              assert la.norm(intersections[1][1] - p[-1]) < dist_tol, \
                  '%s not close to %s' % (str(p[-1]), str(intersections))
              intersect = intersections[0]
  
      return p, T
docs: Given an intersection, walk through the mesh triangles, computing
      intersection with the cut plane for each visited triangle and adding
      those intersection to a polyline.