@staticmethod
def draw_mayavi_graph(G, **kwds):
    """
        Draws the provided network with mayavi. This requires the Mayavi python library
        (mayavi.mlab)
        
        **Optional Keywords**:
         - *node_size* = The size of the nodes. Default is 40.
         - *edge_thickness* = The thickness of the edges. Default is 4
         - *show* = If true, the model is displayed in the mayavi viewer after exporting. Default is True
         - *path* = A path to save the mayavi vtk file to after generating it.
        """
    import networkx as nx
    import numpy as np
    try:
        from mayavi import mlab
    except ImportError:
        print(
            "Error loading mayavi package: mayavi is not installed or is not on the python path. To install with pip, use 'pip install mayavi' (or 'conda install mayavi'"
            )
        return
    node_size = kwds.get('node_size', 250)
    edge_thickness = kwds.get('edge_thickness', 10)
    G2 = nx.convert_node_labels_to_integers(G)
    x = []
    y = []
    z = []
    nCols = []
    for n in G2.nodes():
        assert 'centroid' in G2.node[n
            ], 'Error: node centroids are not defined.'
        centroid = G2.node[n]['centroid']
        x.append(centroid[0])
        y.append(centroid[1])
        z.append(centroid[2])
        nCols.append(int(G2.node[n]['lithology']))
    edge_groups = {}
    from matplotlib.colors import ColorConverter
    cc = ColorConverter()
    for e in G2.edges(data=True):
        e_type = e[2]['edgeType']
        if e_type not in edge_groups:
            col = e[2].get('colour', (0.3, 0.3, 0.3))
            if not type(col) is tuple:
                col = cc.to_rgb(col)
            edge_groups[e_type] = ([], [], []), [], col, []
        id_start = len(edge_groups[e_type][0][0])
        edge_groups[e_type][0][0].append(x[e[0]])
        edge_groups[e_type][0][1].append(y[e[0]])
        edge_groups[e_type][0][2].append(z[e[0]])
        edge_groups[e_type][3].append(e[2].get('weight', 1.0) * edge_thickness)
        id_end = len(edge_groups[e_type][0][0])
        edge_groups[e_type][0][0].append(x[e[1]])
        edge_groups[e_type][0][1].append(y[e[1]])
        edge_groups[e_type][0][2].append(z[e[1]])
        edge_groups[e_type][3].append(e[2].get('weight', 1.0) * edge_thickness)
        edge_groups[e_type][1].append((id_start, id_end))
    mlab.figure(1, bgcolor=(1, 1, 1))
    mlab.clf()
    pts = mlab.points3d(x, y, z, nCols, scale_factor=node_size, scale_mode=
        'none', resolution=20)
    for k in list(edge_groups.keys()):
        e = edge_groups[k]
        pts2 = mlab.points3d(e[0][0], e[0][1], e[0][2], e[3], scale_factor=
            edge_thickness, scale_mode='none', resolution=5)
        pts2.mlab_source.dataset.lines = np.array(e[1])
        tube = mlab.pipeline.tube(pts2, tube_radius=edge_thickness)
        tube.filter.vary_radius = 'vary_radius_by_scalar'
        tube.filter.radius_factor = 5
        mlab.pipeline.surface(tube, color=e[2])
    if 'path' in kwds:
        try:
            from tvtk.api import write_data
        except:
            print('Warning: tvtk not installed - cannot write vtk file.')
        write_data(pts.mlab_source.dataset, kwds['path'])
    if kwds.get('show', True):
        mlab.show()
