Loading...
Searching...
No Matches
meshkit::plan Namespace Reference

Planning algorithms on standard containers: quad patch planning and placement, size fields, source-geometry simplification and the independent constraint and sizing audits. More...

Namespaces

namespace  detail
 Internal helpers of meshkit::plan; not part of the supported API.
 
namespace  quadquality_detail
 Internal checks behind the quadrilateral quality metrics; not part of the supported API.
 

Classes

struct  BankPairPatch
 Two open bank polylines with independently supplied directions. More...
 
struct  ConstraintAuditExample
 One recorded audit violation. More...
 
struct  ConstraintAuditOptions
 Pins, cancellation and resource limits for the constraint audits. More...
 
struct  ConstraintAuditReport
 Result of auditConstraintSimplification() or auditMeshConstraints(). More...
 
struct  ConstraintPolicyOverride
 Optional per-source changes to a parent ConstraintSimplificationPolicy, applied by resolve(). More...
 
struct  ConstraintSegment
 Constraint polyline with marker, tag and optional strip width. More...
 
struct  ConstraintSimplificationOptions
 Pins, cancellation and resource limits for simplifyConstraints(). More...
 
struct  ConstraintSimplificationPolicy
 Per-feature limits for constraint simplification. More...
 
struct  ConstraintSimplificationResult
 Output of simplifyConstraints(). More...
 
struct  Line2
 Straight segment between two XY points. More...
 
class  Map
 Hash map with the QHash-style API the CDT kernel uses, over std::unordered_map<K, V, Hash<K>>. More...
 
struct  MeshEdge
 Mesh edge between two vertex indices, carrying a source marker. More...
 
struct  MeshResult
 Mesh as read by the native audits: vertices, cells, marked edges and a status. More...
 
struct  MeshTriangle
 Mesh cell: a triangle, or a quadrilateral when v3 is nonnegative. More...
 
struct  MeshVertex
 Mesh vertex: planar position plus elevation. More...
 
struct  PatchAssessment
 Result of assessPlannedPatch(). More...
 
struct  PatchDecision
 Per-region record of what was decided about a mapped patch and why. More...
 
struct  PatchInterfaceConflict
 One patch interface edge whose two cells differ in size by more than allowed. More...
 
struct  PatchInterfaceReport
 Result of auditPatchInterfaces(). More...
 
struct  PatchLimits
 Acceptance limits and callbacks for one mapped patch; see assessPlannedPatch(). More...
 
struct  PatchLine
 A polyline through a patch's vertices that must be reported as mesh edges with a marker — a conduit running along a strip's middle row. More...
 
struct  PatchMesh
 A generated patch in local indices. More...
 
class  Polygon
 Point sequence in XY units used for polygon rings and polylines. More...
 
struct  QuadBlockGrid
 Local cell size on a regular grid; NaN marks unusable cells. More...
 
struct  QuadBlockOptions
 Policy for placeQuadBlocks(). More...
 
struct  QuadPlan
 Result of planQuadRegions(); patches are delivered only when ok is true. More...
 
struct  QuadPlanningGeometry
 Source geometry that protects areas from mapped patches; XY units, finite coordinates. More...
 
struct  QuadPlanningOptions
 Settings, budgets and patch limits for planQuadRegions(). More...
 
struct  QuadQuality
 Metrics of one quadrilateral, as computed by quadQuality(). More...
 
struct  QuadQualityBounds
 Acceptance bounds shared by pairing, cleanup, smoothing and the legacy tri-pair merge. More...
 
struct  QuadRegion
 A closed polygon whose interior should be meshed with quadrilaterals, with its holes, scheme, spacing and tagging policy. More...
 
class  ReadArray
 Read-only array that either owns its elements or reads them from borrowed storage. More...
 
class  Set
 std::unordered_set<K, Hash<K>> with the QSet-style names the CDT kernel uses. More...
 
struct  SimplificationChange
 Per-feature outcome of simplifyConstraints(); changes are in input order. More...
 
struct  SimplificationFeature
 One constraint polyline or ring for simplification and the constraint audits. More...
 
class  SizeField
 Distance-to-feature field sampled as a max-area function. More...
 
struct  SizeFieldOptions
 Inputs to SizeField::build(): feature grading, caps, floor, terrain term and polygon overrides. More...
 
struct  SteinerPoint
 Mandatory mesh point with marker, tag and optional pre-sampled elevation. More...
 
struct  StructuredPatch
 Four-sided patch: corners in cyclic order (either orientation); n subdivisions along corner0→corner1 (and corner3→corner2), m along corner0→corner3 (and corner1→corner2). More...
 
struct  SweptPatch
 Swept patch: the centreline is offset ±width/2 (mitred at interior vertices) and cut into across quads per station. More...
 
class  Text
 Owned byte string with the QString-style helpers used for tags and diagnostics. More...
 
class  Vector
 std::vector<T> with the QVector-style member names the CDT kernel and plan model use. More...
 

Typedefs

using Bytes = std::string
 Raw byte buffer held in a std::string; the planner uses it for exact binary keys.
 

Enumerations

enum class  PatchDisposition {
  Triangles ,
  Accepted ,
  Repaired ,
  RequiredFailure
}
 Outcome recorded for one quad region in a PatchDecision. More...
 
enum class  QuadRegionMode {
  Auto ,
  Mapped ,
  Submapped ,
  Free ,
  TrianglesOnly
}
 Requested meshing scheme for a QuadRegion's interior. More...
 

Functions

QuadBlockGrid quadBlockGridFromMesh (const MeshResult &mesh, double pitch, const Vector< Vector< Point2 > > &blockers)
 Estimate local equilateral side lengths from triangles and mask existing quads/features.
 
QuadBlockGrid quadBlockGridFromField (const Box2 &, double pitch, const std::function< double(const Box2 &)> &maximumSize, const Vector< Vector< Point2 > > &blockers, const std::function< bool()> &cancelled={}, std::int64_t maximumCells=1000000)
 Sample a footprint size callback onto a candidate block grid and mask blockers.
 
Vector< QuadRegion > placeQuadBlocks (const QuadBlockGrid &grid, const QuadBlockOptions &options)
 Greedily select axis-aligned mapped quad regions from approximately uniform usable grid bands.
 
ConstraintAuditReport auditConstraintSimplification (const Vector< SimplificationFeature > &original, const ConstraintSimplificationResult &candidate, const ConstraintAuditOptions &options={})
 Independently check a simplification candidate against its original features.
 
ConstraintAuditReport auditMeshConstraints (const Vector< SimplificationFeature > &constraints, const MeshResult &mesh, const ConstraintAuditOptions &options={})
 Check that a delivered mesh still carries every required source constraint.
 
ConstraintSimplificationResult simplifyConstraints (const Vector< SimplificationFeature > &features, const ConstraintSimplificationOptions &options={})
 Remove redundant constraint vertices within each feature's policy without moving any coordinate.
 
