GXMESHUTIL class

class GXMESHUTIL(handle=0)[source]

GXMESHUTIL class.

Mesh utility methods.

__init__(handle=0)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod apply_transformation(inputSurfaceFile, inputSurfaceName, outputSurfaceFile, outputSurfaceName, transformationMethod, x, y, z)[source]

Applies a transformation to a surface, see :ref:`SURFACE_TRANSFORMATION_METHOD`for available operations. The existing mesh will be preserved, and a new mesh will be created with the target name in the target file. Reprojection willbe handled automatically in the case that the coordinate systems differ.

Parameters
  • inputSurfaceFile (str) – Input surface file name

  • inputSurfaceName (str) – Input surface layer (mesh) name

  • outputSurfaceFile (str) – Output surface file name

  • outputSurfaceName (str) – Output surface layer (mesh) name

  • transformationMethod (int) – SURFACE_TRANSFORMATION_METHOD constants

  • x (float) – X transformation component

  • y (float) – Y transformation component

  • z (float) – Z transformation component

New in version 2021.2.

License: Geosoft Open License

classmethod clip_surface_with_extents(inputSurfaceFile, inputSurface, outputSurfaceFile, outputSurfaceName, min_x, max_x, min_y, max_y, min_z, max_z)[source]

Clip a Surface with X,Y,Z extents

Parameters
  • inputSurfaceFile (str) – Input Geosurface file

  • inputSurface (str) – Input Surface name within Geosurface file

  • outputSurfaceFile (str) – Output Surface file

  • outputSurfaceName (str) – Output Surface name

  • min_x (float) – Min value of X

  • max_x (float) – Max value of X

  • min_y (float) – Min value of Y

  • max_y (float) – Max value of Y

  • min_z (float) – Min value of Z

  • max_z (float) – Max value of Z

Returns

Surface clip status

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod clip_surface_with_grid(inputSurfaceFile, inputSurface, gridSurfaceFileName, gridSurfaceName, outputSurfaceFile, outputSurfaceNameAbove, outputSurfaceNameBelow, surface_clip_mode)[source]

Clip a Surface with a Grid Surface (grid converted to surface)

Parameters
  • inputSurfaceFile (str) – Input Geosurface file

  • inputSurface (str) – Input Surface name within Geosurface file

  • gridSurfaceFileName (str) – Grid Surface file name

  • gridSurfaceName (str) – Grid surface name within file

  • outputSurfaceFile (str) – Output Surface file

  • outputSurfaceNameAbove (str) – Name of Surface Item above grid - required for mode=CLIP_ABOVE and CLIP_BOTH

  • outputSurfaceNameBelow (str) – Name of Surface Item below grid - required for mode=CLIP_BELOW and CLIP_BOTH

  • surface_clip_mode (int) – SURFACE_CLIP_MODE constants

Returns

Surface clip status

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod clip_surface_with_polygon2d(inputSurfaceFile, inputSurface, polygonFile, outputSurfaceFile, outputSurfaceName, maskInside)[source]

Clip a Surface a specified Polygon file

Parameters
  • inputSurfaceFile (str) – Input Geosurface file

  • inputSurface (str) – Input Surface name within Geosurface file

  • polygonFile (str) – Polygon File

  • outputSurfaceFile (str) – Output Surface file

  • outputSurfaceName (str) – Output Surface name

  • maskInside (bool) – Set true if the values inside polygon are to be masked

Returns

Surface clip status

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod compute_surface_clip(primarySurfaceFile, primarySurface, secondarySurfaceFile, secondarySurface, outputSurfaceFile, outputSurface)[source]

Clip a surface with another surface, and output the clipped surfaces

Parameters
  • primarySurfaceFile (str) – Primary Geosurface file

  • primarySurface (str) – Primary Surface Name within Geosurface File

  • secondarySurfaceFile (str) – Secondary Geosurface file

  • secondarySurface (str) – Secondary Surface Name within Geosurface File

  • outputSurfaceFile (str) – Output surface file

  • outputSurface (str) – Output surface name

