diff --git a/VectoCore/VectoCore/Utils/DelaunayMap.cs b/VectoCore/VectoCore/Utils/DelaunayMap.cs index bcb3b8cdd0fc5578cb2c54d3917b4a03031adbfa..5cc64203cbc07ccaf2770f9f34b63c45fb2648b4 100644 --- a/VectoCore/VectoCore/Utils/DelaunayMap.cs +++ b/VectoCore/VectoCore/Utils/DelaunayMap.cs @@ -222,6 +222,8 @@ namespace TUGraz.VectoCore.Utils /// null if interpolation has failed.</returns> public double? Interpolate(double x, double y) { + if (!_triangles.Any()) + throw new VectoException("Interpolation not possible. Call DelaunayMap.Triangulate first."); x = (x - _minX) / (_maxX - _minX); y = (y - _minY) / (_maxY - _minY); var tr = _triangles.Find(triangle => triangle.IsInside(x, y, exact: true)) ??