Function validateRing

Validates one LinearRing2View.

RingValidationResult validateRing(T)(
  scope LinearRing2View!T ring
) pure nothrow @nogc @safe
if (isValidationScalar!T);

Supported scalar types are int, long, float, and double. real is deliberately outside the robust topology domain.

A valid ring:

- has at least three stored vertices; - contains only finite coordinates; - has no zero-length implicit edge; - is a simple closed polygonal curve.

Ring orientation does not affect validity.

The stored point sequence is closed implicitly. An explicitly repeated copy of the first vertex therefore creates a zero-length closing edge and is invalid.

Topological decisions are exact. No epsilon or rounded intersection coordinate is used.

The first detected issue is returned deterministically.

No allocation is performed.

Complexity

O(n^2) time and O(1) auxiliary space for n stored vertices.