bool cellIsConvex (const Vector< MeshVertex > &v, const MeshTriangle &c)
 Test whether a cell is a strictly convex quadrilateral; triangles always pass.
 
Text validate (const StructuredPatch &p)
 Input checks.
 
Text validate (const SweptPatch &p)
 Input checks for a swept patch: >= 2 finite centreline points with no repeated consecutive vertex, finite width > 0, across >= 1, finite along >= 0, and station, cell and boundary counts that fit in int.
 
Text validate (const PatchMesh &pm)
 Requires finite convex CCW quads, consistently shared cell edges, and one simple boundary matching exactly the outer cell edges.
 
Polygon orderedPatchBoundary (const PatchMesh &pm, Text *err=nullptr)
 Validate the complete patch and return its CCW boundary, without a repeated closing vertex.
 
PatchMesh makeTransfinitePatch (const StructuredPatch &p, Text *err=nullptr)
 Transfinite interpolation on the four straight sides.
 
PatchMesh makeSweptPatch (const SweptPatch &p, Text *err=nullptr)
 Sweep the centreline: (stations)×(across+1) vertices, (stations-1)×across quads.
 
PatchMesh makeBankPairPatch (const BankPairPatch &p, Text *err=nullptr)
 Build a conforming strip between two simple, disjoint banks.
 
PatchMesh makeTransfinitePatch (const Vector< Vector< Point2 > > &sides, int n, int m, const Text &tag, Text *err=nullptr)
 Transfinite (Coons) interpolation on four POLYLINE sides forming a loop: sides[0] runs c0→c1, sides[1] c1→c2, sides[2] c2→c3, sides[3] c3→c0 (each side's last point equals the next side's first).
 
PatchMesh makeTransfinitePatchAtStations (const Vector< Vector< Point2 > > &sides, const Text &tag, Text *err=nullptr)
 Coons patch on four already-stationed sides that keeps every station exactly.
 
PatchMesh makeMappedPatch (const Polygon &ring, const Vector< int > &corners, double h, const Text &tag, Text *err=nullptr)
 Split a ring (either winding) at the four corners (ring vertex indices, ring order) into polyline sides, choose n = max(1, round(mean(len0, len2)/h)), m likewise from sides 1/3, and call the polyline overload.
 
PatchMesh makeMappedPatch (const Polygon &ring, const Vector< int > &corners, double hAlong, double hAcross, double alongAngleDeg, const Text &tag, Text *err=nullptr)
 Mapped patch with independent physical-axis spacing.
 
PatchAssessment assessPlannedPatch (const PatchMesh &, const PatchLimits &)
 Check a mapped patch cell by cell against shape, size and terrain limits.
 
QuadPlan planQuadRegions (const Vector< QuadRegion > &, const QuadPlanningGeometry &, const QuadPlanningOptions &={})
 Plan mapped quad patches for all regions jointly, before CDT construction.
 
PatchInterfaceReport auditPatchInterfaces (const MeshResult &, const Vector< MeshEdge > &, double maximumRatio, const std::function< bool()> &cancelled={}, int maximumExamples=64)
 Check the size transition across delivered patch interface edges.
 
QuadQuality quadQuality (const Point2 &a, const Point2 &b, const Point2 &c, const Point2 &d)
 Measure one quadrilateral using cyclic corners and translation/scale-resistant planar arithmetic.
 
QuadQuality quadQuality (const Vector< MeshVertex > &vertices, const MeshTriangle &t)
 Measure a quad cell through its borrowed vertex records.
 
bool quadAcceptable (const QuadQuality &q, const QuadQualityBounds &b)
 Apply inclusive hard angle/Jacobian/aspect limits to a valid convex metric record.
 
double quadScore (const QuadQuality &q, const QuadQualityBounds &b)
 Rank valid convex quads by Jacobian, rectangularity and a soft aspect penalty.
 
double triangleScaledJacobian (const Point2 &a, const Point2 &b, const Point2 &c)
 Compute the minimum orientation-normalized corner sine of a triangle.
 
double cellCornerAngleDeg (const Vector< MeshVertex > &v, const MeshTriangle &t, int i)
 Compute the unsigned corner angle of a triangle or quad.
 
QuadQualityBounds quadRegionQualityBounds (const QuadRegion &region, QuadQualityBounds global)
 Copy global quality bounds and apply an explicitly nonnegative region aspect override.
 
Polygon normalizeRingCCW (const Polygon &ring)
 Copy a ring while dropping scale-fuzzy consecutive/closing duplicates and reversing negative area.
 
bool polylineIntersectsRect (const Vector< Point2 > &path, const Box2 &rect)
 Test whether any consecutive path segment meets a normalized closed rectangle.
 
double ringSignedArea (const Polygon &ring)
 Compute oriented shoelace area after translating corners to the first vertex.
 
bool pointInRing (const Polygon &ring, const Point2 &p)
 Test a point using a strict horizontal-ray odd-even crossing rule.
 
bool pointInRegion (const Polygon &ring, const Vector< Polygon > &holes, const Point2 &p)
 Combine outer-ring parity with exclusion by every supplied hole-ring parity.
 
bool ringIsSimple (const Polygon &ring)
 Reject proper nonadjacent edge crossings using plain double orientation signs.
 
Text validateQuadRegion (const QuadRegion &r, const Vector< Polygon > &domains, const Vector< Polygon > &holes)
 Check region authoring policy, normalized ring and sampled domain/hole containment.
 
Text validateQuadRegionsDisjoint (const Vector< QuadRegion > &regions)
 Check explicit region pairs for proper crossings or strictly interior sampled vertices.
 
QuadRegionMode classifyQuadRegion (const Polygon &ring, Vector< int > *corners, double cornerTolDeg=25.0, double rectilinearTolDeg=2.0)
 Heuristically classify normalized ring turns as Mapped, Submapped or Free.
 
Polygon resampleRing (const Polygon &ring, double h, double keepTurnDeg=0.0)
 Normalize a ring and insert equal-part subdivisions along all implicit closing edges.
 
double ringTurnDeg (const Polygon &ring, int i)
 Compute a signed exterior turn at one ring corner using adjacent edge cross/dot products.
 

Variables

constexpr double pi = 3.141592653589793238462643383279502884
 The constant pi as a double.
 

Detailed Description

Planning algorithms on standard containers: quad patch planning and placement, size fields, source-geometry simplification and the independent constraint and sizing audits.

The Qt facades in namespace mesh delegate to these implementations.

Typedef Documentation

◆ Bytes

using meshkit::plan::Bytes = std::string

Raw byte buffer held in a std::string; the planner uses it for exact binary keys.

Enumeration Type Documentation

◆ PatchDisposition

Outcome recorded for one quad region in a PatchDecision.

Enumerator
Triangles 

No mapped patch is delivered and the region is left to triangles (the default).

