Skip to main content

Pre-processing and mesh generation toolkit for BASEMENT.

Project description

BASEmesh

BASEmesh is a mesh generation and preprocessing toolkit for the numerical simulation package BASEMENT.

Highlights

  • Generation of 2D quality meshes using Jonathan Shewchuk's Triangle
  • 2DM mesh interpolation via mesh and raster (DEM) elevation sources
  • Available as QGIS plugin
  • Optional C extension module for acceleration
  • 1D channel generator BASEchange

Installation

As BASEmesh is available as both a Python module and QGIS plugin, the installation path depends on the version:

QGIS Plugin

  1. Start QGIS
  2. Load the QGIS plugin manager by choosing 'Manage and Install Plugins…' in the 'Plugins' category of the QGIS toolbar
  3. Select 'Settings' from the left panel
  4. Click on 'Add…' and provide a descriptive name, e.g. 'BASEmesh Plugin Repository'
  5. Specify the repository address: https://people.ee.ethz.ch/~basement/qgis_plugins/qgis_plugins.xml
  6. Press OK to confirm; a new entry has been added to the list of plugin repositories (make sure the Status field reports as connected before continuing)
  7. Select 'All' from the left panel of the plugin manager and search for ''BASEmesh''
  8. Choose the BASEmesh plugin (if several are available, choose the one with the highest version number) and press 'Install Plugin'
  9. Close the plugin manager. A new toolbar should have appeared and a 'BASEmesh' entry added to the 'Plugins' category of the QGIS toolbar

Alternatively, you can also find a ZIP version of a given BASEmesh release under the repository Releases page, which can be installed using the 'Install from ZIP…' option in the QGIS plugin manager.

Python Module Installation

Note: Installation of the Python module is not required for QGIS plugin use. It is only required for command line tools such as BASEchange or when using BASEmesh as a dependency for user code.

python -m pip install --user --upgrade basemesh

Getting Started

Note: This section only covers use of the QGIS plugin and related utilities.

For usage instruction on the 1D channel generator, refer to the BASEchange Wiki pages.

If you wish to use BASEmesh as a dependency, it is recommended to locally build the Python API Documentation for detailed reference. Prior familiarity with the BASEmesh workflow via the plugin is recommended.

BASEmesh Workflow Overview

The BASEmesh workflow consists of three steps:

  1. Elevation mesh generation (optional if you have raster elevation data)
  2. Quality mesh generation
  3. Mesh interpolation

The following sections will cover the basics of how to use each tool. Note that this is purely a first introduction into the process and will skip a lot of the nuances regarding model setup and mesh generation. You can find additional information in the utilities' 'Help' tab.

Visit the repository Wiki for detailed guides and examples.

If you are a seasoned user of BASEmesh v1.4.5, check out the Migration guide for details on how to convert your existing projects for this version of BASEmesh.

Elevation Mesh Generation

Elevation meshes are generated to represent the elevation geometry of your model. They provide an alternative to raster DEM data and allow the interpolation of a 2D quality mesh onto an elevated geometry.

3D Input Geometry

To generate an elevation mesh, you require input geometry in the form of 3D vector layers. These will generally take the form of 3D poly lines or points.

If your input geometry is not 3D, you can use the 'Convert Legacy Layer (…)' algorithms in the QGIS Processing Toolbox to add elevation information via layer attributes.

Mesh Domain

By default, the elevation meshing utility will use the 'Keep convex hull' mesh domain setting. This means that the outer edge of the generated mesh will equal the convex hull of your input data.

This allows the generation of a mesh from point data only, but it will also "eat" any concavities, which is generally not an issue when using a single elevation data source.

If you do require concavities, make sure you have a closed line string where you would like your mesh to end, then choose the 'Shrink to segments' mesh domain setting. This will delete any geometries that are not contained within the outermost closed line string found. Note that this can "eat" your entire mesh if the outside line string is missing or has any gaps.

Snapping Tolerance

If you know your input data is not perfect (which is highly likely with real-world GIS data), you can use the 'Snapping Tolerance' setting to define a fuzz range at which geometry will be snapped to each other. The value set in the GUI is the exponent; a value of -2 means that any points within 0.01 units will be considered coincident.

Quality Mesh Generation

The quality mesh defines the actual computational grid used for the simulation. It will always be flat, i.e. not contain any elevation information whatsoever.

2D Input Geometry

Quality meshing is entirely two-dimensional, any elevation information in the input data will be discarded if provided.

Make sure that your break lines enclose the outside perimeter of your mesh.

Mesh Regions

Any segment-bounded region in the mesh can be assigned a Material ID and element size constraint. This is done via a region marker point layer with the appropriate fields:

Field Description Type
Hole marker Any region with a hole marker will be carved out of the resulting mesh Integer
Material ID Used to define area-specific parameters such as friction or soil composition Integer
Maximum area The maximum area of any mesh element in this region Real

String Definitions

String definitions are node strings used to keep track of specific cross-sections in the mesh, either to serve as a boundary condition or as an output.