New in version 9.5.

License: Geosoft Open License

classmethod compute_surface_intersection(primarySurfaceFile, primarySurface, secondarySurfaceFile, secondarySurface, outputSurfaceFile, outputSurface)[source]

Computes and outputs the intersection of two closed surfaces

Parameters
  • primarySurfaceFile (str) – Primary Geosurface file

  • primarySurface (str) – Primary Surface Name within Geosurface File

  • secondarySurfaceFile (str) – Secondary Geosurface file

  • secondarySurface (str) – Secondary Surface Name within Geosurface File

  • outputSurfaceFile (str) – Output surface file

  • outputSurface (str) – Output surface name

New in version 9.5.

License: Geosoft Open License

classmethod compute_surface_simplification(inputSurfaceFile, inputSurface, outputSurfaceFile, outputSurface)[source]

Simplifies a surface by reducing the number of edges by half

Parameters
  • inputSurfaceFile (str) – Input Geosurface file

  • inputSurface (str) – Input Surface Name within Geosurface File

  • outputSurfaceFile (str) – Output Geosurface file

  • outputSurface (str) – Output Surface Name within Geosurface File

New in version 9.5.

License: Geosoft Open License

classmethod compute_surface_subdivision(inputSurfaceFile, inputSurface, outputSurfaceFile, outputSurface)[source]

Smooths a surface by applying a loop subdivision algorithm

Parameters
  • inputSurfaceFile (str) – Input Geosurface file

  • inputSurface (str) – Input Surface Name within Geosurface File

  • outputSurfaceFile (str) – Output Geosurface file

  • outputSurface (str) – Output Surface Name within Geosurface File

New in version 9.5.

License: Geosoft Open License

classmethod compute_surface_union(primarySurfaceFile, primarySurface, secondarySurfaceFile, secondarySurface, outputSurfaceFile, outputSurface)[source]

Compute union of two surfaces

Parameters
  • primarySurfaceFile (str) – Primary Geosurface file

  • primarySurface (str) – Primary Surface Name within Geosurface File

  • secondarySurfaceFile (str) – Secondary Geosurface file

  • secondarySurface (str) – Secondary Surface Name within Geosurface File

  • outputSurfaceFile (str) – Output surface file

  • outputSurface (str) – Output surface name

New in version 9.5.

License: Geosoft Open License

classmethod copy_mesh_to_geo_surface_file(input_surface_filename, surface_name, output_surface_filename)[source]

Copy a mesh from one geosurface file to another

Parameters
  • input_surface_filename (str) – Input Geosurface file name

  • surface_name (str) – Geosurface surface name

  • output_surface_filename (str) – Output Geosurface file name

New in version 2021.2.

License: Geosoft Open License

classmethod does_surface_intersect(primarySurfaceFile, primarySurface, secondarySurfaceFile, secondarySurface)[source]

Checks if the two surfaces intersect at all

Parameters
  • primarySurfaceFile (str) – Primary Geosurface file

  • primarySurface (str) – Primary Surface Name within Geosurface File

  • secondarySurfaceFile (str) – Secondary Geosurface file

  • secondarySurface (str) – Secondary Surface Name within Geosurface File

Returns

Returns 1 if intersects, 0 if surfaces do not intersect

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod does_surface_self_intersect(surfaceFile, surfaceName)[source]

Checks if a surface self-intersects

Parameters
  • surfaceFile (str) – Geosurface file

  • surfaceName (str) – Primary Surface Name within Geosurface File

Returns

Returns 1 if surface self intersects, 0 if surface has no self-intersections

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod extract_isosurface_from_voxel(voxelFile, surfaceFile, surfaceName, contourMin, contourMax, close)[source]

Extracts isosurface from a voxel, and saves the voxel to a Geosurface file