Accepted 

Mapped patch accepted without any repair round.

Repaired 

Mapped patch obtained after refinement: in a QuadPlan, accepted after at least one station-doubling repair round; the native job also records it for a required region whose spacing it halves before retrying.

RequiredFailure 

A required region could not be planned, so the whole plan was refused.

◆ QuadRegionMode

enum class meshkit::plan::QuadRegionMode
strong

Requested meshing scheme for a QuadRegion's interior.

Enumerator
Auto 

classifyQuadRegion() decides: Mapped → Submapped → Free.

Mapped 

Four logical sides (polylines) → transfinite quads. Needs 4 corners.

Submapped 

Exactly rectilinear ring → grid-based structured quads.

Free 

Cross-field aligned lattice + template pairing (quad-dominant).

TrianglesOnly 

Region ring is still a constraint loop, interior stays triangles.

Function Documentation

◆ assessPlannedPatch()

PatchAssessment meshkit::plan::assessPlannedPatch ( const PatchMesh & patch,
const PatchLimits & limits )

Check a mapped patch cell by cell against shape, size and terrain limits.

The first argument is the patch, of which only PatchMesh::xy and PatchMesh::quads are read (boundary and topology are not validated; see validate(const PatchMesh &)). The second holds the limits and callbacks. Checking stops at the first failing cell. Each cell must be a quadrilateral with in-range, finite vertices that is convex with positive area in either winding; then, where enabled, the minimum edge, minimum angle, maximum aspect, directional spacing, footprint size and terrain error limits are tested with a small relative tolerance (about 1e-9). Callbacks run synchronously on the calling thread.

Returns
The assessment. PatchAssessment::ok is false for invalid limits (a scalar negative or non-finite, minimumAngleDegrees >= 180, or only one of alongSize and acrossSize positive), an empty patch, a failing cell or cancellation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ auditConstraintSimplification()

ConstraintAuditReport meshkit::plan::auditConstraintSimplification ( const Vector< SimplificationFeature > & original,
const ConstraintSimplificationResult & candidate,
const ConstraintAuditOptions & options = {} )

Independently check a simplification candidate against its original features.

Per feature: valid policy; unchanged id, closed, role, marker, requiredInMesh and elevation presence; a strictly increasing source mapping; retained vertices and heights exactly equal to their sources; endpoints and ring closure kept; no Preserve-mode, fixed or above-maxTurnDegrees vertex removed; consistent removed count; ring orientation and area limits; XY/Z deviation and monotone projection of each removed vertex. Then source rings must not touch themselves and, when anything was removed, each new shortcut is checked against other output edges, pins and the original graph for crossings, collapsed distinct paths, lost junctions, swept pockets and minimumClearance.

Parameters
[in]originalFeatures given to simplifyConstraints(); read only, not retained.
[in]candidateIts result; must be ok with one feature and change per original.
[in]optionsPins, cancellation and limits; the callback runs synchronously.
Returns
Report; ok only when complete without violations. Some structural violations end the audit at once. Inputs are not modified; no IO.
Here is the call graph for this function:

◆ auditMeshConstraints()

ConstraintAuditReport meshkit::plan::auditMeshConstraints ( const Vector< SimplificationFeature > & constraints,
const MeshResult & mesh,
const ConstraintAuditOptions & options = {} )

Check that a delivered mesh still carries every required source constraint.

Each non-degenerate segment of a feature with requiredInMesh must be covered end to end, from its first to its last vertex, by a chain of delivered edges (mesh.boundaryEdges) lying on it within coordinateRoundoff, each with one or two incident cells and, for a nonzero feature marker, the same marker. Domain and Hole edges need their cells on the correct side (see SimplificationFeature::Role); delivered endpoint z must match authored z to roundoff. Not a general cell-overlap proof.

Parameters
[in]constraintsSource features; Domain/Hole rings also define the inside used for side checks. Read only, not retained.
[in]meshDelivered mesh; must have ok set. Read only, not retained.
[in]optionsCancellation and limits; protectedPoints is not used.
Returns
Report; ok only when complete without violations. Invalid indices or geometry end the audit at once. Inputs are not modified; no IO.
Here is the call graph for this function:

◆ auditPatchInterfaces()

PatchInterfaceReport meshkit::plan::auditPatchInterfaces ( const MeshResult & mesh,
const Vector< MeshEdge > & boundaries,
double maximumRatio,
const std::function< bool()> & cancelled = {},
int maximumExamples = 64 )

Check the size transition across delivered patch interface edges.

Every cell is scanned once and must have positive (CCW) area, not only the cells on listed edges; the nominal sizes of the two cells on each listed edge are compared. Storage grows with the number of listed edges. The first two parameters are unnamed in this declaration; the names below are the definition's.

Parameters
[in]meshThe delivered mesh (MeshResult::ok is not read).
[in]boundariesPatch boundary edges as vertex index pairs into the mesh's vertices; orientation does not matter and MeshEdge::marker and tag are ignored.
[in]maximumRatioLargest allowed ratio between the two nominal sizes; must be finite and >= 1.
[in]cancelledOptional callback polled before the first cell and every 4096 cells; returning true stops the audit with PatchInterfaceReport::cancelled.
[in]maximumExamplesNumber of violation examples to keep, clamped to [0, 1000].
Returns
The report. PatchInterfaceReport::ok is false for an invalid ratio, an out-of-range or degenerate listed edge, invalid cell connectivity, a cell with non-positive or non-finite area, an edge with more than two incident cells, a listed edge with no incident cell, or cancellation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cellCornerAngleDeg()

double meshkit::plan::cellCornerAngleDeg ( const Vector< MeshVertex > & v,
const MeshTriangle & t,
int i )
inline

Compute the unsigned corner angle of a triangle or quad.

Parameters
[in]vStable vertex storage containing every referenced cell index in range.
[in]tValid cyclic cell, preserved.
[in]iLocal corner in[0,t.vertexCount()), unchecked.
Returns
atan2(abs(cross),dot) angle in degrees[0,180] for finite representable edge products; does not distinguish reflex from convex angle, degeneracy/nonfinite values are not validated. Uses xy only, no allocation, ownership retention or mesh mutation.

Interior angle at corner i of a cell (degrees), triangles and quads.

Here is the call graph for this function:

◆ cellIsConvex()

bool meshkit::plan::cellIsConvex ( const Vector< MeshVertex > & v,
const MeshTriangle & c )
inline

Test whether a cell is a strictly convex quadrilateral; triangles always pass.

Parameters
[in]vVertex array that c indexes; indices are not range-checked.
[in]cCell to test.
Returns
True for a triangle without inspecting it. For a quadrilateral, true when all four corner turns are finite, nonzero and of one sign (either winding), computed in plain double arithmetic; collinear or reflex corners and non-finite coordinates give false.
Here is the call graph for this function:

◆ classifyQuadRegion()

