def paths_to_3d_segments_with_codes(paths, zs=0, zdir=u'z'):
 if (not iterable(zs)):
  zs = (np.ones(len(paths)) * zs)
 segments = []
 codes_list = []
 for (path, pathz) in zip(paths, zs):
  (segs, codes) = path_to_3d_segment_with_codes(path, pathz, zdir)
  segments.append(segs)
  codes_list.append(codes)
 return (segments, codes_list)

def paths_to_3d_segments_with_codes ( paths , zs = 0 , zdir = u'z' ) : if ( not iterable ( zs ) ) : zs = ( np . ones ( len ( paths ) ) * zs ) segments = [ ] codes_list = [ ] for ( path , pathz ) in zip ( paths , zs ) : ( segs , codes ) = path_to_3d_segment_with_codes ( path , pathz , zdir ) segments . append ( segs ) codes_list . append ( codes ) return ( segments , codes_list )
convert paths from a collection object to 3d segments with path codes .