GXMESH class

class GXMESH(handle=0)[source]

GXMESH class.

High Performance Surface API.

__init__(handle=0)[source]

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

add_face(mesh_name, patch_id, v0, v1, v2)[source]

Adds a face to a patch in a mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

  • v0 (int) – Vertex index 0 for the face

  • v1 (int) – Vertex index 1 for the face

  • v2 (int) – Vertex index 2 for the face

Returns

Returns the face index of the added face

Return type

int

New in version 9.5.

License: Geosoft Open License

add_vertex(mesh_name, patch_id, x, y, z)[source]

Adds a vertex to a patch in a mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

  • x (float) – x coordinate of the vertex

  • y (float) – y coordinate of the vertex

  • z (float) – z coordinate of the vertex

Returns

Returns the vertex index of the added vertex

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod create(name)[source]

Creates a new Mesh

Parameters

name (str) – Mesh Name

Returns

GXMESH handle, terminates if creation fails

Return type

GXMESH

New in version 9.5.

License: Geosoft Open License

delete_patch(mesh_name, patch_id)[source]

Deletes a patch specified by Patch ID from a mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

New in version 9.5.

License: Geosoft Open License

get_attribute_values(mesh_name, attribute_name, data_type, attribute_type, patch_id, vv)[source]

Inserts an attribute set to a mesh

Parameters

New in version 9.5.

License: Geosoft Open License

get_faces(mesh_name, patch_id, face_v_1, face_v_2, face_v_3)[source]

Returns all the faces comprising of vertex indices in a patch

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

  • face_v_1 (GXVV) – Face vertex 1

  • face_v_2 (GXVV) – Face vertex 2

  • face_v_3 (GXVV) – Face vertex 3

New in version 9.5.

License: Geosoft Open License

get_vertex_point(mesh_name, patch_id, vertex_index, x_coordinate, y_coordinate, z_coordinate)[source]

Number of faces in a patch in mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

  • vertex_index (int) – Vertex Index

  • x_coordinate (float_ref) – X coordinate

  • y_coordinate (float_ref) – Y coordinate

  • z_coordinate (float_ref) – Z coordinate

Returns

Returns the number of faces in a patch

Return type

int

New in version 9.5.

License: Geosoft Open License

get_vertices(mesh_name, patch_id, vert_v_vx, vert_v_vy, vert_v_vz)[source]

Returns all the vertices in a patch

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

  • vert_v_vx (GXVV) – Vertices X

  • vert_v_vy (GXVV) – Vertices Y

  • vert_v_vz (GXVV) – Vertices Z

New in version 9.5.

License: Geosoft Open License

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

Imports a Grid to a Surface. Creates a new Geosurface file for the surface

Parameters
  • grid_file_name (str) – Grid File Name

  • geosurface_filename (str) – Surface File Name

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

Returns

GXMESH handle, terminates if creation fails

Return type

GXMESH

New in version 9.5.

License: Geosoft Open License

insert_attributes(mesh_name, attribute_name, data_type, attribute_type)[source]

Inserts an attribute set to a mesh

Parameters

New in version 9.5.

License: Geosoft Open License

insert_patch(mesh_name)[source]

Inserts a new surface patch to the mesh specified by a unique ID

Parameters

mesh_name (str) – Mesh Name

Returns

Patch ID of the inserted patch

Return type

int

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 GXMESH

Returns

A null GXMESH

Return type

GXMESH

num_faces(mesh_name, patch_id)[source]

Number of faces in a patch in mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

Returns

Returns the number of faces in a patch

Return type

int

New in version 9.5.

License: Geosoft Open License

num_patches(mesh_name)[source]

Returns the number of patches added to the mesh

Parameters

mesh_name (str) – Mesh Name

Returns

The number of patches added to the mesh

Return type

int

New in version 9.5.

License: Geosoft Open License

num_vertices(mesh_name, patch_id)[source]

Number of vertices in a patch in mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

Returns

Returns the number of vertices in a patch

Return type

int

New in version 9.5.

License: Geosoft Open License

classmethod open(fileName, lstMeshNames)[source]

Opens an existing Mesh

Parameters
  • fileName (str) – File Name

  • lstMeshNames (GXLST) – GXLST to fill with Mesh Names

Returns

GXMESH handle, terminates if creation fails

Return type

GXMESH

New in version 9.5.

License: Geosoft Open License

patch_exists(mesh_name, patch_id)[source]

Checks if a patch specified by a patch ID exists in a mesh

Parameters
  • mesh_name (str) – Mesh Name

  • patch_id (int) – Patch ID

Returns

TRUE if patch exists

Return type

bool

New in version 9.5.

License: Geosoft Open License

save()[source]

Saves Mesh to the Project Cache and Geosurface file

New in version 9.5.

License: Geosoft Open License

set_attribute_values(mesh_name, attribute_name, data_type, attribute_type, patch_id, vv)[source]

Inserts an attribute set to a mesh

Parameters

New in version 9.5.

License: Geosoft Open License

ATTRIBUTE_DATA_TYPE constants

Data Type of Attribute

ATTRIBUTE_DOUBLE

DOUBLE

gxapi.ATTRIBUTE_DOUBLE = 0
ATTRIBUTE_THEMATIC

THEMATIC

gxapi.ATTRIBUTE_THEMATIC = 1
ATTRIBUTE_VECTOR

VECTOR

gxapi.ATTRIBUTE_VECTOR = 2

ATTRIBUTE_TYPE constants

Data Type of Attribute

ATTRIBUTE_SINGLE

Single Value Attribute

gxapi.ATTRIBUTE_SINGLE = 0
ATTRIBUTE_SURFACE_SIDES

Surface Sides Attribute

gxapi.ATTRIBUTE_SURFACE_SIDES = 1
ATTRIBUTE_VERTICES

Vertices Attribute

gxapi.ATTRIBUTE_VERTICES = 2
ATTRIBUTE_FACES

Faces Attribute

gxapi.ATTRIBUTE_FACES = 3