Function GeodesicPolygonAccumulator.tryAddPoint

Add the next polygon corner without throwing.

bool tryAddPoint(
  const GeographicCoordinate!T point
) pure nothrow @nogc @safe;

Call this once for each corner, in boundary order. The first point starts the outline; each later point adds a shortest-geodesic edge. On failure the existing polygon remains unchanged.

Example

Example incrementally adding polygon vertices.

const solver =
    Geodesic!double.fromEllipsoid(
        Ellipsoid!double.sphere(
            6_371_000.0));

auto accumulator =
    GeodesicPolygonAccumulator!double.fromGeodesic(
        solver);

assert(
    accumulator.tryAddPoint(
        GeographicCoordinate!double.fromComponents(
            Latitude!double.fromDegrees(0.0),
            Longitude!double.fromDegrees(0.0))));

assert(accumulator.pointCount == 1);