gemgis.visualization.create_borehole_tube
gemgis.visualization.create_borehole_tube#
- gemgis.visualization.create_borehole_tube(df: pandas.core.frame.DataFrame, line: pyvista.core.pointset.PolyData, radius: Union[float, int]) pyvista.core.pointset.PolyData #
Creating a tube from a line for the 3D visualization of boreholes
- Parameters
df (pd.DataFrame) – DataFrame containing the borehole data
line (pv.core.pointset.PolyData) – PyVista line object
radius (Union[float,int]) – Radius of the tube, e.g.
'radius=10'
- Returns
tube – PolyData Object representing the borehole tube
- Return type
pv.core.pointset.PolyData
New in version 1.0.x.
Example
>>> # Loading Libraries and File >>> import gemgis as gg >>> import pandas as pd >>> df = pd.read_csv('file.csv') >>> df Unnamed: 0 Index Name X Y Z Altitude Depth formation geometry 0 2091 GD1017 ForschungsbohrungMünsterland1 32386176.36 5763283.15 27.00 107.00 5956.00 OberCampanium POINT (32386176.36 5763283.15) 1 2092 GD1017 ForschungsbohrungMünsterland1 32386176.36 5763283.15 -193.00 107.00 5956.00 UnterCampanium POINT (32386176.36 5763283.15)
>>> # Adding row to DataFrames >>> grouped = df.groupby(['Index']) >>> df_groups = [grouped.get_group(x) for x in grouped.groups] >>> list_df = gg.visualization.add_row_to_boreholes(df_groups) >>> list_df[0] Unnamed: 0 Index Name X Y Z Altitude Depth formation geometry 0 NaN GD1017 ForschungsbohrungMünsterland1 32386176.36 5763283.15 27.00 107.00 5956.00 NaN 0 2091 GD1017 ForschungsbohrungMünsterland1 32386176.36 5763283.15 27.00 107.00 5956.00 OberCampanium POINT (32386176.36 5763283.15) 1 2092 GD1017 ForschungsbohrungMünsterland1 32386176.36 5763283.15 -193.00 107.00 5956.00 UnterCampanium POINT (32386176.36 5763283.15)
>>> # Creating Lines from points >>> line = gg.visualization.create_lines_from_points(df=list_df[0]) >>> line PolyData Information N Cells 39 N Points 20 X Bounds 3.239e+07, 3.239e+07 Y Bounds 5.763e+06, 5.763e+06 Z Bounds -5.849e+03, 1.070e+02 N Arrays 0
>>> # Creating Tubes from lines >>> tube = gg.visualization.create_borehole_tube(df=list_df[0], line=line, radius=100) >>> tube Header PolyData Information N Cells 418 N Points 1520 X Bounds 3.239e+07, 3.239e+07 Y Bounds 5.762e+06, 5.764e+06 Z Bounds -5.849e+03, 1.070e+02 N Arrays 2 Data Arrays Name Field Type N Comp Min Max scalars Points int32 1 0.000e+00 1.900e+01 TubeNormals Points float32 3 -1.000e+00 1.000e+00
See also
add_row_to_boreholes
Adding a row to each borehole for later processing
create_lines_from_points
Creating lines from points
create_borehole_tubes
Creating tubes from lines
create_borehole_labels
Creating labels for boreholes
create_boreholes_3d
Creating PyVista objects for plotting