ogstools.meshlib.boundary_subset module#
- class ogstools.meshlib.boundary_subset.Surface[source]#
Bases:
object
A surface is a sub group of a polygon mesh (2D). A surface is not closed and therefore does not represent a volume. (Geological) layers (stratigraphic units) can be defined by an upper and lower surface. By convention, properties (material_id and resolution ), actually associated to the stratigraphic unit layer, are given together with the lower boundary (class Surface) of a stratigraphic unit (class Layer).
Initialize a surface mesh. Either from pyvista or from a file.
- property material_id: int#
- ogstools.meshlib.boundary_subset.Gaussian2D(bound2D, amplitude, spread, height_offset, n)[source]#
Generate a 2D Gaussian-like surface using the provided parameters.
This method computes a 2D Gaussian-like surface by sampling the given bound and parameters.
- Args:
bound2D (tuple): Tuple of boundary coordinates (x_min, x_max, y_min, y_max). amplitude (float): Amplitude or peak value of the Gaussian curve. spread (float): Scaling factor that controls the spread or width of the Gaussian curve. height_offset (float): Constant offset added to elevate the entire surface. n (int): Number of points in each dimension for sampling.
- Returns:
pyvista.PolyData: A PyVista PolyData object representing the generated surface.
- Note:
The larger amplitude, the taller the peak of the surface.
The larger spread, the wider and flatter the surface.
height_offset shifts the entire surface vertically.
- Example:
Generating a 2D Gaussian-like surface:
` bound = (-1.0, 1.0, -1.0, 1.0) amplitude = 1.0 spread = 0.5 height_offset = 0.0 n = 100 surface = MyClass.Gaussian2D(bound, amplitude, spread, height_offset, n) `
- Return type:
DataSet