![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include "mesh/meshgenerator.h"#include <QPointF>#include <QPolygonF>#include <QString>#include <QVector>#include <functional>Go to the source code of this file.
Classes | |
| struct | mesh::pslg::MinSizePolicy |
| Policy for minimum-feature-size conditioning. More... | |
| struct | mesh::pslg::Violation |
| struct | mesh::pslg::ConditionReport |
Namespaces | |
| namespace | mesh |
| namespace | mesh::pslg |
Enumerations | |
| enum class | mesh::pslg::ViolationCause { mesh::pslg::ShortSegment , mesh::pslg::CloseFeatures , mesh::pslg::SmallAngle , mesh::pslg::SubScaleRing , mesh::pslg::IdentityMerged } |
Functions | |
| QString | mesh::pslg::violationCauseName (ViolationCause c) |
| QVector< Violation > | mesh::pslg::analyseLocalFeatureSize (const QVector< QPolygonF > &domains, const QVector< QVector< QPointF > > &holeRings, const QVector< ConstraintSegment > &segs, const QVector< SteinerPoint > &pts, double h, int maxReported=200) |
| Analyse the PSLG's local feature size. Read-only. | |
| bool | mesh::pslg::conditionMinSize (QVector< QPolygonF > *domains, QVector< QVector< QPointF > > *holeRings, QVector< ConstraintSegment > *segs, QVector< SteinerPoint > *pts, const MinSizePolicy &policy, ConditionReport *report, const std::function< bool()> &isCancelled={}) |
| Condition the PSLG so it can support cells of size policy.minCellSize. | |
Minimum-feature-size conditioning for the input PSLG (MIN_CELL_SIZE_ENFORCEMENT_PLAN_2026-08-17.md §4).
WHY THIS EXISTS. Ruppert refinement — what Triangle's -q implements — produces output edge lengths of Θ(lfs), where lfs is the LOCAL FEATURE SIZE of the input: the radius of the smallest disk centred at a point that touches two non-incident input features. Triangle therefore cannot emit cells much smaller than the input demands, and it cannot emit them much larger either. Constraining lines and polylines routinely carry features far below any usable cell size — GIS-digitised vertices centimetres apart, two conduits passing within a hair, breaklines grazing the domain edge, conduits meeting at a manhole at 10° — and every one of those forces cells at that scale. On the explicit 2D marcher a single sliver sets the CFL timestep for the whole domain.
So enforcing a minimum CELL size means enforcing a minimum FEATURE size on the PSLG, which necessarily changes the geometry slightly. That is the whole bargain of this file. No amount of work inside Triangle can substitute: an area floor in the refinement hook only stops FURTHER subdivision (Triangle never coarsens), and post-mesh cleanup cannot touch a sliver whose edges are constrained.
WHAT IS GUARANTEED after conditionMinSize() returns true:
On failure to reach (5) the function restores every argument and returns false: a slow correct mesh beats a Triangle abort.
DEVIATION FROM THE PLAN, deliberate. The plan specified snap-rounding to a quantized grid. This implements the equivalent guarantee with greedy priority-ordered welding instead (the greedyMinSeparation idiom already in pslgprep.h), because grid quantization moves EVERY vertex — including the tagged SWMM nodes that are coupling locations — whereas welding leaves all representatives, and therefore every tagged node, exactly where it was. Same separation property, strictly less geometry disturbance, less code.