3D Visualisation
import geolime as geo
import numpy as np
import pyvista as pv
pv.set_jupyter_backend('static')
In order to use interactive 3D, please change the backend from 'static' to 'trame'. In order to do so, see PyVista documentation about Jupyter Notebook Plotting.
dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
ore_domain = geo.datasets.load("rocklea_dome/domain_mesh.dxf")
Basic Visualization¶
GeoLime objects can be exported to PyVista and visualized in 3 dimensions. Here the Drillholes is exported with the "Fe_pct" property into pyvista. The Solid representing the ore domain is also exported.
dh_pv = dh.to_pyvista('Fe_pct')
ore_domain_pv = ore_domain.to_pyvista()
A simple plot of the two objects can be perfomed using the following snippet dddd
p = pv.Plotter()
p.add_mesh(dh_pv)
p.add_mesh(ore_domain_pv)
p.show()
- Drillholes are by default displayed as lines, and can be represented as cylinder.
- Usually in geoscience, XY extent is much larger than Z extent and a scaling ratio must be used.
The previous snippet can be updated in order to take theses two points into account.
p = pv.Plotter()
p.add_mesh(dh_pv.tube(radius=10))
p.add_mesh(ore_domain_pv)
p.set_scale(zscale=10)
p.show()
More plotting configuaration are available on the PyVista Plotting Documentation.
Cross Section¶
Orthogonal Cross Section¶
slices_dh = dh_pv.tube(radius=10).slice(normal="y", origin=[0, 7475600, 0])
slices_ore_domain_pv = ore_domain_pv.slice(normal="y", origin=[0, 7475600, 0])
p = pv.Plotter()
p.add_mesh(slices_dh)
p.add_mesh(slices_ore_domain_pv)
p.set_scale(zscale=10)
p.show()
Free Form Cross Section¶
However, drillholes data do lie perfectly on the same East-West or North-South lines as there might be some differences in the planned location compared to the drilled location. PyVista allows then to select data along a free form line. We select some holes along an East-West section, here the comprehension list create a list of consecutive holeid.
east_section = [f"RKC4{elt}" for elt in np.arange(60, 76)]
east_section
['RKC460', 'RKC461', 'RKC462', 'RKC463', 'RKC464', 'RKC465', 'RKC466', 'RKC467', 'RKC468', 'RKC469', 'RKC470', 'RKC471', 'RKC472', 'RKC473', 'RKC474', 'RKC475']
x_cross = dh.data("X_COLLAR", f"(HOLEID in {east_section})")
y_cross = dh.data("Y_COLLAR", f"(HOLEID in {east_section})")
z_cross = dh.data("Z_COLLAR", f"(HOLEID in {east_section})")
pts_pv = pv.PointSet(np.unique(np.vstack([x_cross, y_cross, z_cross]).T, axis=0))
spl = pv.Spline(np.unique(np.vstack([x_cross, y_cross, z_cross]).T, axis=0), 30)
slices_ore_domain = ore_domain_pv.slice_along_line(spl)
slices_dh = dh_pv.tube(radius=10).slice_along_line(spl)
p = pv.Plotter()
p.add_mesh(slices_ore_domain, color='brown')
p.add_mesh(slices_dh, line_width=2)
p.add_mesh(pts_pv, color='green', point_size=10)
p.set_scale(zscale=10)
p.show()