QuadRegionMode meshkit::plan::classifyQuadRegion ( const Polygon & ring,
Vector< int > * corners,
double cornerTolDeg = 25.0,
double rectilinearTolDeg = 2.0 )

Heuristically classify normalized ring turns as Mapped, Submapped or Free.

Parameters
[in]ringBorrowed finite valid planar ring, unchanged; normalized CCW/open before evaluating turns.
[out]cornersOptional borrowed vector, cleared first; Mapped success fills four indices into the normalized ring, not necessarily original input positions. Other modes leave it empty.
[in]cornerTolDegFinite nonnegative degree tolerance, default 25. Mapped needs exactly four turns within inclusive 90+/-tolerance and all other absolute turns strictly below tolerance.
[in]rectilinearTolDegFinite nonnegative degree tolerance, default 2. Submapped accepts every absolute turn close to 90 or close to zero (straight-through vertices are allowed).
Returns
Mapped first, otherwise Submapped for rectilinear turns, otherwise Free including <3 corners. Does not validate simplicity, corner metadata, directional mesher feasibility or quality; allocates normalized/turn/output arrays, retains no pointers and changes no input geometry.

Auto-classification (plan §4.1) on the normalised ring.

Turning angle at each vertex (exterior angle, CCW positive): - exactly four vertices with turn in [90 − cornerTolDeg, 90 + cornerTolDeg] and every other |turn| < cornerTolDeg → Mapped (corners = those four, in ring order); - every turn within rectilinearTolDeg of ±90° or zero → Submapped; - otherwise Free. corners receives the Mapped corners when non-null (cleared otherwise).

Here is the call graph for this function:

◆ makeBankPairPatch()

PatchMesh meshkit::plan::makeBankPairPatch ( const BankPairPatch & p,
Text * err = nullptr )

Build a conforming strip between two simple, disjoint banks.

Build a conforming strip between two finite simple disjoint open banks.

Rejects ambiguous endpoint pairing, touching/crossing banks, folded cells, unrepresentable station geometry and unsafe subdivision counts.

Parameters
[in]pBorrowed bank arrays/across/along/tag, unchanged. across>=1, finite nonnegative along; each bank >=2 finite nonduplicate consecutive points and not explicitly closed. Common XY units.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned XY-only patch with local-index CCW quads/boundary and copied tag; empty on checked failure. No elevations, source mutation, coordinate conversion, engine/file access or retained inputs. Index capacity checks do not constitute a practical memory budget or allocation-failure handling. err cleared at entry. Pairs ends by minimum total connection length, rejects near ties, canonicalizes bank direction/order, and requires simple outline including connectors. Unions exact normalized arc-vertex fractions so every original bend survives; positive along subdivides using longer bank advance. Rejects unrepresentable fractions/counts/points, folded cells and remote contacts. This is normalized arc correspondence, not a surveyed station match. No source reordering or cancellation.
Here is the call graph for this function:

◆ makeMappedPatch() [1/2]

PatchMesh meshkit::plan::makeMappedPatch ( const Polygon & ring,
const Vector< int > & corners,
double h,
const Text & tag,
Text * err )

Split a ring (either winding) at the four corners (ring vertex indices, ring order) into polyline sides, choose n = max(1, round(mean(len0, len2)/h)), m likewise from sides 1/3, and call the polyline overload.

Choose isotropic subdivision counts from opposite-side arc lengths and build a Coons patch.

Parameters
[in]ringBorrowed finite ring in either winding, unchanged; exact repeated closing point allowed.
[in]cornersBorrowed four strictly increasing indices in original open-ring order, unchanged.
[in]hPositive finite target spacing in ring XY units; opposite mean lengths round to nearest positive integer count, so h is a target rather than strict maximum gap.
[in]tagBorrowed copied patch/cell tag, unchanged.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned XY-only patch with local-index CCW quads/boundary and copied tag; empty on checked failure. No elevations, source mutation, coordinate conversion, engine/file access or retained inputs. Index capacity checks do not constitute a practical memory budget or allocation-failure handling. err is cleared at entry, then set on failure. Side geometry/count/final patch checks apply.

◆ makeMappedPatch() [2/2]

PatchMesh meshkit::plan::makeMappedPatch ( const Polygon & ring,
const Vector< int > & corners,
double hAlong,
double hAcross,
double alongAngleDeg,
const Text & tag,
Text * err = nullptr )

Mapped patch with independent physical-axis spacing.

Associate physical directional spacings with opposite logical side pairs before Coons generation.

The axis is undirected, measured counterclockwise from +x in degrees. The opposite logical side pair most aligned with it receives hAlong; the other receives hAcross. Equal association scores are rejected. Ring rotation/reversal must not exchange the physical spacings. Widths use the ring's coordinate units.

Parameters
[in]ringBorrowed finite cyclic ring, either winding, unchanged; exact closing duplicate allowed.
[in]cornersBorrowed four strictly increasing open-ring indices, unchanged.
[in]hAlongPositive finite target spacing along the selected physical axis, ring horizontal units.
[in]hAcrossPositive finite orthogonal target spacing in same units.
[in]alongAngleDegFinite undirected axis counterclockwise from +x, degrees modulo 180.
[in]tagBorrowed copied tag, unchanged.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned XY-only patch with local-index CCW quads/boundary and copied tag; empty on checked failure. No elevations, source mutation, coordinate conversion, engine/file access or retained inputs. Index capacity checks do not constitute a practical memory budget or allocation-failure handling. Mean squared chord-axis projections choose which side pair receives hAlong; equal scores within 1e-10 reject as ambiguous. Arc lengths set nearest-integer counts. err cleared at entry. Rotation of ring start/winding does not intentionally exchange physical spacings; no CRS/geodesic operations.

◆ makeSweptPatch()

PatchMesh meshkit::plan::makeSweptPatch ( const SweptPatch & p,
Text * err = nullptr )

Sweep the centreline: (stations)×(across+1) vertices, (stations-1)×across quads.

Sweep a finite centerline with mitred offsets into a globally validated quad strip.

Station and index counts are checked before allocation. Invalid or globally overlapping/touching offsets return an empty PatchMesh and a diagnostic identifying the affected stations.

Parameters
[in]pBorrowed centerline/positive width/across/along spacing/tag, unchanged, common XY units. Original vertices retained and each segment subdivided to target along spacing when positive.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned XY-only patch with local-index CCW quads/boundary and copied tag; empty on checked failure. No elevations, source mutation, coordinate conversion, engine/file access or retained inputs. Index capacity checks do not constitute a practical memory budget or allocation-failure handling. err cleared at entry. Checks counts before allocation, rejects collapsed station geometry, reversals/excessively sharp mitres, nonfinite offsets, invalid cells and remote boundary contacts. No snapping/automatic bend repair, terrain z, callbacks or cancellation.
Here is the call graph for this function:

