Geometry

Geometry class interface geometry of the analysis. There are binded to an Analysis object. To access Geometry object:

geofile.showAnalysisTree()
analysis1 = geofile.getAnalysisByID(1)
geom = analysis1["Geometry"]

Detail of the Geometry class:

class PyGeoStudio.Geometry
Parameters:
  • Points (numpy array) – XY coordinates of the points in the geometry

  • Lines (list) – List of lines in the geometry

  • Regions (list) – List of regions in the geometry

  • MeshId (int) – Index of the mesh associated with the geometry (do not change)

  • Mesh (PyGeoStudio.Mesh object) – Mesh associated with the geometry

  • Name (str) – Name of the geometry

addLines(lines)

Add lines to the geometry.

Parameters:

lines (numpy array or list of list) – Start-end indices of the points that form the lines

addPoints(pts)

Add points to the geometry.

Parameters:

pt (numpy array or list of list) – XY coordinates of the points

addRegions(pt_ids)

Create region with existing point given

Parameters:

pt_ids (list of int) – Indices of the point

createRegion(pts)

Create new points, new lines and a region based on the point coordinates given. Must be given in order so they form a convex and non-intersecting polygon when joined successively.

Parameters:

pts (numpy array or list of list) – The coordinate of the points to create a region

draw(show=True)

Draw the geometry using matplotlib

Parameters:

show (bool) – Show the figure (True, default) or plot it and show it latter (False)

Returns:

Matplotlib figure and axis containing the plotted geometry

Return type:

[fig,ax]