geosoft.gxpy.geometry submodule

Spatial geometric elements.

Classes:
Geometry base class for all geometries
Point (x, y, z) point
Point2 pair of Point instances that define a line, or extent
PPoint multiple Point instances

Note

Regression tests provide usage examples: geometry tests

class Geometry(coordinate_system=None)

Bases: object

Geometry base class for all geometries.

Parameters:
coordinate_system:
 geosoft.gxpy.coordinate_system.Coordinate_system instance.

New in version 9.2.

coordinate_system

geosoft.gxpy.coordinate_system.Coordinate_system instance. Can be set.

exception GeometryException

Bases: Exception

Exceptions from geosoft.gxpy.geometry.

class PPoint(xyz, z=0.0, **kwargs)

Bases: geosoft.gxpy.geometry.Geometry, collections.abc.Sequence

Poly-Point class. Basic instance arithmetic and equality testing is supported.

Parameters:
xyz:

array-like: (p1, p2, ...), ((x, y), ...), ((x, y, z), ...) or (vv_x, vv_y, [vv_z]).

vv data is resampled to match the first vv.

z:

constant z value for (x, y) data, ignored for (x, y, z) data

Properties:
pp:np_array shape (n, 3)
x, y, z:np_arrays of each ordinate set shape (n,)
xy:np_arrays of (x, y) points (n, 2)
xyz:same as pp

New in version 9.2.

copy()

return a copy as a PPoint instance

extent()

Volume extent as (Point, Point) for (min, max).

New in version 9.2.

extent_xy

Returns horizontal extent as tuple (xmin, ymin, xmax, ymax)

New in version 9.3.

extent_xyz

Returns 3D extent as tuple (xmin, ymin, zmin, xmax, ymax, zmax)

New in version 9.3.

classmethod from_list(xyzlist, z=0.0)

Deprecated since version 9.3: PPoint can create directly from a list

length

number of points

make_xyz_vv()

Return x, y and z as a set of geosoft.gxpy.vv.GXvv.

Returns:(xvv, yvv, zvv)

New in version 9.2.

x

x array slice, can be set

xy

(x, y) array slice, can be set

xyz

xyz point array

y

y array slice, can be set

z

z array slice, can be set

class Point(p, **kwargs)

Bases: geosoft.gxpy.geometry.Geometry

Spatial location (x,y,z). Basic instance arithmetic and equality testing is supported.

Parameters:
p:

point in one of the following forms:

Point instance, returns a copy

(x, y [,z]) implied z is 0.0 if not provided

k makes a point (k, k, k)

Properties:
x, y, z:point ordinate values
xy:(x, y) tuple
xyz:(x, y, z) tuple

New in version 9.2.

copy()

return a copy as a Point instance

x

x value, can be set

xy

(x, y), can be set

xyz

(x, y, z), can be set

y

y value, can be set

z

z value, can be set

class Point2(p, **kwargs)

Bases: geosoft.gxpy.geometry.Geometry

Two points, for a line, or a rectangle, or a cube. Basic instance arithmetic and equality testing is supported.

Parameters:
p:

Points in one of the following forms:

(Point, Point)

((x, y [,z]), (x, y [,z])) implied z is 0 if not specified

(x0, y0, x1, y1) implied z is 0

(x0, y0, z0, x1, y1, z1)

Properties:
p0:first Point instance
p1:second Point instance
x2, y2, z2:tuple pairs for (x0, x1), (y0, y1), (z0, z1)
centroid:center of the two points as a Point
dimension:(dx, dy, dz) dimension defines by two points.

New in version 9.2.

centroid

centroid on the line as a Point instance

copy()

return a copy as a Point2 instance

dimension

dimensions as (dx, dy, dz)

extent_xy

Extent as (xmin, ymin, xmax, ymax)

extent_xyz

Extent as (xmin, ymin, zmin, xmax, ymax, zmax)

x2

(x0, x1), can be set

y2

(y0, y1), can be set

z2

(z0, z1), can be set