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
meshquadpoints.h File Reference
#include "mesh/meshcrossfield.h"
#include "mesh/meshquadmatch.h"
#include "mesh/meshquadquality.h"
#include <QPointF>
#include <QPolygonF>
#include <QVector>
#include <functional>
Include dependency graph for meshquadpoints.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mesh::QuadPointOptions
 
struct  mesh::QuadPointSet
 

Namespaces

namespace  mesh
 

Functions

QuadPointSet mesh::placeQuadPoints (const QPolygonF &ring, const QVector< QPointF > &seeds, int ringCount, const CrossField &field, const QuadPointOptions &opts)
 Place lattice points inside ring (CCW, open) aligned to field. seeds = ring vertices (exactly ringCount of them, in ring order) followed by fixed interior points. Returns an empty set when h <= 0 or the ring has fewer than 3 vertices.
 
QuadPointSet mesh::placeQuadPoints (const QPolygonF &ring, const QVector< QPolygonF > &holes, const QVector< QPointF > &seeds, int ringCount, const CrossField &field, const QuadPointOptions &opts)
 Hole-aware overload: no point is placed inside any ring of holes, and the boundary clearance is kept from the hole rings as well as from ring (QUAD_EVERYWHERE_PLAN_2026-09-07.md §3.1). An empty holes is identical to the overload above.
 
double mesh::distanceToRing (const QPolygonF &ring, const QPointF &p)
 Distance from p to the closest ring edge.
 
double mesh::distanceToRings (const QPolygonF &ring, const QVector< QPolygonF > &holes, const QPointF &p)
 Distance from p to the closest edge of ring or of any hole.
 

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

Field-aligned frontal point placement for Free quad regions (workplans/QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.4d), after DelQuad (Remacle et al. 2013) and Shimada's square packing (1998):

  • seeds = the resampled ring vertices followed by the fixed interior points (junction Steiners, constraint-segment vertices) — never moved;
  • boundary layer: from every ring vertex, one point at distance h along the inward normal (kept when it clears the ring by boundaryClearance·h and no existing point lies within minSeparation·h);
  • front (FIFO, deterministic): pop p, propose p + h·d_k for the four cross directions at p, accept under the same clearance/separation tests, push;
  • templates: for every point p and adjacent direction pair (d_k, d_k+1) the nearest points to p+h·d_k, p+h·(d_k+d_k+1), p+h·d_k+1 within templateSnap·h form a candidate square; kept when it is convex and CCW. Templates are deduplicated by vertex set; overlapping candidates are resolved later by meshquadmatch (best score first).

Indices in QuadTemplate::v: i < seeds.size() → seeds[i]; otherwise generated[i - seeds.size()].