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

Graded element sizing for Delaunay refinement (MESH_MINSIZE_ENFORCEMENT_V2_AND_GRADING_PLAN_2026-09-01.md Track B). More...

#include "mesh/meshgenerator.h"
#include <QRectF>
#include "meshkit/sizefield.hpp"
#include <QVector>
Include dependency graph for sizefield.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mesh::SizeFieldOptions
 Policy for SizeField::build(). More...
 
struct  mesh::SizeFieldOptions::Region
 Polygon overrides: inside ring the size is min'd with h. More...
 
class  mesh::SizeField
 Distance-to-feature field sampled as a max-area function. 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.
 

Detailed Description

Graded element sizing for Delaunay refinement (MESH_MINSIZE_ENFORCEMENT_V2_AND_GRADING_PLAN_2026-09-01.md Track B).

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

Graded element sizing for Delaunay refinement (MESH_MINSIZE_ENFORCEMENT_V2_AND_GRADING_PLAN_2026-09-01.md Track B).

WHY THIS EXISTS. With a uniform maximum-area cap the WHOLE domain is refined to the cap, however far a cell sits from anything that needs resolution — on a large domain most of the output vertices buy nothing. This field grades the target size with distance from constrained features. The ideal continuous model uses exact Euclidean distance:

h(x) = nearSize + gradation · d(x)
A(x) = (√3/4) · h(x)²          (area of the equilateral triangle)

where d(x) is the distance to the nearest constrained feature (constraint segments, hole-ring edges, tagged Steiner points). In that ideal model, h approaches nearSize at features and has Lipschitz slope gradation. The sampled approximation below is not a proof of that bound for the produced mesh. Near-feature resolution and final cell counts require verification; grading is intended to allow coarser cells away from features.

The outer domain ring is deliberately NOT a seed: it is usually a watershed clip, not a hydraulic feature, and seeding it would pin fine cells along the whole perimeter. The mesher still refines near the boundary wherever the boundary's own local feature size demands it.

Mechanics: a uniform background grid over the domain bbox holds the distance to the nearest seed at each cell centre — exact distances are stamped in a small neighbourhood around every seed, then a two-pass chamfer transform propagates them using axial weight pitch and diagonal weight sqrt(2) * pitch. The ideal point-seeded octile metric can overestimate Euclidean distance by about 8.24%; this is not a bound for segment stamping, bilinear interpolation, or the complete sizing pipeline. Overestimating d increases h and its permitted area, producing a COARSER target, not a conservative refinement guarantee. The terrain-error term and the area floor further affect the final target. Computation is serial and deterministic for fixed input.