|
|
Recent projects inside and outside of VAW faced the issue of needing to include break lines and corresponding hole markers for buildings in their mesh. For smaller datasets, handling these manually by drawing break lines and inserting region points is feasible using the normal BASEmesh workflow.
|
|
|
|
|
|
At VAW, our project required building outlines and holes for most settlements around Lake Lucerne, leading to over 10'000 buildings and 100'000+ break lines. The project-specific tools developed for this project have since been revised and are available as a complimentary toolkit.
|
|
|
|
|
|
The remainder of this document will showcase its use using a sample mesh and building outlines from the freely available SwissTopo 3D dataset. Note that BASEmesh v2.2+ is required for this as this workflow relies on new functionality that was not available in previous plugin versions.
|
|
|
|
|
|
- [SwissTopo Datasets](https://www.swisstopo.admin.ch/en/geodata/landscape/tlm3d.html#download)
|
|
|
- [Download BASEmesh Building Outlines Tools](uploads/6f99b8e67245df20875b276dee524d43/Building_Footprint_Tools.zip)
|
|
|
- [Download Sample Project](uploads/4c3b5c9fe534177e7081703a1062d8ce/Example_-_Building_Footprints.zip)
|
|
|
|
|
|
## Toolkit Contents
|
|
|
|
|
|
In addition to BASEmesh v2.2, this toolkit relies on the following custom QGIS processing workflows.
|
|
|
|
|
|
Note at these workflows are independent and can be combined with other GIS operations, the numbering is primarily an indicator of what worked best.
|
|
|
|
|
|
### 1 - Building Rasterization
|
|
|
|
|
|
*Note: this tool was originally used but is no longer required due to other changes in BASEmesh. It is provided for reference or for particularly bad data, but will not be used in this example.*
|
|
|
|
|
|
This is a simple algorithm that rasterizes a given input polygon dataset before converting the output back into a polygon dataset. Note that this comes with major artifacts for diagonal lines which must be cleaned up using simplification later.
|
|
|
|
|
|
### 2 - Make Watertight
|
|
|
|
|
|
An alternative to the previous one with the goal of avoiding artifacts while still closing small gaps between buildings.
|
|
|
|
|
|
It first expands all polygons by the given amount, merges any overlaps, and then shrinks the outlines back to their original size. This both eliminates thin channels of tiny elements, and also removes minor surface details from the outlines.
|
|
|
|
|
|
### 3 - Delete Holes
|
|
|
|
|
|
Processes the building outlines generated by the previous tool to remove unreachable parts of the mesh, such as inner courtyards of buildings.
|
|
|
|
|
|
### 4 - Insert Region Points
|
|
|
|
|
|
This is the primary workflow to use for building outlines in BASEmesh. It requires clean input polygons as it is directly used to generate the output break liens that will be meshed in Triangle.
|
|
|
|
|
|
This takes in the existing, manually-placed break lines and region points, and combines the with the ones generated by the building outlines.
|
|
|
|
|
|
Triangle may not be able to mesh correctly if the preexisting break lines intersect any building footprints. In these cases, consider revising the original break lines according to the building placement, or manually trim them to end at a building's boundary.
|
|
|
|
|
|
## Sample Dataset Walkthrough
|
|
|
|
|
|
### 1 - Extracting Building Footprints
|
|
|
|
|
|
To reduce download size, the sample dataset already contains the building footprints required. For different datasets, you may need to manually retrieve the footprints for your mesh domain. This section will cover this process.
|
|
|
|
|
|
- Create a copy of the `Quality Breaklines` layer and delete all but the outermost break lines.
|
|
|
|
|
|
- Run the `Lines to Polygons` algorithm from the QGIS toolbox to create a single polygon representing the mesh domain.
|
|
|
|
|
|
- Load the `swissTLM3D_TLM_GEBAEUDE_FOOTPRINT.shp` layer from the SwissTLM dataset.
|
|
|
|
|
|
- Run the `Extract by location` algorithm from the QGIS toolbox and extract any features `within` the previously created mesh domain polygon.
|
|
|
|
|
|
- Save the resulting features and unload the original SwissTLM dataset.
|
|
|
|
|
|
In the sample dataset, the layer created by this was saved as `swissTLM3D Footprints Contained` and has been included in the download.
|
|
|
|
|
|
### 2 - Simplifying & Consolidating Footprints
|
|
|
|
|
|
Zooming in on a given cluster of building outlines will reveal numerous self-intersections and overlapping geometries that are unsuitable for use in BASEmesh.
|
|
|
|
|
|
Ensure the custom workflows listed above are loaded into QGIS. They should be available in a separate *'Models'* section of the QGIS toolbox sidebar.
|
|
|
|
|
|
Start with the *'Make building footprints watertight'* and specify the `swissTLM3D Footprints Contained` layer as the target. A buffer distance of 1-2 meters works well for this dataset, higher values will cause more simplification of the outlines.
|
|
|
|
|
|
The resulting output layer shows no more self-intersections and will close any small gaps in the outlines. Holes such as those from inner courtyards may still be present.
|
|
|
|
|
|
### 3 - Remove Holes
|
|
|
|
|
|
Run the *'Close building outline holes'* algorithm to close any holes in the polygons.
|
|
|
|
|
|
This avoids the creation of unnecessary cells which can never get wetted during the simulation as they are not connected to the bulk of the mesh.
|
|
|
|
|
|
### 4 - Place Region Markers & Convert Outlines
|
|
|
|
|
|
Finally, run the *'Place region markers'* algorithm to finalize the output geometry.
|
|
|
|
|
|
In addition to the cleaned building footprints, this also takes in the original break lines and manually placed region markers, which are automatically merged with the hole markers generated from the building outlines.
|
|
|
|
|
|
Note that this does not check if any buildings lie on top of any input break lines, which may prevent mesh holes from being generated correctly. To check if any break lines intersect building footprints, consider the *'Select by location'* algorithm from the QGIS toolbox.
|
|
|
|
|
|
This algorithm generates a new set of break lines and region points, which can now be used in BASEmesh.
|
|
|
|
|
|
### 5 - Mesh Generation
|
|
|
|
|
|
> **Note:** This step requires BASEmesh v2.2 or greater as disabling input conformation was not available in previous releases.
|
|
|
|
|
|
The newly generated break lines and region points can be added to the quality meshing tool as normal. Be sure to check the *'Disable input cleaning'* checkbox in the GUI.
|
|
|
|
|
|
The geometry generated here is sufficiently cleaned that it can be used by Triangle directly despite some warnings about duplicate vertices which are safe to ignore. Enabling input cleaning would take a considerable amount of time due to the large number of break lines used. |