original_docstring: Convert a path to a 3D segment with path codes.
docstring: Convert a path to a 3D segment with path codes.
docstring_tokens: Convert a path to a 3D segment with path codes .
code: def path_to_3d_segment_with_codes(path, zs=0, zdir='z'):
      """Convert a path to a 3D segment with path codes."""
  
      zs = np.broadcast_to(zs, len(path))
      seg = []
      codes = []
      pathsegs = path.iter_segments(simplify=False, curves=False)
      for (((x, y), code), z) in zip(pathsegs, zs):
          seg.append((x, y, z))
          codes.append(code)
      seg3d = [juggle_axes(x, y, z, zdir) for (x, y, z) in seg]
      return seg3d, codes
code_tokens: def path_to_3d_segment_with_codes ( path , zs = 0 , zdir = 'z' ) : zs = np . broadcast_to ( zs , len ( path ) ) seg = [ ] codes = [ ] pathsegs = path . iter_segments ( simplify = False , curves = False ) for ( ( ( x , y ) , code ) , z ) in zip ( pathsegs , zs ) : seg . append ( ( x , y , z ) ) codes . append ( code ) seg3d = [ juggle_axes ( x , y , z , zdir ) for ( x , y , z ) in seg ] return seg3d , codes
short_docstring: Convert a path to a 3D segment with path codes.
short_docstring_tokens: Convert a path to a 3D segment with path codes .
comment: """Convert a path to a 3D segment with path codes."""