def pathpatch_2d_to_3d(pathpatch, z=0, zdir=u'z'):
 path = pathpatch.get_path()
 trans = pathpatch.get_patch_transform()
 mpath = trans.transform_path(path)
 pathpatch.__class__ = PathPatch3D
 pathpatch.set_3d_properties(mpath, z, zdir)

def pathpatch_2d_to_3d ( pathpatch , z = 0 , zdir = u'z' ) : path = pathpatch . get_path ( ) trans = pathpatch . get_patch_transform ( ) mpath = trans . transform_path ( path ) pathpatch . __class__ = PathPatch3D pathpatch . set_3d_properties ( mpath , z , zdir )
convert a pathpatch to a pathpatch3d object .