◆ makeTransfinitePatch() [1/2]

PatchMesh meshkit::plan::makeTransfinitePatch ( const StructuredPatch & p,
Text * err = nullptr )

Transfinite interpolation on the four straight sides.

Generate a bilinear grid between four straight convex sides.

The result has (n+1)×(m+1) vertices and n×m quads. On invalid input returns an empty PatchMesh and sets *err.

Parameters
[in]pBorrowed cyclic four-corner patch, unchanged, common finite XY frame; n,m>=1 checked.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned XY-only patch with local-index CCW quads/boundary and copied tag; empty on checked failure. No elevations, source mutation, coordinate conversion, engine/file access or retained inputs. Index capacity checks do not constitute a practical memory budget or allocation-failure handling. Produces (n+1)*(m+1) vertices and n*m cells, accepts either corner winding then emits CCW cells. Validates inputs and complete output; err is not cleared on success. No cancellation or terrain sampling.
Here is the call graph for this function:

◆ makeTransfinitePatch() [2/2]

PatchMesh meshkit::plan::makeTransfinitePatch ( const Vector< Vector< Point2 > > & sides,
int n,
int m,
const Text & tag,
Text * err = nullptr )

Transfinite (Coons) interpolation on four POLYLINE sides forming a loop: sides[0] runs c0→c1, sides[1] c1→c2, sides[2] c2→c3, sides[3] c3→c0 (each side's last point equals the next side's first).

