omfpandas.blockmodels.geometry.RegularGeometry
- class omfpandas.blockmodels.geometry.RegularGeometry(corner, axis_u, axis_v, axis_w, block_size, shape=None)[source]
Regular geometry data class.
Regular Geometry applies to an omf.v1 VolumeElement or an omf.v2 RegularBlockModel.
Methods
__init__
(corner, axis_u, axis_v, axis_w, ...)from_element
(element)from_extents
(extents, block_size[, axis_u, ...])Create a RegularGeometry from extents.
from_json
(json_str)Deserialize a JSON string to a full geometry object.
from_multi_index
(index[, axis_u, axis_v, axis_w])nearest_centroid_lookup
(x, y, z)Find the nearest centroid for provided x, y, z points.
Convert a RegularGeometry to an encoded integer index
to_json
()Convert the full geometry to a JSON string.
to_json_file
(json_filepath)Write the Geometry to a JSON file.
Convert a RegularGeometry to a MultiIndex.
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
block_size
corner
axis_u
axis_v
axis_w
- classmethod from_extents(extents, block_size, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1))[source]
Create a RegularGeometry from extents.
- Return type:
- classmethod from_json(json_str)[source]
Deserialize a JSON string to a full geometry object.
- Return type:
- nearest_centroid_lookup(x, y, z)[source]
Find the nearest centroid for provided x, y, z points.
- Parameters:
x (float) – X coordinate.
y (float) – Y coordinate.
z (float) – Z coordinate.
- Returns:
The coordinates of the nearest centroid.
- Return type:
Point3