GXTIN class

class geosoft.gx.GXTIN
The TIN class calculates the Delaunay triangulation of the
positions in a database. This is the "best" set of triangles
that can be formed from irregularly distributed points. The
serialized TIN files can be used for gridding using the
Tin-based Nearest Neighbour Algorithm, or for plotting the
Delaunay triangles or Voronoi cells to a map.
copy((GXTIN)arg1) → None:
Copy TIN
Parameters:arg1 (geosoft.gx.GXTIN) – source TIN
Returns:Nothing
Return type:None

New in version 5.0.0.

static create((GXContext)ctx, (GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → GXTIN:
This method creates a TIN object.
Parameters:
Returns:

TIN Object

Return type:

geosoft.gx.GXTIN

New in version 5.0.0.

Note:

CreateTIN does the TIN calculation.
The Z values are not required, and a 0-length VV can be used to indicate
the values are not to be used.
static create_s((GXContext)ctx, (GXBF)arg1) → GXTIN:
Create TIN from a serialized source
Parameters:
Returns:

TIN Object

Return type:

geosoft.gx.GXTIN

New in version 5.0.0.

static export_xml((GXContext)ctx, (str)arg1, (int_ref)arg2, (str)arg3) → None:
Export a TIN object as XML
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – TIN file
  • arg2 (geosoft.gx.int_ref) – CRC returned (Currently this is not implemented)
  • arg3 (str) – Output XML file
Returns:

Nothing

Return type:

None

New in version 6.0.1.

get_convex_hull((GXPLY)arg1) → None:
Get the convex hull of the TIN.
Parameters:arg1 (geosoft.gx.GXPLY) – PLY object
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

The convex hull is the outside boundary of the
triangulated region.
get_ipj((GXIPJ)arg1) → None:
Get the projection.
Parameters:arg1 (geosoft.gx.GXIPJ) – IPJ in which to place the TIN projection
Returns:Nothing
Return type:None

New in version 5.0.3.

get_joins((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Get joins from a TIN mesh.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The join information is returned in three VVs.
- The joins VV is a list off the adjacent nodes for
  each node, arranged for 1st node, 2nd node etc.
- The index VV gives the starting index in the
  joins VV for the adjacent nodes to each node.
- The number VV gives the number of adjacent nodes
  for each node.
All VVs must be type GS_LONG.
get_mesh((GXVV)arg1) → None:
Get lines from a TIN mesh.
Parameters:arg1 (geosoft.gx.GXVV) – VV of type GS_D2LINE (returned)
Returns:Nothing
Return type:None

New in version 5.0.0.

get_nodes((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Get the X,Y locations and Z values of the TIN nodes.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If this is not a Z-valued TIN, the Z values will
be dummies.
get_triangle((int)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7) → None:
Get the locations of the vertices of a specific triangle
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

get_triangles((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Get the triangle nodes.
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.4.0.

get_voronoi_edges((GXVV)arg1) → None:
Get line segments defining Voronoi cells.
Parameters:arg1 (geosoft.gx.GXVV) – VV of GS_D2LINE type (create with type -32)
Returns:Nothing
Return type:None

New in version 5.0.0.

interp_vv((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Interp TINned values using the natural neighbour method.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The TIN have been created using max length = rDUMMY to
ensure that the TIN has a convex hull (otherwise the
routine that locates the triangle for a given location may fail).
The TIN must also have been created using the Z values.
Values located outside the convex hull are set to rDUMMY.
The method is based on the following paper:

Sambridge, M., Braun, J., and McQueen, H., 1995,
Geophysical parameterization and interpolation of irregular
data using natural neighbours:
Geophysical Journal International, 122 p. 837-857.
is_null() → bool

Check if the instance of geosoft.gx.GXTIN is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXTIN, False otherwise.
Return type:bool`
is_z_valued() → int:
Does the TIN contain Z values with each X,Y?
Returns:Returns True if Z values are defined in the TIN
Return type:int

New in version 5.0.0.

linear_interp_vv((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Interp TINned values using the linear interpolation
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.4.

Note:

The TIN have been created using max length = rDUMMY to
ensure that the TIN has a convex hull (otherwise the
routine that locates the triangle for a given location may fail).
The TIN must also have been created using the Z values.
Values located outside the convex hull are set to rDUMMY.

The values are set assuming that each TIN triangle defines a
plane.
locate_triangle((int)arg1, (float)arg2, (float)arg3) → int:
Get the index of the triangle containing X, Y.
Parameters:
  • arg1 (int) – seed triangle (can be iDummy or <0)
  • arg2 (float) – target X location
  • arg3 (float) – target Y location
Returns:

The index of the triangle containing X, Y.

Return type:

int

New in version 5.0.0.

Note:

Index returned begins at 0, but could be negative.
-1 If X,Y is not contained in a triangle (or triangle not found)
-2 If the location is on an edge
   This is for "fall-back" purposes only.
     Frequently edge positions are located as being part of
   a triangle, so do not rely on this result to determine
   if a node position is on an edge.
-3 If the location is a vertex.
   This is for "fall-back" purposes only in the code.
   Normal operation is to include a node position
   inside a triangle, so do not rely on this result to determine
   if a node position is input.                
nearest_vv((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Interp TINned values using the nearest neighbour.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

The TIN have been created using max length = rDUMMY to
ensure that the TIN has a convex hull (otherwise the
routine that locates the triangle for a given location may fail).
The TIN must also have been created using the Z values.
Values located outside the convex hull are set to rDUMMY.

Within each voronoi triangle, the Z value of node closest to the input
X,Y location is returned.
nodes() → int:
Returns the number of nodes in the TIN
Returns:The number of nodes in the TIN
Return type:int

New in version 5.0.0.

static null() → GXTIN

A null (undefined) instance of geosoft.gx.GXTIN

Returns:A null geosoft.gx.GXTIN
Return type:geosoft.gx.GXTIN
range_xy((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → None:
Find the range in X and Y of the TINned region.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The TINned range is the range of X and Y covered by
the TIN triangles. It can thus be less than the full
X and Y range of the nodes themselves, if a full
convex hull is not calculated.
serial((GXBF)arg1) → None:
Serialize TIN
Parameters:arg1 (geosoft.gx.GXBF) – BF in which to write TIN
Returns:Nothing
Return type:None

New in version 5.0.0.

set_ipj((GXIPJ)arg1) → None:
Set the projection.
Parameters:arg1 (geosoft.gx.GXIPJ) – IPJ to place in the TIN
Returns:Nothing
Return type:None

New in version 5.0.3.

triangles() → int:
Returns the number of triangles in the TIN.
Returns:The number of triangles in the TIN
Return type:int

New in version 5.0.0.