gemgis.visualization.create_mesh_from_cross_section#

gemgis.visualization.create_mesh_from_cross_section(linestring: shapely.geometry.linestring.LineString, zmax: Union[float, int], zmin: Union[float, int]) pyvista.core.pointset.PolyData#

Creating a PyVista Mesh from one cross section

Parameters
  • linestring (shapely.geometry.linestring.LineString) – LineString representing the trace of the cross section on a geological map, e.g. linestring = LineString([(0, 0), (10, 10), (20, 20)])

  • zmax (Union[float, int]) – Upper vertical extent of the cross section, e.g. zmax=1000

  • zmin (Union[float, int]) – Lower vertical extent of the cross section, e.g. zmin=0

Returns

surface – Mesh defining the cross section in space

Return type

pyvista.core.pointset.PolyData

New in version 1.0.x.

Example

>>> # Loading Libraries and creating LineString
>>> import gemgis as gg
>>> from shapely.geometry import LineString
>>> linestring = LineString([(0, 0), (10, 10), (20, 20)])
>>> linestring.wkt
'LINESTRING (0 0, 10 10, 20 20)'
>>> # Creating PolyData from LineStrings
>>> polydata = gg.visualization.create_mesh_from_cross_section(linestring=linestring, zmax=1000, zmin=0)
>>> polydata
Header
PolyData    Information
N Cells     4
N Points    6
X Bounds    0.000e+00, 2.000e+01
Y Bounds    0.000e+00, 2.000e+01
Z Bounds    0.000e+00, 1.000e+03
N Arrays    1
Data Arrays
Name                Field   Type    N Comp  Min         Max
Texture Coordinates Points  float64 2       0.000e+00   1.000e+00

See also

create_meshes_from_cross_sections

Creating meshes from cross sections