|
|
## General
|
|
|
|
|
|
In order to provide a free and open source solution for the creation of computational meshes, the plugin BASEmesh for the open source geographic information (GIS) software [QGIS](https://qgis.org/) was developed. The plugin utilises Jonathan R. Shewchuk's advanced mesh generator [Triangle](https://www.cs.cmu.edu/~quake/triangle.html) (Shewchuk, 1996) as its meshing algorithm.
|
|
|
|
|
|
BASEmesh version 2.x is compatible with BASEMENT v2.8 and v3.x, but requires QGIS version 3.10 or higher. For versions of BASEmesh compatible with QGIS v2.18 or versions lower than v3.10, please refer to the compatibility section of the [BASEmesh Wiki](https://git.ee.ethz.ch/basemesh/basemesh-v2/-/wikis/Reference/Version-Overview).
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
BASEmesh is available for installation through a custom plugin repository which is not included in QGIS upon installation. The BASEmesh plugin repository must be added to the QGIS plugin manager by the user prior to installation.
|
|
|
|
|
|
To install BASEmesh, follow these steps:
|
|
|
|
|
|
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* 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
|
|
|
|
|
|
Note: Under Ubuntu, it might be required to install the package *markdown2* (e.g. with the command *pip3 install markdown2*).
|
|
|
|
|
|
## Mesh generation
|
|
|
|
|
|
The following section covers the basics of mesh generation using version 2.0 of the BASEmesh plugin. For in-depth parameter explanations and advanced use-cases, refer to the [BASEmesh Manual](https://git.ee.ethz.ch/basemesh/basemesh-v2/-/wikis/Plugin/User-Manual-for-v2.0).
|
|
|
|
|
|
Mesh generation in BASEmesh v2.x is performed in two steps. First, a 2D quality mesh is generated using Triangle, which is then interpolated using one or more elevation sources. Elevation sources are either existing meshes containing elevation data (TIN), or raster data in the form of a digital elevation model (DEM). This interpolation can be performed for the mesh nodes (BASEMENT v2.8), the mesh elements (BASEMENT v3.x), or both, which allows use of the same computational grid for both environments.
|
|
|
|
|
|
### Quality mesh generation
|
|
|
|
|
|
The quality meshing utility provides a QGIS interface to the Triangle advanced mesh generator. As Triangle is two-dimensional, the generated mesh will not contain any elevation information.
|
|
|
|
|
|
The following constraints are available to control the mesh generation process:
|
|
|
|
|
|
- *Break lines*: A map layer containing lines or line strings representing distinct interruptions of the surface slope (e.g. dike crests, river side walls, ...) which will be preserved in the computational mesh. Note that you do not have to include break lines for node string definitions (see *String definitions* description below).
|
|
|
|
|
|
- *Dividing constraints*: An integer layer attribute used to split a break line before meshing. This is important when using inner boundaries in BASEMENT as the number of mesh elements at the upstream and downstream interface must be equal.
|
|
|
|
|
|
- *Constrained points*: Additional points to enforce during triangulation, such as a known measurement point.
|
|
|
|
|
|
- *Minimum angle constraint:* The minimum angle enforced for any mesh elements generated. This heavily affects the element count of the resulting mesh.
|
|
|
|
|
|
- *Maximum area constraint:* A global maximum area for any mesh elements generated. This will be overridden by any region-specific area constraints defined (see below).
|
|
|
|
|
|
In addition to the global mesh quality constraints, additional constraints may be defined for individual mesh regions. A region is any closed loop of break lines, the constraints are then applied by placing a point marker within a region.
|
|
|
|
|
|
These markers may specify up to three flags:
|
|
|
|
|
|
- *Hole marker*: Regions marked as holes will be carved out of the resulting mesh. This flag is mutually exclusive with the other flags.
|
|
|
- *MATID*: Specify the material ID for any mesh elements generated within this region.
|
|
|
- *Maximum area*: This allows overriding the global maximum area constraint for mesh elements in this region.
|
|
|
|
|
|
In BASEMENT an ordered list of neighbouring node IDs is called a *string definition* (aka. StringDef) or *node string*. In BASEmesh v2.x, their declaration is also part of the quality meshing utility.
|
|
|
|
|
|
They are defined through line strings in a separate map layer and will be preserved in the resulting mesh as break lines are:
|
|
|
|
|
|
- *String definitions layer*: A map layer containing lines defining the node strings.
|
|
|
- *String definition ID field*: The unique name attribute of a given string definition. Required for node string identification.
|
|
|
- *Include in 2DM node strings*: If checked, the node strings will be written into the 2DM mesh file using *NS* tags. Required for BASEMENT v3.x.
|
|
|
- *Write to sidecar file*: If checked, the node strings will be written into a separate text file. Require for BASEMENT v2.8.
|
|
|
|
|
|
Note that BASEMENT v3.x does not allow more than 40 nodes per node string; split your string definition lines if your meshing parameters generate meshes exceeding this limit.
|
|
|
|
|
|
### Elevation mesh generation
|
|
|
|
|
|
The elevation meshing utility generates mesh geometries in the SMS 2DM format from existing 3D input geometries. It is provided to allow generation of TIN elevation data from geometries and is not necessary if you already have raster (DEM) elevation data for your quality mesh.
|
|
|
|
|
|
You can use the *BASEmesh/Converters/Convert legacy layer* utilities in the QGIS processing toolbox to create 3D geometries from 2D geometries with elevation attributes as used in previous versions of BASEmesh. Only layers containing elevation information will be displayed for this step.
|
|
|
|
|
|
Key parameters for the elevation meshing utility:
|
|
|
|
|
|
- *Line segments*: A map layer containing 3D lines or line strings constraining the generated output geometry.
|
|
|
- *Fixed points*: A map layer containing 3D points used to further constrain the triangulation.
|
|
|
- *Keep convex hull*: If selected, the convex hull of the input data is kept and used as the mesh boundary.
|
|
|
- *Shrink to segments*: If selected, only closed areas enclosed by break lines are included in the generated mesh.
|
|
|
|
|
|
Note that in BASEmesh v2.x, there is no more differentiation between the mesh domain (aka. mesh boundary polygon) and the mesh break lines layer. For behaviour similar to previous versions of BASEmesh, merge the mesh boundary polygon lines into the break lines layer and select the *Shrink to segments* option as your mesh domain.
|
|
|
|
|
|
### Mesh interpolation
|
|
|
|
|
|
The interpolation step converts the flat quality mesh generated by Triangle into a suitable computational mesh for BASEMENT. For v2.8, this means adding elevation information to the mesh nodes, for v3.x, the elevation information is added for the mesh elements instead. This interpolation is done from one or more interpolation sources, i.e. elevation meshes (TIN) or raster data (DEM).
|
|
|
|
|
|
In basic mode, a single elevation source may be selected, though multiple elevation sources are allowed in advanced mode - refer to the Interpolation utility's help panel for details.
|
|
|
|
|
|
Be aware that the interpolation process can be time consuming for large meshes. While it is possible to interpolate both the mesh nodes and elements, this will also double the time required to complete the interpolation process. |