def line_collection_2d_to_3d(col, zs=0, zdir=u'z'):
 segments3d = paths_to_3d_segments(col.get_paths(), zs, zdir)
 col.__class__ = Line3DCollection
 col.set_segments(segments3d)

def line_collection_2d_to_3d ( col , zs = 0 , zdir = u'z' ) : segments3d = paths_to_3d_segments ( col . get_paths ( ) , zs , zdir ) col . __class__ = Line3DCollection col . set_segments ( segments3d )
convert a linecollection to a line3dcollection object .