Sides are arc-length parametrised; n subdivisions along sides 0/2, m along 1/3. Boundary vertices are placed ON the polylines (so the ring the caller emits as PSLG segments is exactly this patch's boundary loop). Returns an empty PatchMesh + *err on invalid input (side with < 2 points, endpoints not matching, n or m < 1, folded quad).

◆ makeTransfinitePatchAtStations()

PatchMesh meshkit::plan::makeTransfinitePatchAtStations ( const Vector< Vector< Point2 > > & sides,
const Text & tag,
Text * err = nullptr )

Coons patch on four already-stationed sides that keeps every station exactly.

Parameters
[in]sidesFour cyclic sides, each with >= 2 finite points and nonzero length; sides[k] must end exactly where sides[(k+1)%4] starts. Sides 0 and 2 (and 1 and 3) need equal point counts: station i of side 0 faces station n-i of side 2, and station j of side 1 faces station m-j of side 3.
[in]tagLabel copied to the patch and to every quad.
[out]errOptional; set on failure and left unchanged on success.
Returns
Patch of n = sides[0].size()-1 by m = sides[1].size()-1 CCW quads whose boundary vertices are exactly the given stations and whose interior comes from Coons interpolation; an empty PatchMesh on invalid input or when the full patch fails validate().
Here is the caller graph for this function:

◆ normalizeRingCCW()

Polygon meshkit::plan::normalizeRingCCW ( const Polygon & ring)

Copy a ring while dropping scale-fuzzy consecutive/closing duplicates and reversing negative area.

Parameters
[in]ringBorrowed finite planar points, unchanged; fuzzy coordinate tolerance is 1e-9 times max(1,largest absolute original coordinate), separately on x/y, so it depends on projected origin.
Returns
Owned open sequence without closing duplicate, CCW when nondegenerate negative area was reversed. Nonconsecutive duplicate IDs, self-crossings and zero-area/NaN geometry are not repaired or rejected. Allocates output, can remove near-distinct coordinates within tolerance, retains no source references.

Drop a closing duplicate, drop consecutive duplicates, make CCW.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ orderedPatchBoundary()

Polygon meshkit::plan::orderedPatchBoundary ( const PatchMesh & pm,
Text * err = nullptr )

Validate the complete patch and return its CCW boundary, without a repeated closing vertex.

Validate a quad patch and extract its ordered open CCW perimeter.

Segment input orientation/order is immaterial. On failure returns an empty ring and sets err.

Parameters
[in]pmBorrowed patch, unchanged; full validatePatchMesh checks apply.
[out]errOptional borrowed diagnostic, set on failure, not retained; success clearing is stated below.
Returns
Owned ring without closing duplicate, empty on failure. err is assigned on EVERY call, including cleared to empty on success. Segment input order/orientation is immaterial. No source mutation or retained pointers; allocates validation/index/ring storage.
Here is the caller graph for this function:

◆ placeQuadBlocks()

Vector< QuadRegion > meshkit::plan::placeQuadBlocks ( const QuadBlockGrid & grid,
const QuadBlockOptions & options )

Greedily select axis-aligned mapped quad regions from approximately uniform usable grid bands.

Parameters
[in]gridBorrowed stable grid with finite positive pitch/origin and valid storage extent, unchanged; nonfinite/nonpositive h entries are unusable. All logarithmic band indices, powers, spacing-to-cell ceil conversions and loop/product arithmetic must be representable.
[in]optionsBorrowed policy with finite bandRatio>1, feasible finite minSpacing and positive minQuadsPerSide recommended. maxBlocks<=0 produces no regions; nonpositive minimum spacing does not filter.
Returns
Owned open four-corner Mapped QuadRegions with explicit spacing/corner indices, empty on basic invalid grid/band policy or no eligible rectangles. Processes coarser two-adjacent bands first, up to four candidate passes per band, sorting rectangles largest-first then row/column within a pass. 3/4-cost chamfer/grid exclusion supplies clearance from unusable cells, grid edges and prior blocks; regions shrink to centered whole-spacing dimensions. No exact Euclidean feature clearance or final mesher-quality guarantee is added. Allocates bands/distances/candidate/output storage, retains no inputs and changes no grid/mesh/engine state; no cancellation or explicit resource-failure result.

Axis-aligned rectangles over nearly uniform usable cells, largest first, each at least minQuadsPerSide quads of its spacing per side, kept one spacing apart from each other. Each comes back as a Mapped QuadRegion whose spacing is its band's.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planQuadRegions()

QuadPlan meshkit::plan::planQuadRegions ( const Vector< QuadRegion > & regions,
const QuadPlanningGeometry & geometry,
const QuadPlanningOptions & options = {} )

Plan mapped quad patches for all regions jointly, before CDT construction.

The first argument lists the regions. Every region whose mode is not TrianglesOnly is a four-sided mapped candidate, with corners from QuadRegion::corners or, when that is empty, the ring vertices that turn by more than 30 degrees; exactly four, in strictly increasing ring order, are required. Rings may wind either way and cells come out CCW. The second argument is the protecting source geometry and the third the settings (defaults when omitted). Spacing comes from QuadRegion::spacing or QuadPlanningOptions::defaultSize, or from hAlong/hAcross assigned to the side pairs by alignment with mappedAlongAngleDeg; PatchLimits::maximumSize can shrink it. Sides that coincide exactly share one station sequence and opposite sides share one count. A candidate that fails a repairable limit has its side counts doubled, for up to QuadPlanningOptions::maximumRepairRounds rounds. When two patches meet along partial sides with unmatched stations, the lower-priority one is refused instead of leaving a T-junction.

An optional region that cannot be planned keeps PatchDisposition::Triangles. A required region failure, cancellation, an exhausted budget, invalid settings or a non-finite source coordinate makes QuadPlan::ok false and returns no patches. Callbacks run synchronously on the calling thread; cancellation is polled at the start and every 4096 work units.

Returns
The plan; see QuadPlan.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointInRegion()

bool meshkit::plan::pointInRegion ( const Polygon & ring,
const Vector< Polygon > & holes,
const Point2 & p )

Combine outer-ring parity with exclusion by every supplied hole-ring parity.

Parameters
[in]ringBorrowed finite planar outer ring, unchanged.
[in]holesBorrowed finite hole rings in the same frame, unchanged; no containment/disjointness validation.
[in]pBorrowed finite point, unchanged.
Returns
True when pointInRing(outer,p) and no pointInRing(hole,p), false otherwise. Exact edge behavior inherits strict crossing semantics, not a uniform distance-inclusive boundary rule. No allocation, geometry repair, source mutation or engine state lookup.

Inside ring and outside every ring of holes — the region's meshable interior. With no holes this is exactly pointInRing().

Here is the call graph for this function:

◆ pointInRing()

bool meshkit::plan::pointInRing ( const Polygon & ring,
const Point2 & p )

Test a point using a strict horizontal-ray odd-even crossing rule.

Parameters
[in]ringBorrowed finite planar ring, unchanged; scale-fuzzy closing duplicate ignored.
[in]pBorrowed finite query in the same planar units, unchanged.
Returns
Crossing parity, false for fewer than three open entries. Boundary classification follows strict crossings and is not uniformly inclusive; use the separate boundary helper where needed. No topology/finite validation, coordinate conversion, allocation or source mutation.

Odd-even point-in-polygon (closed ring, last == first optional).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ polylineIntersectsRect()

bool meshkit::plan::polylineIntersectsRect ( const Vector< Point2 > & path,
const Box2 & rect )

Test whether any consecutive path segment meets a normalized closed rectangle.

Parameters
[in]pathBorrowed finite planar coordinates, unchanged; at least two points required, zero-length segments still test as points. Parameter-interval arithmetic must remain representable.
[in]rectBorrowed finite rectangle in the same planar units, unchanged; normalized internally, zero-width/height normalized boxes return false.
Returns
True for any slab-clipped interval with enter<=leave, including boundary/axis-aligned contact, false otherwise. No spatial tolerance, allocation, geometry mutation or CRS conversion.

True when any segment of a finite-coordinate polyline intersects the closed rectangle, including boundary contact and axis-aligned paths. Fewer than two points or an empty rectangle returns false.

Here is the call graph for this function:

◆ quadAcceptable()

bool meshkit::plan::quadAcceptable ( const QuadQuality & q,
const QuadQualityBounds & b )
inline

Apply inclusive hard angle/Jacobian/aspect limits to a valid convex metric record.

Parameters
[in]qStable metrics with positive finite area and valid ranges, otherwise rejected.
[in]bFinite thresholds, angles degrees, minimum Jacobian and maximum aspect dimensionless; maxAspect<=0 disables aspect cap. Caller chooses meaningful angle/score limits; no automatic clamping.
Returns
False on invalid metric/nonfinite bound or minAngle below floor/maxAngle above ceiling/ Jacobian below floor/active aspect above cap; true otherwise, equality allowed. No metadata mutation, geometric repair, allocation or ownership transfer.

Hard acceptance test (finite valid geometry + convexity + unchanged angle bounds, SJ floor and aspect cap).

Here is the call graph for this function:

◆ quadBlockGridFromField()

QuadBlockGrid meshkit::plan::quadBlockGridFromField ( const Box2 & bounds,
double pitch,
const std::function< double(const Box2 &)> & maximumSize,
const Vector< Vector< Point2 > > & blockers,
const std::function< bool()> & cancelled = {},
std::int64_t maximumCells = 1000000 )

Sample a footprint size callback onto a candidate block grid and mask blockers.

Arguments, in order:

  • the extent box (XY units; must satisfy Box2::isValid()), whose minimum corner becomes the origin; the grid has ceil(width / pitch) x ceil(height / pitch) cells;
  • pitch, the positive finite cell side in the same units;
  • maximumSize, a required callback giving the conservative size bound over a cell's box; it is called once per cell, synchronously, and its exceptions propagate;
  • blockers, borrowed paths whose consecutive segments are sampled at most half a pitch apart, marking each sample's cell and its eight neighbours unusable;
  • cancelled, an optional poll checked every 4096 cells and blocker samples;
  • maximumCells, the largest allowed cell count (>= 1).

Each usable cell stores 0.9 times its size bound; a zero, negative, nonfinite or float-overflowing bound leaves the cell unusable (NaN).

Returns
The owned grid; an invalid default grid on any refused argument, a column or row count above 1e8, more cells than maximumCells, a nonfinite blocker segment or sample, more than 1e8 samples on one segment, or cancellation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quadBlockGridFromMesh()

QuadBlockGrid meshkit::plan::quadBlockGridFromMesh ( const MeshResult & mesh,
double pitch,
const Vector< Vector< Point2 > > & blockers )

Estimate local equilateral side lengths from triangles and mask existing quads/features.

Parameters
[in]meshBorrowed stable finite valid triangle/quad geometry, unchanged. Every cell vertex ID must be in range; area/centroid/products and grid coordinate-to-int conversions must be representable.
[in]pitchFinite positive background cell side in planar mesh units, feasible integer dimensions; nonpositive/NaN or no vertices returns invalid grid, but infinite pitch is caller-invalid, not rejected.
[in]blockersBorrowed finite feature paths in the same CRS/units, unchanged. Only consecutive segments are sampled, so repeat first point to close rings. Sample-step counts must fit int.
Returns
Owned row-major grid with unweighted mean triangle equivalent side sqrt(area/(sqrt(3)/4)) in planar units, NaN for blocked/no-sample cells. Triangle contributions use containing centers plus centroid bin, not area-weighted raster coverage. Existing quad bounding-box bins are blocked; feature samples at half-pitch steps mask their bins and 3x3 neighbors. Returns invalid if computed grid exceeds 64 million cells, after integer conversions; this is a cell-count cap, not a total memory-byte ceiling. Allocates sums/counts/masks/output, no source mutation, CRS conversion or engine interaction.

The local cell size of mesh on a grid of pitch, with every cell touched by blockers (domain and hole rings, constraint lines, break lines) or by an existing quad marked unusable.

Here is the call graph for this function:

◆ quadQuality() [1/2]

QuadQuality meshkit::plan::quadQuality ( const Point2 & a,
const Point2 & b,
const Point2 & c,
const Point2 & d )
inline

Measure one quadrilateral using cyclic corners and translation/scale-resistant planar arithmetic.

Parameters
[in]aFirst finite planar corner, used as local origin; same coordinate units as other corners.
[in]bSecond cyclic corner, preserved.
[in]cThird cyclic corner, preserved.
[in]dFourth cyclic corner, preserved; winding may be clockwise or counterclockwise.
Returns
Owned metrics: angles degrees, area squared coordinate units, other scores/ratios dimensionless. Invalid/nonfinite/zero-length or unrepresentable geometry returns default nonconvex metrics; concave or crossed finite geometry can return computed metrics with convex false. No index checks, allocations, coordinate mutation or physical simulation; valid opposite winding shares unsigned quality values.

Metrics for corners a,b,c,d in cyclic order. Coordinates and all metric values, including positive area, must remain representable. Invalid inputs return a non-convex result; CW and CCW valid quads share metrics.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quadQuality() [2/2]

QuadQuality meshkit::plan::quadQuality ( const Vector< MeshVertex > & vertices,
const MeshTriangle & t )
inline

Measure a quad cell through its borrowed vertex records.

Parameters
[in]verticesStable storage containing every t index in range, planar coordinates in common units.
[in]tQuad with four valid indices and v3>=0; triangle or invalid index use is unchecked.
Returns
quadQuality of its four cyclic xy positions, angles degrees/area squared units, invalid geometry nonconvex; z/material metadata ignored. No allocation, ownership retention or mesh mutation.

Metrics for quad cell t of vertices (t.v3 >= 0 required).

Here is the call graph for this function:

◆ quadRegionQualityBounds()

QuadQualityBounds meshkit::plan::quadRegionQualityBounds ( const QuadRegion & region,
QuadQualityBounds global )
inline

Copy global quality bounds and apply an explicitly nonnegative region aspect override.

Parameters
[in]regionBorrowed region policy, unchanged; aspectMax<0 inherits, zero disables aspect cap, positive values override. NaN compares false/inherits; infinity is copied and later finite checks reject it.
[in]globalBounds copied by value, only maxAspect can change.
Returns
Owned resulting bounds; no numeric validation, normalization, geometry access, state mutation or ownership retention. validateQuadRegion() performs the authoring range checks separately.

Resolve Free-region bounds. Only the aspect cap may override the global bounds; negative values inherit and zero explicitly disables it.

◆ quadScore()

double meshkit::plan::quadScore ( const QuadQuality & q,
const QuadQualityBounds & b )
inline

Rank valid convex quads by Jacobian, rectangularity and a soft aspect penalty.

Parameters
[in]qStable metrics, invalid ranges/nonconvex/nonfinite geometry scores zero.
[in]bFinite bounds; only positive maxAspect affects score, other finite hard thresholds are not applied here. Nonpositive maxAspect disables penalty.
Returns
Dimensionless clamped[0,1] product Jacobian*rectangularity*min(1,maxAspect/aspect) for active aspect cap, zero for invalid metrics/bounds. A positive score does not imply quadAcceptable. Read only, no allocation or smoothing/topology mutation.

Pairing / legacy tri-pair ranking in [0,1]: SJ · rectangularity · min(1, aspectMax/aspect). Perfect rectangles within the configured aspect cap tie squares; angle distortion penalizes rhombi and kites. Diagonal skew remains a diagnostic, not a ranking term. Invalid/non-convex quads score zero. Smoothing retains its separate SJ guard.

Here is the call graph for this function:

◆ resampleRing()

Polygon meshkit::plan::resampleRing ( const Polygon & ring,
double h,
double keepTurnDeg = 0.0 )

Normalize a ring and insert equal-part subdivisions along all implicit closing edges.

Parameters
[in]ringBorrowed finite planar ring, unchanged; fuzzy duplicates are removed and winding normalized.
[in]hFinite positive target spacing in planar units; nonpositive/NaN returns normalized ring. For active resampling every lround(edgeLength/h), int narrowing and output count must be representable.
[in]keepTurnDegRetained compatibility parameter in degrees, currently ignored; every normalized original vertex survives regardless of turn.
Returns
Owned CCW/open ring, unchanged normalized input for <3 corners or disabled h. Parts use max(1,round(length/h)), so resulting edges are not guaranteed <=h. No simplification beyond normalization, quality/topology validation, coordinate conversion or source mutation; allocates output storage.

Resample a closed ring at spacing h: every edge is split into max(1, round(len/h)) equal parts; ring vertices whose |turn| >= keepTurnDeg are always kept, others are kept too (geometry is never simplified here — run pslg::simplifyPolyline first). Output is CCW, open (no closing duplicate).

Here is the call graph for this function:

◆ ringIsSimple()

bool meshkit::plan::ringIsSimple ( const Polygon & ring)

Reject proper nonadjacent edge crossings using plain double orientation signs.

Parameters
[in]ringBorrowed finite planar sequence, unchanged; fuzzy closing duplicate ignored.
Returns
False for fewer than three open entries or a proper crossing, true otherwise. Endpoint touches, collinear overlaps, repeated nonconsecutive coordinates and zero-area degeneracy are not rejected; this is a limited crossing test, not a complete simple-polygon certificate. Quadratic read-only scan, no exact adaptive predicates, allocation or source mutation.

True when ring is simple (no proper self-intersection). O(n²).

Here is the caller graph for this function:

◆ ringSignedArea()

double meshkit::plan::ringSignedArea ( const Polygon & ring)

Compute oriented shoelace area after translating corners to the first vertex.

Parameters
[in]ringBorrowed finite planar sequence, unchanged; closes implicitly, explicit duplicate allowed.
Returns
Signed squared coordinate units, positive CCW/negative CW, zero for fewer than three points. Translation reduces absolute-origin cancellation but does not validate representable products, polygon simplicity or nonzero area; folded rings can cancel. No allocation or source mutation.

Signed shoelace area (CCW positive).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ringTurnDeg()

double meshkit::plan::ringTurnDeg ( const Polygon & ring,
int i )

Compute a signed exterior turn at one ring corner using adjacent edge cross/dot products.

Parameters
[in]ringBorrowed finite planar sequence, unchanged; fuzzy closing duplicate excluded.
[in]iCorner index, wrapped cyclically including negative values; modulo/addition must fit int.
Returns
atan2(cross,dot) in degrees, positive CCW/negative CW, zero for fewer than three open entries. Zero-length/nonfinite edge arithmetic is not separately rejected, no allocation or geometry mutation.

Exterior turning angle (degrees, CCW positive) at ring vertex i.

Here is the caller graph for this function:

◆ simplifyConstraints()

ConstraintSimplificationResult meshkit::plan::simplifyConstraints ( const Vector< SimplificationFeature > & features,
const ConstraintSimplificationOptions & options = {} )

Remove redundant constraint vertices within each feature's policy without moving any coordinate.

Validates every policy, coordinate, elevation count and protected point first. Open-line endpoints, fixed vertices, corners above maxTurnDegrees, ring vertex 0 (plus two more when a ring would keep fewer than three) are always kept. A shortcut over a span must keep every removed vertex within maxDeviation/maxZDeviation with strictly increasing projection inside the shortcut, and must not cross, overlap, sweep over, lose a crossing with or (with minimumClearance) approach other original segments or protected points. A rejected span is split and retried. Rings failing the area limits, and features whose output shortcuts intersect, are restored.

Parameters
[in]featuresInput features in one planar frame; read only, not retained.
[in]optionsPins, cancellation and limits; the callback runs synchronously.
Returns
One output feature and one change per input. Invalid input: error set, ok false. Work or workspace exhaustion: all originals, ok true, budgetRetained set. Cancellation: all originals, ok false. No IO; no shared mutable state besides one-time exact-predicate initialisation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ triangleScaledJacobian()

double meshkit::plan::triangleScaledJacobian ( const Point2 & a,
const Point2 & b,
const Point2 & c )
inline

Compute the minimum orientation-normalized corner sine of a triangle.

Parameters
[in]aFirst planar vertex, finite coordinates and representable differences/products required.
[in]bSecond vertex in same coordinate units.
[in]cThird vertex in same coordinate units, winding may be either direction.
Returns
Dimensionless minimum corner sine capped above at 1, equilateral sqrt(3)/2, zero on a detected zero-length edge. Collinear geometry ordinarily yields zero; no finite-input/overflow validation, so callers must not use this as a general invalid-coordinate classifier. No mutation or allocation.

Minimum sine of a triangle's angles (1 is unattainable; equilateral = 0.866; right isosceles = 0.707). Used by the smoothing guard for the triangles that remain inside a quad region.

Here is the call graph for this function:

◆ validate() [1/3]

Text meshkit::plan::validate ( const PatchMesh & pm)

Requires finite convex CCW quads, consistently shared cell edges, and one simple boundary matching exactly the outer cell edges.

Validate complete convex CCW quad patch topology and one simple matching boundary.

Boundary crossings, remote touches, holes and disconnected pieces are rejected; an indexed boundary check avoids comparing every cell pair. Empty string = valid.

Parameters
[in]pmBorrowed local-index patch, unchanged; vertex/cell/boundary counts must fit int.
Returns
Empty on finite coordinates, valid indices/convex positive-area cells, opposite shared-edge directions and one nonintersecting/non-touching closed boundary matching outer edges. Rejects holes, duplicates, remote boundary contacts and disconnected loops. Patch attribute values are not validated; line indices and incident edges are checked. Allocates vertex/edge/boundary index storage; no source mutation, repair, transform or IO.

◆ validate() [2/3]

Text meshkit::plan::validate ( const StructuredPatch & p)

Input checks.

Check four finite convex cyclic corners and representable subdivision products.

Empty string = valid.

Parameters
[in]pBorrowed structured patch, unchanged; corners may use either winding, subdivisions >=1.
Returns
Empty when these prerequisites pass, first owned diagnostic otherwise. Does not generate cells, inspect tag syntax, impose practical memory budget or certify final interpolated arithmetic.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate() [3/3]

Text meshkit::plan::validate ( const SweptPatch & p)

Input checks for a swept patch: >= 2 finite centreline points with no repeated consecutive vertex, finite width > 0, across >= 1, finite along >= 0, and station, cell and boundary counts that fit in int.

Check swept input geometry and representable station/cell/boundary counts.

Folded or overlapping offsets are not detected here (makeSweptPatch() checks them). Empty string = valid, otherwise the first problem found; the parameter and return value are documented with the definition.

Parameters
[in]pBorrowed patch, unchanged; >=2 finite nonduplicate consecutive centerline vertices, positive finite width, across>=1 and finite nonnegative along spacing required, common XY units.
Returns
Empty on input/count success, first owned diagnostic otherwise. Does not certify offset folding/global overlap; those checks occur after makeSweptPatch generation. May calculate counts, no mesh/source mutation, CRS transform or IO.
Here is the call graph for this function:

◆ validateQuadRegion()

Text meshkit::plan::validateQuadRegion ( const QuadRegion & r,
const Vector< Polygon > & domains,
const Vector< Polygon > & holes )

Check region authoring policy, normalized ring and sampled domain/hole containment.

Parameters
[in]rBorrowed region, unchanged. Finite aspect override must be negative/inherit, zero/unbounded or >=1. Directional spacing requires finite positive along/across lengths and finite angle, Auto/Mapped mode, no background flag or owned holes; isotropic spacing is used only when >0 without an explicit finite check.
[in]domainsBorrowed finite planar domain rings, unchanged; empty skips domain tests, background regions also skip them. Every normalized vertex plus area centroid must lie in exactly one same domain, with scale-fuzzy boundary counting inside.
[in]holesBorrowed finite excluded rings in the same units, unchanged. A vertex/centroid strictly inside a hole rejects, fuzzy boundary contact is allowed. r.holes is not otherwise geometrically validated here.
Returns
Owned first English error, empty when these checks pass. Requires >=3 normalized vertices, finite coordinates, no proper self-crossing and positive area; spacing requests require >=four target cells' area (directional includes roundoff allowance). Probe-only containment does not certify every edge or full polygon lies inside domain/outside holes, nor classify Auto into a guaranteed supported mesher. Allocates normalized ring/probes/diagnostics, no source mutation, engine validation or error rollback.

Validate one region: >= 3 distinct vertices, simple, area >= 4·h² (h = spacing when > 0, else skipped), every vertex inside exactly one of domains and outside every holes ring. Empty string = valid.

Here is the call graph for this function:

◆ validateQuadRegionsDisjoint()

Text meshkit::plan::validateQuadRegionsDisjoint ( const Vector< QuadRegion > & regions)

Check explicit region pairs for proper crossings or strictly interior sampled vertices.

Parameters
[in]regionsBorrowed finite region rings, unchanged; normalized to open CCW copies. Call individual validation separately; degenerate <3-corner rings are ignored by overlap testing.
Returns
First English region i overlaps region j using zero-based indices, or empty. Any pair containing a background region is skipped because explicit regions may be subtracted from backgrounds. Shared edges/ vertices are allowed under scale-fuzzy boundary tests. Identical coincident rings can pass because no proper crossing/strictly interior vertex exists, so this is not a full polygon-intersection-area proof. Quadratic pair/edge work with temporary rings, no input mutation, engine query or retained references.

Pairwise check: rings may share edges/vertices but no ring vertex of one may lie strictly inside another and edges may not properly cross. Returns the first offending pair as "region i overlaps region j", or "".

Here is the call graph for this function:

Variable Documentation

◆ pi

double meshkit::plan::pi = 3.141592653589793238462643383279502884
inlineconstexpr

The constant pi as a double.