SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
meshquadmerge.cpp File Reference
#include "mesh/meshquadmerge.h"
#include "mesh/meshcellgeom.h"
#include "mesh/meshquadquality.h"
#include <QHash>
#include <algorithm>
#include <cmath>
Include dependency graph for meshquadmerge.cpp:

Namespaces

namespace  mesh
 

Functions

int mesh::mergeTrianglePairs (MeshResult &mesh, const QuadMergeOptions &opts, const QSet< QPair< int, int > > &lockedEdges, QVector< int > *oldToNew=nullptr)
 Greedily merge adjacent triangle pairs of mesh into convex quads.
 

Detailed Description

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Tri-pair merge (TRI_QUAD_MESHING_PLAN §3.1, phase G2). "Blossom-quad"-style greedy pairing: score every mergeable interior edge by the quality of the quad it would produce, then accept pairs best-first while neither triangle has been taken. The perfect-matching refinement is out of scope.

QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.6 / P1: the quality gate and ranking are mesh::quadAcceptable / mesh::quadScore (scaled Jacobian, aspect, skew) with 60°/120° defaults. The previous score minAng/maxAng × minSide/maxSide rated the 60°/120° rhombus two equilateral Delaunay triangles form (0.5 × 1.0) the same as a perfect 2:1 rectangle (1.0 × 0.5), so it could not tell the diamond from the good quad.

Variable Documentation

◆ quad

MeshTriangle quad

◆ score

double score = 0.0

◆ t1

int t1 = -1

◆ t2

int t2 = -1