Parameters
  • voxelFile (str) – Voxel file

  • surfaceFile (str) – Geosurface file

  • surfaceName (str) – Surface name within geosurface file

  • contourMin (float) – Minimum/higher value

  • contourMax (float) – Maximum/lower value

  • close (bool) – Closed option - create a closed surface?

New in version 9.6.

License: Geosoft Open License

classmethod import_grid_to_surface(grid_file_name, geosurface_filename, surface_name)[source]

Imports a Grid to a Surface

Parameters
  • grid_file_name (str) – Grid File Name

  • geosurface_filename (str) – Surface File Name

  • surface_name (str) – Surface Item Name within the file

New in version 9.5.

License: Geosoft Open License

is_null()[source]

Check if this is a null (undefined) instance

Returns

True if this is a null (undefined) instance, False otherwise.

Return type

bool

classmethod null()[source]

A null (undefined) instance of GXMESHUTIL

Returns

A null GXMESHUTIL

Return type

GXMESHUTIL

classmethod project_geosurface_onto_grid(surface_filename, surface_name, input_geometry_grid, projection_method, output_grid)[source]

Repoject surface with the coordinate system of the GXIPJ.

Parameters
  • surface_filename (str) – Input Geosurface file name

  • surface_name (str) – Geosurface surface name

  • input_geometry_grid (str) – Input Geometry grid

  • projection_method (int) – SURFACE_PROJECTION_METHOD constants

  • output_grid (str) – Output grid

New in version 2021.2.

License: Geosoft Open License

classmethod reproject_geosurface_file(input_surface_filename, output_surface_filename, ipj)[source]

Repoject surface with the coordinate system of the GXIPJ.

Parameters
  • input_surface_filename (str) – Input Geosurface file name

  • output_surface_filename (str) – Output Geosurface file name

  • ipj (GXIPJ) – GXIPJ in which to place the new Geosurface coordinate system

New in version 2021.2.

License: Geosoft Open License

SURFACE_CLIP_MODE constants

Surface Clip Mode

SURFACE_CLIP_ABOVE

Output the surface item above clipper surface

gxapi.SURFACE_CLIP_ABOVE = 0
SURFACE_CLIP_BELOW

Output the surface item below clipper surface

gxapi.SURFACE_CLIP_BELOW = 1
SURFACE_CLIP_BOTH

Output the surface items both above & below the clipper surface

gxapi.SURFACE_CLIP_BOTH = 2

SURFACE_CLIP_STATUS constants

Surface Clip Return Code

SURFACE_CLIP_SUCCESS

Surface clipping successful

gxapi.SURFACE_CLIP_SUCCESS = 0
SURFACE_CLIP_SUCCESS_EMPTY

Surface clipping successful, but with empty output

gxapi.SURFACE_CLIP_SUCCESS_EMPTY = 1
SURFACE_CLIP_FAIL

Surface clipping fail

gxapi.SURFACE_CLIP_FAIL = 2

SURFACE_PROJECTION_METHOD constants

Surface projection method

SURFACE_PROJECTION_MAXIMUM

Maximum value: first intersection from the top

gxapi.SURFACE_PROJECTION_MAXIMUM = 0
SURFACE_PROJECTION_MINIMUM

Minimum value: first intersection from the bottom

gxapi.SURFACE_PROJECTION_MINIMUM = 1
SURFACE_PROJECTION_AVERAGE

Average value: all intersections

gxapi.SURFACE_PROJECTION_AVERAGE = 2

SURFACE_TRANSFORMATION_METHOD constants

Surface transformation method

SURFACE_TRANSFORMATION_METHOD_SHIFT

Transforms the surface by shifting it, provided dX, dY, dZ

gxapi.SURFACE_TRANSFORMATION_METHOD_SHIFT = 0
SURFACE_TRANSFORMATION_METHOD_SCALE

Transforms the surface by scaling it, provided sX, sY, sZ

gxapi.SURFACE_TRANSFORMATION_METHOD_SCALE = 1