gemgis.visualization.create_polydata_from_ts#

gemgis.visualization.create_polydata_from_ts(data: Tuple[list, list], concat: bool = False) pyvista.core.pointset.PolyData#

Converting loaded GoCAD mesh to PyVista PolyData

Parameters
  • data (Tuple[list, list]) – Tuple containing the data loaded from a GoCAD mesh with read_ts() of the raster module

  • concat (bool) – Boolean defining whether the DataFrames should be concatenated or not

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
>>> vertices, faces = gg.raster.read_ts('mesh.ts')
>>> # Inspecting vertices
>>> vertices
    id  X           Y           Z
0   0   297077.41   5677487.26  -838.50
1   1   297437.54   5676992.09  -816.61
>>> # Inspecting
>>> faces
array([[    0,     1,     2],
[    3,     2,     4],
[    1,     5,     6],...,
[40335, 40338, 40336],
[40339, 40340, 40341],
[40341, 40342, 40339]])
>>> # Creating PolyData from ts file
>>> polydata = gg.visualization.create_polydata_from_ts((vertices, faces))
>>> polydata
PolyData    Information
N Cells     29273
N Points    40343
X Bounds    2.804e+05, 5.161e+05
Y Bounds    5.640e+06, 5.833e+06
Z Bounds    -8.067e+03, 1.457e+02
N Arrays    0

See also

create_polydata_from_msh

Creating PolyData dataset from Leapfrog mesh 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