Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Routines2D.cs =================================================================== diff -u -r4052 -r4132 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Routines2D.cs (.../Routines2D.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Routines2D.cs (.../Routines2D.cs) (revision 4132) @@ -251,8 +251,7 @@ } } - int polygonPoints = polygon.CalcPoints.Count; - if (polygonPoints > 2) + if (polygon.CalcPoints.Count > 2) { double deltaX = polygon[0].X - x; double deltaZ = polygon[0].Z - z; @@ -268,7 +267,7 @@ double som = 0; var index = 1; - while (index < polygonPoints) + while (index < polygon.CalcPoints.Count) { deltaX = polygon[index].X - x; deltaZ = polygon[index].Z - z;