Mesh

Meshes are accessed through the Geometry object:

analysis = geofile.getAnalysisByID(1)
geom = analysis1["Geometry"]
mesh = geom["Mesh"]

Detail of the mesh class:

class PyGeoStudio.Mesh(mesh_id, src_mesh)
Parameters:
  • MeshId (int) – Index of the mesh

  • Vertices (numpy array) – XY coordinates of mesh vertices

  • Elements (list) – list of mesh vertices defining the mesh elements

asMeshIOData()

Convert Mesh data into MeshIO format points and cells:

points, cells = mesh_study.getMeshIOData()
meshio_object = MeshIO.Mesh(points=points, cells=cells)
Returns:

Points and Cells in MeshIO suitable format.

Return type:

numpy array, list

export(path, point_data=None)

Export the current mesh with point data provided in another format. Export are carried with MeshIO.

Parameters:
  • path (str) – Path to the output mesh file

  • point_data (dict) – Point data to write with the mesh (default = No data). Supplied as a dictionary with point dataset name as the key and value a iterable whose size match the number of point in the mesh.

getMeshBoundingBox()

Return the two points of the diagonal of the mesh bounding box

Returns:

Coordinate of the most bottom front left and most top rear right points of the mesh

Return type:

list

getPointIndexInMesh(location)

Return point index closest to the location given.

Parameters:

location (Iterable) – [X,Y,Z] coordinate of the location

Returns:

Index of the point in the mesh (0 based)

Return type:

int

write(path)

Extract and save the mesh in GeoStudio native format with extention .ply

Parameters:

path (str) – Path to the output mesh file