Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilSurfaceProfile.cs
===================================================================
diff -u -r4540 -r5399
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilSurfaceProfile.cs (.../SoilSurfaceProfile.cs) (revision 4540)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilSurfaceProfile.cs (.../SoilSurfaceProfile.cs) (revision 5399)
@@ -362,6 +362,7 @@
/// A collection of .
private static IEnumerable GetEnclosedAreas(IReadOnlyList surfaceLinePoints, double topLevel, double bottomLevel)
{
+ const double toleranceAlmostEqual = 1e-09;
var currentArea = new EnclosedArea();
var enclosedAreas = new List();
@@ -380,16 +381,16 @@
currentZCoordinate = topLevel;
currentArea.AddCoordinate(new Point2D(xCoordinate, topLevel));
}
- else if (Math.Abs(zCoordinateSurfaceLine - bottomLevel) < GeometryConstants.Accuracy // Surface line is at layer bottom level
+ else if (Math.Abs(zCoordinateSurfaceLine - bottomLevel) < toleranceAlmostEqual // Surface line is at layer bottom level
|| (zCoordinateSurfaceLine >= bottomLevel && zCoordinateSurfaceLine <= topLevel)) // Surface line is between the layer top and bottom level
{
currentArea.AddCoordinate(new Point2D(xCoordinate, zCoordinateSurfaceLine));
}
// Determine if the current surface line point is located as a point on the horizontal line on the layer bottom level.
// If yes, then a new area should be added
- if (Math.Abs(zCoordinateSurfaceLine - bottomLevel) < GeometryConstants.Accuracy
- && Math.Abs(nextSurfaceLineZCoordinate - bottomLevel) < GeometryConstants.Accuracy)
+ if (Math.Abs(zCoordinateSurfaceLine - bottomLevel) < toleranceAlmostEqual
+ && Math.Abs(nextSurfaceLineZCoordinate - bottomLevel) < toleranceAlmostEqual)
{
enclosedAreas.Add(currentArea);
currentArea = new EnclosedArea();