omfpandas.blockmodels.geometry.Geometry

class omfpandas.blockmodels.geometry.Geometry(corner, axis_u, axis_v, axis_w)[source]

Base class for geometry objects.

The geometry associated with omf block models are not defined by block centroids, and vary by block model type. In the pandas representation, the geometry is defined by the block centroids, so this class is used to define the geometry in terms of block centroids. Additionally, other properties of the geometry are defined here, such as the shape of the geometry.

Attributes (in omf and pyvista) are stored in Fortran ‘F’ order, meaning that the last index changes the fastest. Hence the MultiIndex levels need to be sorted by ‘z’, ‘y’, ‘x’, to align with the Fortran order. This has x changing fastest, z changing slowest.

__init__(corner, axis_u, axis_v, axis_w)

Methods

__init__(corner, axis_u, axis_v, axis_w)

from_element(element)

from_multi_index(index)

nearest_centroid_lookup(x, y, z)

to_json_file(json_filepath)

Write the Geometry to a JSON file.

to_multi_index()

to_summary_json()

Convert the geometry to a JSON string.

Attributes

bounding_box

centroid_u

centroid_v

centroid_w

extents

is_regular

num_cells

shape

summary

corner

axis_u

axis_v

axis_w

to_json_file(json_filepath)[source]

Write the Geometry to a JSON file.

Parameters:

json_filepath (Path) – The path to write the JSON file.

Return type:

Path

Returns:

Path to the json file.

to_summary_json()[source]

Convert the geometry to a JSON string.

Returns:

The JSON string representing the geometry.

Return type:

str