geosoft.gxpy.geometry submodule

Spatial geometric elements.

Classes:
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 geosoft.gxpy.geometry.Geometry(**kwargs)

Bases: object

Geometry base class for all geometries.

Parameters:coordinate_systemgeosoft.gxpy.Coordinate_system instance.

New in version 9.2.

coordinate_system

geosoft.gxpy.Coordinate_system instance. Can be set.

exception geosoft.gxpy.geometry.GeometryException

Bases: Exception

Exceptions from geosoft.gxpy.geometry.

class geosoft.gxpy.geometry.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, either ((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
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()

Returns extent of the polyline.

Returns:(min, max) as Point instance pair
classmethod from_list(xyzlist, z=0.0)
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 geosoft.gxpy.geometry.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   makes 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 geosoft.gxpy.geometry.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 as a Point instance
p1:second point at a Point instance
x2, y2, z2:tuple pairs for (x0, x1), (y0, y1), (z0, z1)
centroid:center of the two points
dimension:(dx, dy, dz) dimension defines by teo 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)

x2

(x0, x1), can be set

y2

(y0, y1), can be set

z2

(z0, z1), can be set