Loading...
Searching...
No Matches
meshquadcleanup.h File Reference

Topological cleanup and guarded smoothing inside quad regions (workplans/QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.4g–h). More...

#include "mesh/meshquadquality.h"
#include "mesh/meshresult.h"
#include <QSet>
#include <QVector>
Include dependency graph for meshquadcleanup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mesh::QuadCleanupOptions
 Policy for cleanupAndSmoothQuads(). More...
 
struct  mesh::QuadCleanupStats
 Counts reported by cleanupAndSmoothQuads(). More...
 

Namespaces

namespace  mesh
 The Qt-facing MeshKit API (meshkit::core_qt, meshkit::model_qt, meshkit::io_qt): mesh value types and cell attributes, the mesh generator, quad regions, matching and cleanup, mesh statistics, and the INP and 2DM mesh codecs.
 

Functions

QuadCleanupStats mesh::cleanupAndSmoothQuads (MeshResult &mesh, const QSet< int > &movable, const QuadCleanupOptions &opts, QVector< int > *vertexOldToNew)
 Remove eligible quad doublets, improve valence diagonals, smooth movable xy and compact/reorder cells.
 
QVector< int > mesh::reorderTrianglesFirst (MeshResult &mesh)
 Stable-partition cell rows into triangles followed by quads and remap selected cell metadata.
 

Detailed Description

Topological cleanup and guarded smoothing inside quad regions (workplans/QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.4g–h).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License
Apache-2.0

Topological cleanup and guarded smoothing inside quad regions (workplans/QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.4g–h).

Only vertices in movable are ever moved or removed; only cells incident to a movable vertex are ever rewritten. Ring vertices, constraint vertices and junction Steiners are therefore untouched, so patch stitching, node coupling and the PSLG interface are unaffected.

  • Doublet removal: a movable interior vertex with exactly two incident cells, both quads → the two quads collapse into one (the vertex and its two edges disappear). Vertices are compacted at the end; the remap is returned so callers can translate ids they still hold.
  • Diagonal swap: two quads sharing an edge (a,b), union hexagon; the other two diagonalisations are tried and adopted when Σ|valence − 4| over the six vertices drops and both new quads pass the bounds.
  • Smoothing ("parallelogram" smoothing, a quad-aware Laplacian): a movable vertex v moves to the mean over incident quads of (prev + next − opposite) and over incident triangles of the neighbour centroid; the move is accepted only when the minimum scaled Jacobian over every incident cell does not decrease, every incident quad stays convex, and no aspect-cap violation is introduced or worsened. Iterated smoothingIterations times (Jacobi ordering — positions from the previous sweep — for determinism).

MeshResult::cellCouplings / infilOverrides are remapped during cell compaction/reordering, but removed-cell records become invalid -1 keys and collisions are not reconciled. MeshGenerator runs this before those stores are populated; callers with authored metadata must reconcile it.