mapteksdk.data.geotechnical module

Module containing geotechnical objects. Currently this only includes discontinuities, however in the future it may contain other geotechnical objects such as stereonets.

class mapteksdk.data.geotechnical.Discontinuity(object_id=None, lock_type=LockType.READWRITE)

Bases: mapteksdk.data.base.Topology

A discontinuity (Also known as a tangent plane). These are generally used to mark a change in the physical or chemical characteristics in soil or rock mass.

Discontinuities with similar properties are often placed in special containers known as discontinuity sets.

Examples

The simplest way to define a discontinuity is to define the planar points. This example defines a discontinuity using points in the plane with the equation 3x - y + 2z + 4 = 0. The other properties are automatically derived from the points used to define the discontinuity.

>>> from mapteksdk.project import Project
>>> from mapteksdk.data import Discontinuity
>>> points = [[1, 1, -3], [-1, 2, 0.5], [-2, -2, 0],
...           [0, -2, -3], [-4, 0, 4], [2, 2, -4]]
>>> project = Project()
>>> with project.new("geotechnical/3x-y+2z+4", Discontinuity) as plane:
...     plane.planar_points = points
>>> with project.read(plane.id) as read_plane:
...     print("Dip: ", read_plane.dip)
...     print("Dip direction: ", read_plane.dip_direction)
...     print("Location: ", read_plane.location)
...     print("Area: ", read_plane.area)
...     print("Length: ", read_plane.length)
Dip:  1.0068536854342678
Dip direction:  1.8925468811915387
Location:  [-0.66666667  0.16666667 -0.91666667]
Area:  28.062430400804566
Length:  10.198039027185569

A discontinuity can also be defined by setting the dip, dip direction and location. This is less preferable than the other methods because the discontinuity will not have a length or area.

>>> import math
>>> from mapteksdk.project import Project
>>> from mapteksdk.data import Discontinuity
>>> project = Project()
>>> with project.new("geotechnical/simple", Discontinuity) as plane:
...     plane.dip = math.pi / 4
...     plane.dip_direction = math.pi / 2
...     plane.location = [4, 2, 1]
>>> with project.read(plane.id) as read_plane:
...     print("Points", read_plane.planar_points)
...     print("Area: ", read_plane.area)
...     print("Length: ", read_plane.length)
Points [[3.29289322 2.         1.70710678]
[4.35355339 1.1339746  0.64644661]
[4.35355339 2.8660254  0.64644661]]
Area:  nan
Length:  nan

when creating a new discontinuity, it possible to define the planar points and the dip, dip direction and location. This causes the points to be projected onto the plane defined by the dip and dip direction and to be translated to be centred at the specified location. In the below example, though the points are originally centred around the origin and in the XY plane they are translated to be centred around the new centre and to be in the new plane.

>>> import math
>>> from mapteksdk.project import Project
>>> from mapteksdk.data import Discontinuity
>>> points = [[-1, -1, 0], [1, -1, 0], [-1, 1, 0], [1, 1, 0]]
>>> project = Project()
>>> with project.new("geotechnical/both", Discontinuity) as plane:
...     plane.planar_points = points
...     plane.dip = math.pi / 4
...     plane.dip_direction = math.pi / 2
...     plane.location = [4, 2, 1]
>>> with project.read(plane.id) as read_plane:
...     print("Points", read_plane.planar_points)
...     print("Dip: ", read_plane.dip)
...     print("Dip direction: ", read_plane.dip_direction)
...     print("Location: ", read_plane.location)
...     print("Area: ", read_plane.area)
...     print("Length: ", read_plane.length)
Points [[3.29289322 3.         1.70710678]
 [3.29289322 1.         1.70710678]
 [4.70710678 3.         0.29289322]
 [4.70710678 1.         0.29289322]]
Dip:  0.7853981633974482
Dip direction:  1.5707963267948966
Location:  [4. 2. 1.]
Area:  4.0
Length:  2.8284271247461907
classmethod static_type()

Return the type of a topology as stored in a Project.

This can be used for determining if the type of an object is topology.

property planar_points

The points used to define the discontinuity. This is an array of floats of shape (n, 3) where n is the planar_point_count. These points are coplanar.

When set the first three of these points are used to define the dip and dip direction. If the first three points are collinear, the resulting discontinuity object will be empty.

Raises

ValueError – If set to an array containing less than three points.

property planar_point_count

The number of points used to visualize the discontinuity.

property planar_facets

The facets used to visualise the discontinuity. These are derived from the points and do not support direct assignment.

If you change planar_points, the corresponding changes to the planar_facets will not occur until save() is called.

property planar_facet_count

The count of facets used to visualise the discontinuity.

property planar_colour

The colour of the facets. This is a single value used for all facets.

The alpha value has no effect. This is provided as an RGBA colour for consistency.

property dip

The dip of the discontinuity. This is the angle in radians the discontinuity is rotated by in the dip direction.

The dip and dip direction, taken together, define the plane the discontinuity lies in. If they are changed, upon save() the planar_points will be projected to lie on the new plane.

Raises

ValueError – If set to an value which cannot be converted to a float, or is below zero or greater than pi / 2.

Warning

Dip values close to zero cause issues with calculating the dip direction which can result in unintuitive behaviour.

property dip_direction

The dip direction of the discontinuity. This is the angle in radians around the z axis which the plane is rotated by dip radians.

The dip and dip direction, taken together, define the plane the discontinuity lies in. If they are changed, upon save() the planar_points will be projected to lie on the new plane.

Raises

ValueError – If set to a value which cannot be converted to a float, or is below zero or greater than or equal to 2 * pi.

Notes

For completely horizontal discontinuities, this may be NaN.

property strike

The strike of the discontinuity. This is the angle in radians to the y axis of the line of intersection between the discontinuity plane and the horizontal plane (XY plane).

This is derived from the dip direction. Changing the dip direction will change the strike and vice versa.

Raises

ValueError – If set to a value which cannot be converted to a float, or is below zero or greater than or equal to 2 * pi.

Notes

For completely horizontal discontinuities, this may be NaN.

property plunge

The plunge angle of the discontinuity.

This is derived from the dip - changing the dip will change the plunge and vice versa.

Raises

ValueError – If set to a value which cannot be converted to a float, or is below zero or greater than pi / 2.

Notes

The dip and plunge for a discontinuity always add up to pi / 2.

property trend

The trend of the discontinuity in radians.

This is derived from the dip direction. Changing the dip direction will change the trend and vice versa.

Raises

ValueError – If set to a value which cannot be converted to a float, or is below zero or greater than or equal to pi * 2.

property length

The length of the discontinuity. This is the diameter of the smallest sphere capable of containing all of the points.

Notes

For empty discontinuities, the length will be NaN.

property location

The location of the discontinuity in the form [X, Y, Z].

By default, this is the mean of the points used to construct the discontinuity.

Notes

For empty discontinuities, this will be NaN.

property area

The scaled area of the discontinuity.

Changes to the area will not occur until save() is called. This may not be exactly equal to the area of the planar facets.

save()

Save the changes made to the object.

Generally a user does not need to call this function because it is called automatically at the end of a with block using Project.new() or Project.edit().