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

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

#include "meshkit/detail/planmodel.hpp"
#include <functional>
Include dependency graph for sizefield.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  meshkit::plan::SizeFieldOptions
 Inputs to SizeField::build(): feature grading, caps, floor, terrain term and polygon overrides. More...
 
struct  meshkit::plan::SizeFieldOptions::Region
 Polygon overrides: inside ring the size is min'd with h. More...
 
class  meshkit::plan::SizeField
 Distance-to-feature field sampled as a max-area function. More...
 

Namespaces

namespace  meshkit
 The Qt-free MeshKit library: job events and progress (meshkit::runtime), the neutral mesh model, meshing jobs, the constrained Delaunay kernel and terrain surfaces (meshkit::core), and the MKB and SMS 2DM codecs (meshkit::io).
 
namespace  meshkit::plan
 Planning algorithms on standard containers: quad patch planning and placement, size fields, source-geometry simplification and the independent constraint and sizing audits.
 

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.