def path_to_3d_segment(path, zs=0, zdir=u'z'):
 if (not iterable(zs)):
  zs = (np.ones(len(path)) * zs)
 seg = []
 pathsegs = path.iter_segments(simplify=False, curves=False)
 for (((x, y), code), z) in zip(pathsegs, zs):
  seg.append((x, y, z))
 seg3d = [juggle_axes(x, y, z, zdir) for (x, y, z) in seg]
 return seg3d

def path_to_3d_segment ( path , zs = 0 , zdir = u'z' ) : if ( not iterable ( zs ) ) : zs = ( np . ones ( len ( path ) ) * zs ) seg = [ ] pathsegs = path . iter_segments ( simplify = False , curves = False ) for ( ( ( x , y ) , code ) , z ) in zip ( pathsegs , zs ) : seg . append ( ( x , y , z ) ) seg3d = [ juggle_axes ( x , y , z , zdir ) for ( x , y , z ) in seg ] return seg3d
convert a path to a 3d segment .