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.post1.tar.gz (398.8 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.post1-cp314-cp314-win_amd64.whl (432.7 kB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for basemesh-2.2.1.post1.tar.gz
Algorithm Hash digest
SHA256 fe8d76214c78e9ee88124f32c0c3a28e152b59bc103073863e09877782b599de
MD5 24f7d259ca03b4054598a59a1ddf6835
BLAKE2b-256 7d1374c3058a41418b1d3cb0b8a93c379782c72d8185b0c9d047a0abb1a52552

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 20f3a407fdccbfdbf5ffd9766609ba089617f468cc8b125499063127d483b893
MD5 aed96ac6fb77e54a63b8301a6a2b71c1
BLAKE2b-256 907e4ce23bf1b41764bbe40f99b8b7d0794d889fed4d13e8553f477afc6b336c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4103358fbedf3483d329d8d8de457a408768322abaeeed6acb3f1e406bce3a67
MD5 7c86617082e44cc6c0fd1d79162724c9
BLAKE2b-256 22777fd94777eb01ec530265cb9d47f705d1c92107af4dee2245b185c867f7aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bcc18100a091e13ddabfdefd5886fef459821e4029f67cb73962c1cde00c30da
MD5 ecb9db3cf09b3e0c24f5572d3c4720e1
BLAKE2b-256 8300fac8902f68394a1a75038f714fda74fd0399bfc1c9d9a0aab05e611f0168

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 64d76c2dee5ff6bc07f359c615afd9eaf9d988e6f461f77b0ab19aed807b7b49
MD5 bc5312195ceec81d65f3e6b12c5f33e0
BLAKE2b-256 386d343a01f7f1d0ddc567f7c0b2298e038d103aed319d36cddd4ce601be5020

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 55a3d445763c191594d781ab428e05aaf16086a68996af7da8e524ef52144381
MD5 6ea67b5156f5a36ad1a254dda894397d
BLAKE2b-256 ff5f006601605db5a1a6cac1933aac9ffe238e026ffe0cc95291461f7c17abd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basemesh-2.2.1.post1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5b47e8bfb2ea70b08fb8449f6fa2d3ac23b3fd778e7bc0d701082adef2c2aa6c
MD5 a8de367fd602ce69f7f0d599351cc8a2
BLAKE2b-256 7b2198c93b1c0e34f55e7fbdecb524d72f0ea1a7c17bd8d24771d3f12dc3760d

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