gemgis.visualization.create_polydata_from_msh#

gemgis.visualization.create_polydata_from_msh(data: Dict[str, numpy.ndarray]) pyvista.core.pointset.PolyData#

Converting loaded Leapfrog mesh to PyVista PolyData

Parameters

data (Dict[str, np.ndarray]) – Dict containing the data loaded from a Leapfrog mesh with read_msh() of the raster module

Returns

polydata – PyVista PolyData containing the mesh values

Return type

pyvista.core.pointset.PolyData

New in version 1.0.x.

Example

>>> # Loading Libraries and File
>>> import gemgis as gg
>>> data = gg.raster.read_msh('mesh.msh')
>>> data
{'Tri': array([[    0,     1,     2],
[    0,     3,     1],
[    4,     3,     0],
...,
[53677, 53672, 53680],
[53679, 53677, 53680],
[53673, 53672, 53677]]),
'Location': array([[ 1.44625109e+06,  5.24854344e+06, -1.12743862e+02],
[ 1.44624766e+06,  5.24854640e+06, -1.15102216e+02],
[ 1.44624808e+06,  5.24854657e+06, -1.15080548e+02],
...,
[ 1.44831008e+06,  5.24896679e+06, -1.24755449e+02],
[ 1.44830385e+06,  5.24896985e+06, -1.33694397e+02],
[ 1.44829874e+06,  5.24897215e+06, -1.42506587e+02]])}
>>> # Creating PolyData from msh file
>>> polydata = gg.visualization.create_polydata_from_msh(data=data)
>>> polydata
PolyData    Information
N Cells     107358
N Points    53681
X Bounds    1.444e+06, 1.449e+06
Y Bounds    5.246e+06, 5.249e+06
Z Bounds    -2.464e+02, 7.396e+02
N Arrays    0

See also

create_polydata_from_ts

Creating PolyData dataset from GoCAD Tsurface file

create_polydata_from_dxf

Creating PolyData dataset from DXF object

create_structured_grid_from_asc

Creating StructuredGrid vom ESRI ASC Grid

create_structured_grid_from_zmap

Creating StructuredGrid vom Petrel ZMAP Grid

create_delaunay_mesh_from_gdf

Create Mesh from GeoDataFrame containing contour lines