They are defined by named line string features in their own layer and will be automatically merged into the mesh break lines upon meshing. After the meshing is complete, these line strings are then used to retrieve the mesh nodes that were generated along these break lines.

You can include string definitions in the generated 2DM file (this is the required format for BASEMENT 3) or write them to a separate text file (for BASEMENT 2.8). You can also check both options if you wish to compare results from both versions.

Mesh Interpolation

The mesh interpolation utility takes an existing, flat quality mesh and drapes it over an elevation source.

This can either be a previously generated mesh layer, or a DEM raster layer and band.

Basic Mode

In this mode, only a single elevation source may be selected. If the quality mesh extends beyond the provided elevation source, meshing will fail.

Advanced Mode

This mode has two panels, with the available elevation sources to the right and an empty list to the left.

You can select any number of elevation sources from the right panel and drag them into the left in any order. Only elevation sources in the left panel will be used for interpolation, with the higher-ranked sources taking priority.

For and point in the quality mesh that must be interpolated, the first elevation source is queried first. If it can produce a value, this value will be used right away, just as in Basic mode.

If an elevation source cannot produce a value, the elevation source below it will be queried instead, until one manages to produce a value, or the entire list is exhausted.

This allows for multi-source interpolation, e.g. an elevation mesh for the river itself, a fine-grid DEM for its immediate surroundings and a coarser DEM for floodplains further away.

Output Formats

BASEMENT 2.8 only uses node elevation data, whereas BASEMENT 3 only uses element face elevation for its simulation.

The 'Output mesh format' drop down list may be used to select either or both elevation sources.

Note that due to the node and element elevation being independent, the 'BASEMENT 2 and 3 (node and element elevation)' setting will have roughly twice the execution time as either setting on its own.

The mesh generated by the interpolation utility is now ready for use in BASEMENT, no additional exporting steps are necessary.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basemesh-2.2.1.tar.gz (398.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

basemesh-2.2.1-cp314-cp314-win_amd64.whl (427.5 kB view details)

Uploaded CPython 3.14Windows x86-64

basemesh-2.2.1-cp313-cp313-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.13Windows x86-64

basemesh-2.2.1-cp312-cp312-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.12Windows x86-64

basemesh-2.2.1-cp311-cp311-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.11Windows x86-64

basemesh-2.2.1-cp310-cp310-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.10Windows x86-64

basemesh-2.2.1-cp39-cp39-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file basemesh-2.2.1.tar.gz.

File metadata

  • Download URL: basemesh-2.2.1.tar.gz
  • Upload date:
  • Size: 398.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1.tar.gz
Algorithm Hash digest
SHA256 aefc2ea1e55f7ffec48cdb260f0226952414803faee3c5142df7e5d853b9e2a1
MD5 755c16ae27c2f8823651425f1d9848d8
BLAKE2b-256 8ce4530de96cdb171deb3834ace81a948142cc0018dce6da00d84176451f4e42

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 427.5 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b3450cb49addbcb927bd550b908d30b06d10f177fc0d34e02426a18e846d4125
MD5 47a8215528c52da5c1a866eb0ac532c2
BLAKE2b-256 7c0cb16d67be1b207193ec40b815c83608b5202d4d41fb46234a2fb83539f3c7

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 48ea93e9e0af62a5765bb6b974aa8526c747e97f5edf82f128246a99b78e74b7
MD5 140877ec6d1cc1b530d8759c74df9338
BLAKE2b-256 000b4bb8e9a710b3e5152c0fd17804499b0946182e3629349ac6113cf55c37c1

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 209a33eb4e54a977dd0bc8ff1a6f65931872c903cacdfc3f8961c8fa78cb743b
MD5 60d8506a5ba883e01a877786ca273e5b
BLAKE2b-256 b7e4bead2d67ba6b511cc79b8ef6f6c32735ac3657de64f09f3325ae23627ffd

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bdf9a8d147d59a4b9b7f4644bfa1fc0bbab9fa77dd052201a827560468845ce8
MD5 81cf0362e9a8cd64324451b6e04d4212
BLAKE2b-256 d2d2f1c71a889f4a5422e92935ad6358c5e177df72a0fd6321e7b4e616ef98b3

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bca2ffd6f54b3f1f3ee6431db06a54b61337956446e38715a6e3ea445adfd2bc
MD5 0f4a37687196fc81bac733f7af8cec5a
BLAKE2b-256 9dd8548e5e3063091c793ba3194717f8f64c5d605c412ef54d90c2cf48c404d6

See more details on using hashes here.

File details

Details for the file basemesh-2.2.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: basemesh-2.2.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for basemesh-2.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 78e678cdb2fd1b376217c7e27c7a460bebf0e961fb4c4dd37fff5d3b04ec476d
MD5 127dc2e6e64763f1fa2a26d8975fe629
BLAKE2b-256 6120c07d2f3701605667de772d2d12e47b51e90db8b22d3072462810e7cc8bc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page