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.h
Go to the documentation of this file.
1
19#ifndef OPENSWMMVIS_MESH_MESHQUADMERGE_H
20#define OPENSWMMVIS_MESH_MESHQUADMERGE_H
21
22#include "mesh/meshresult.h"
23
24#include <QPair>
25#include <QSet>
26#include <QVector>
27
28namespace mesh {
29
32{
33 // QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §5 / P1: hard bounds tightened
34 // from 45°/135° (which accepted the 60°/120° rhombus two equilateral
35 // triangles form) to 60°/120°, and the ranking metric is mesh::quadScore
36 // (scaled Jacobian × aspect × skew) instead of minAngle/maxAngle ×
37 // minSide/maxSide, which rated a rhombus and a 2:1 rectangle equal.
38 double minAngleDeg = 60.0;
39 double maxAngleDeg = 120.0;
40 double minScaledJacobian = 0.866;
41 double maxAspect = 2.0;
45 double maxBedNonPlanarity = 0.0;
46};
47
49inline QPair<int, int> edgeKey(int a, int b) noexcept
50{
51 return a < b ? qMakePair(a, b) : qMakePair(b, a);
52}
53
76int mergeTrianglePairs(MeshResult &mesh, const QuadMergeOptions &opts,
77 const QSet<QPair<int, int>> &lockedEdges,
78 QVector<int> *oldToNew = nullptr);
79
80} // namespace mesh
81
82#endif // OPENSWMMVIS_MESH_MESHQUADMERGE_H
int b
local residual indices, a < b
Definition meshquadmatch.cpp:46
int a
Definition meshquadmatch.cpp:46
Definition meshcommands.h:302
int 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.
Definition meshquadmerge.cpp:69
QPair< int, int > edgeKey(int a, int b) noexcept
Unordered vertex-pair key used for locked edges: (min, max).
Definition meshquadmerge.h:49
Acceptance thresholds for a merged quad.
Definition meshquadmerge.h:32
double minScaledJacobian
Reject quads whose min corner sine is below this.
Definition meshquadmerge.h:40
double maxAspect
Reject quads longer than this ratio (opposite-side means); <= 0 = off.
Definition meshquadmerge.h:41
double minAngleDeg
Reject quads with any interior angle below this.
Definition meshquadmerge.h:38
double maxBedNonPlanarity
Definition meshquadmerge.h:45
double maxAngleDeg
Reject quads with any interior angle above this.
Definition meshquadmerge.h:39