Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs =================================================================== diff -u -r5863 -r5886 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 5863) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 5886) @@ -152,23 +152,22 @@ /// /// /// - /// /// The 2D soil layer - public static SoilLayer2D DetermineOriginalLayerFromOldSurfaces(GeometrySurface geometrySurface, IEnumerable oldSurfaces, - double shift) + public static SoilLayer2D DetermineOriginalLayerFromOldSurfaces(GeometrySurface geometrySurface, + IEnumerable oldSurfaces) { Point2D point = new Point2D(0.0, 0.0); bool isPointInOuterLoopAndOldSurface = false; - point = IsPointInOuterLoopAndOldSurface(geometrySurface, oldSurfaces, shift, point, ref isPointInOuterLoopAndOldSurface); + point = IsPointInOuterLoopAndOldSurface(geometrySurface, oldSurfaces, point, ref isPointInOuterLoopAndOldSurface); if (!isPointInOuterLoopAndOldSurface) { isPointInOuterLoopAndOldSurface = IsPointInOldSurfaceJustBelowTopOfNewGeometryWithinItsLimits(geometrySurface, - oldSurfaces, shift, point, isPointInOuterLoopAndOldSurface); + oldSurfaces, point, + isPointInOuterLoopAndOldSurface); } if (isPointInOuterLoopAndOldSurface) { - point.X -= shift; if (IsPointInPreviousOuterLoopOfOldSurface(oldSurfaces, point, out SoilLayer2D soilLayer2D)) { return soilLayer2D; @@ -237,7 +236,7 @@ } private static bool IsPointInOldSurfaceJustBelowTopOfNewGeometryWithinItsLimits(GeometrySurface geometrySurface, - IEnumerable oldSurfaces, double shift, Point2D point, bool isPointInOuterLoopAndOldSurface) + IEnumerable oldSurfaces, Point2D point, bool isPointInOuterLoopAndOldSurface) { GeometryPointString topGeometrySurface = geometrySurface.DetermineTopGeometrySurface(); topGeometrySurface.SortPointsByXAscending(); @@ -247,8 +246,8 @@ Point2D geometryPoint2 = topGeometrySurface[checked (topGeometrySurface.Count - 1)]; geometryPoint2.X += deviation; geometryPoint2.Z -= deviation; - bool isPoint1WithinOldSurfaces = IsPointWithinOldSurfaces(geometryPoint1, oldSurfaces, shift, -deviation); - bool isPoint2WithinOldSurfaces = IsPointWithinOldSurfaces(geometryPoint2, oldSurfaces, shift, -deviation); + bool isPoint1WithinOldSurfaces = IsPointWithinOldSurfaces(geometryPoint1, oldSurfaces, -deviation); + bool isPoint2WithinOldSurfaces = IsPointWithinOldSurfaces(geometryPoint2, oldSurfaces, -deviation); double d = double.NaN; if (isPoint1WithinOldSurfaces && !isPoint2WithinOldSurfaces) { @@ -275,13 +274,13 @@ return isPointInOuterLoopAndOldSurface; } - private static Point2D IsPointInOuterLoopAndOldSurface(GeometrySurface geometrySurface, IEnumerable oldSurfaces, double shift, Point2D point, ref bool isPointInOuterLoopAndOldSurface) + private static Point2D IsPointInOuterLoopAndOldSurface(GeometrySurface geometrySurface, IEnumerable oldSurfaces, Point2D point, ref bool isPointInOuterLoopAndOldSurface) { foreach (GeometryCurve curve in geometrySurface.OuterLoop.CurveList) { point = new Point2D((curve.HeadPoint.X + curve.EndPoint.X) / 2.0, (curve.HeadPoint.Z + curve.EndPoint.Z) / 2.0); - if (IsPointWithinOldSurfaces(point, oldSurfaces, shift, deviation) || IsPointWithinOldSurfaces(point, oldSurfaces, - shift, -deviation)) + if (IsPointWithinOldSurfaces(point, oldSurfaces, deviation) || IsPointWithinOldSurfaces(point, oldSurfaces, + -deviation)) { point.Z += deviation; if (Routines2D.CheckIfPointIsInPolygon(geometrySurface.OuterLoop, point.X, point.Z) == @@ -319,11 +318,10 @@ return xmaxFromSurfaces; } - private static bool IsPointWithinOldSurfaces(Point2D point, IEnumerable oldSurfaces, double shift, - double verticalShift) + private static bool IsPointWithinOldSurfaces(Point2D point, IEnumerable oldSurfaces, double verticalShift) { point.Z += verticalShift; - var shiftedPoint = new Point2D(point.X - shift, point.Z); + var shiftedPoint = new Point2D(point.X, point.Z); foreach (SoilLayer2D oldSurface in oldSurfaces) { GeometryLoop outerLoop = oldSurface.GeometrySurface.OuterLoop;