Expand description
Reader and writer for Open Mining Format version 2, a standard for mining data interchange backed by the Global Mining Guidelines Group.
Warning: This is a beta release of OMF 2. The storage format and libraries might be changed in backward-incompatible ways and are not subject to any SLA or deprecation policy. Further, this code is unfinished and may not be secure. Don’t use it to open files you don’t trust, and don’t use it in production yet.
§What is OMF
OMF is an open-source serialization format and library to support data interchange across the entire mining community. Its goal is to standardize file formats and promote collaboration.
This repository provides a file format specification and a Rust library for reading and writing files, plus wrappers to use that library from C and Python.
§Getting Started
The Reader and Writer objects are the starting points for reading and writing files. Error is the combined error type for everything. Project is the root object of the data contained within the file, storing a list of elements, each containing some geometry and a list of attributes.
Supported element geometries are:
- Points.
- Line segments.
- Triangulated surfaces.
- Grid surfaces.
- Regular or tensor grid spacing.
- Any orientation.
- Block models, with optional sub-blocks.
- Regular or tensor grid spacing.
- Any orientation.
- Regular sub-blocks that lie on a grid within their parent, with octree or arbitrary layout.
- Free-form sub-blocks that don’t lie on any grid.
- Composite elements made out of any of the above.
Supported attribute data types are:
- Floating-point or signed integer values, including date and date-time values.
- Category values, storing an index used to look up name, color, or other sub-attributes.
- Boolean or filter values.
- 2D and 3D vector values.
- Text values.
- Color values.
- Projected texture images.
- UV mapped texture images.
Attributes values can be valid or null. They can be attached to different parts of each element type, such as the vertices vs. faces of a surface, or the parent blocks vs. sub-blocks of a block model.
Modules§
- array_
type - data
- date_
time - Utility functions for date and date-time conversion.
- error
- Error codes and details.
- file
- Contains the
Reader
andWriter
objects. - omf1
- Convert existing OMF v1 files to OMF v2.
- validate
- Validation tools.
Structs§
- Array
- Attribute
- Describes data attached to an
Element
. - Block
Model - Block model geometry with optional sub-blocks.
- Composite
- A container for sub-elements.
- Element
- Defines a single “object” or “shape” within the OMF file.
- Grid
Surface - A surface defined by a 2D grid a height on each grid vertex.
- LineSet
- A set of line segments.
- Orient2
- Defines the position and orientation of a 2D plane in 3D space.
- Orient3
- Defines the position and orientation of a 3D sub-space.
- Point
Set - Point set geometry.
- Project
- Root object of an OMF file.
- Surface
- A surface made up of triangles.
Enums§
- Attribute
Data - The various types of data that can be attached to an
Attribute
. - Data
Type - Geometry
- Selects the type of geometry in an
Element
from several options. - Grid2
- Defines a 2D grid spacing and size.
- Grid3
- Defines a 3D grid spacing and size.
- Location
- Describes what part of the geometry an attribute attaches to.
- Number
Colormap - Describes a mapping of floating-point value to colors.
- Number
Range - Specifies the minimum and maximum values of a number colormap.
- Subblock
Mode - A optional mode for regular sub-blocks.
- Subblocks
- Stores sub-blocks of a block model.
Constants§
- CRATE_
NAME - Library name.
- CRATE_
VERSION - Library version.
- FORMAT_
EXTENSION - File format extension.
- FORMAT_
NAME - File format name.
- FORMAT_
VERSION_ MAJOR - File format major version number.
- FORMAT_
VERSION_ MINOR - File format minor version number.
- FORMAT_
VERSION_ PRERELEASE - File format pre-release version suffix.
Traits§
Functions§
- crate_
full_ name - Returns the crate name and version.
- format_
full_ name - Returns a string containing the full name and version of the file format that this crate produces.
- format_
version - Returns a string containing the file format version that this crate produces.
- json_
schema