Skip to main content

lithovox-exports

Turn the voxel models LithoVox delivers (model.nc) into input for your own software: D-Stability, D-Geo Flow, XSLOPE and DXF cross-sections, and GLB, 3D Tiles and LAZ for the whole model.

This is the same code the LithoVox viewer exports with, so a file made here is identical to one downloaded from the viewer.

Installation

pip install lithovox-exports

or, in a uv project, uv add lithovox-exports. Python 3.12 or newer.

Quick start

from lithovox_exports import Model

model = Model("model.nc")
print(model.name, model.length, model.soils)

# A cross-section at chainage 250 m, as a D-Stability model
section = model.cross_section(250)
section.to_dstability("km0.250.stix")

Cross-sections

A cross-section lies square to the model's chainage line, at the model column nearest the chainage you ask for. Its soil boundaries are traced from the voxels and smoothed into polygons that share their points exactly with their neighbours and have no holes (as D-Stability requires).

section = model.cross_section(250)               # smoothed boundaries
blocky = model.cross_section(250, smoothing=0)   # the voxels' staircase

section.to_dstability("km0.250.stix")   # D-Stability
section.to_dgeoflow("km0.250.flox")     # D-Geo Flow
section.to_xslope("km0.250.zip")        # XSLOPE: .xlsx + its colours, zipped
section.to_xslope("km0.250.xlsx")       # or the .xlsx with *_styles.json beside it
section.to_dxf("km0.250.dxf")           # DXF (e.g. GEO5, CAD)

Every 50 m along the whole model:

for chainage in range(0, int(model.length) + 1, 50):
    section = model.cross_section(chainage)
    section.to_dstability(f"{section.label}.stix")   # km0.000.stix, km0.050.stix, ...

Your own soil parameters (D-Stability, XSLOPE)

By default the soils have names only. Pass a D-Stability file with your soil library to use its soils and parameters. A model soil gets the library soil with the same code or name (ignoring case, spaces, _ and -), or the one you name in mapping (model soil name → library soil code; None for none):

section.to_dstability(
    "km0.250.stix",
    soils="my_soils.stix",
    mapping={"Klei siltig": "K_siltig", "Veen": "V_mineraalarm"},
)
section.to_xslope("km0.250.zip", soils="my_soils.stix", mapping={"Veen": "V_mineraalarm"})

XSLOPE materials take the unit weights and, for Mohr-Coulomb soils, c and phi.

Water levels, loads, meshes and calculation settings are always left to you.

The whole model

model.to_glb("model.glb")      # 3D mesh, e.g. Blender or a 3D viewer
model.to_tiles("tiles.zip")    # OGC 3D Tiles (3d/tileset.json), e.g. Cesium, ArcGIS
model.to_laz("model.laz")      # point cloud, e.g. QGIS, ArcGIS

Each takes voxel_width and voxel_height (m; default 1.0 and 0.2): the model is shown with voxels of about that size, each getting the soil most of its model voxels have. Larger voxels make smaller files.

Coordinates

  • Cross-sections: x is the offset from the chainage line (m, positive inwards), z is the height (m NAP). section.start and section.end give the RD coordinates of the cross-section's ends.
  • The whole model: RD New + NAP (EPSG:7415). The LAZ file has a point per voxel, classified as 64 + the soil's code (model.soils[code]).

More

section.polygons holds the soil polygons themselves (soil is an index into model.soils, points the outline as (x, z)), and model.metadata all of the model's metadata, if you want to make your own export.

Questions or a format you need: lithovox@pm.me, https://www.lithovox.com.

Metadata

Release files for lithovox-exports 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lithovox-exports 0.1.0
File Size Uploaded Provenance Actions
lithovox_exports-0.1.0.tar.gz 75.9 kB Without provenance Details for lithovox_exports-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lithovox-exports 0.1.0
File Interpreter ABI Platform Actions
lithovox_exports-0.1.0-py3-none-any.whl Python 3 none any Details for lithovox_exports-0.1.0-py3-none-any.whl

Total release size: 156.6 kB

Release files / lithovox_exports-0.1.0.tar.gz

Download URL lithovox_exports-0.1.0.tar.gz
Size 75.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1f50ae00e85a21bb6ad61b16144c8950458d7b92891cd337d9dd4402d2d0d6ba
BLAKE2b-256 checksum
How to use checksums
ef8c9afff078b0c258c0b6045efece14b0a88428acbbdcb52d88f7e7a47e0c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lithovox_exports-0.1.0-py3-none-any.whl

Download URL lithovox_exports-0.1.0-py3-none-any.whl
Size 80.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96ab5e5f60719a8ba1676768a405513f10e13ecf315515328ca930a31d6a4ad5
BLAKE2b-256 checksum
How to use checksums
eb3b230a5e0cafc2f05c326de24aa215d597301e5238d8030c4a3ae70031bda8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lithovox-exports 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page