Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs =================================================================== diff -u -r5126 -r5128 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs (.../MacroStabilityCommonHelper.cs) (revision 5126) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs (.../MacroStabilityCommonHelper.cs) (revision 5128) @@ -412,11 +412,13 @@ /// The surfaceline. /// The dike embankment soil. /// Thrown when no SoilProfile2D is defined - private static void CombineSoilProfile2DWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, Soil dikeEmbankmentSoil) + private static void CombineSoilProfile2DWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, + Soil dikeEmbankmentSoil) { ValidateForCombineSoilProfile2DWithSurfaceLine(subSoilScenario, surfaceLine2, dikeEmbankmentSoil); - FitSoilProfile2DToSurfaceLine(subSoilScenario, surfaceLine2); + SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D(surfaceLine2.Geometry, subSoilScenario.SoilProfile2D, + dikeEmbankmentSoil, 0); } private static void ValidateForCombineSoilProfile2DWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, Soil dikeEmbankmentSoil) @@ -447,32 +449,6 @@ } } - private static void FitSoilProfile2DToSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2) - { - const double tolerance = 1e-7; - double surfaceLine2LeftX = surfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside).X; - if (subSoilScenario.SoilProfile2D.Geometry.GetGeometryBounds().Left.IsLessThan(surfaceLine2LeftX, tolerance)) - { - GeometryHelper.CutGeometryLeft(subSoilScenario.SoilProfile2D.Geometry, surfaceLine2LeftX); - } - - if (surfaceLine2LeftX.IsLessThan(subSoilScenario.SoilProfile2D.Geometry.GetGeometryBounds().Left, tolerance)) - { - GeometryHelper.ExtendGeometryLeft(subSoilScenario.SoilProfile2D.Geometry, surfaceLine2LeftX); - } - - double surfaceLine2RightX = surfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelInside).X; - if (subSoilScenario.SoilProfile2D.Geometry.GetGeometryBounds().Right.IsLessThan(surfaceLine2RightX, tolerance)) - { - GeometryHelper.ExtendGeometryRight(subSoilScenario.SoilProfile2D.Geometry, surfaceLine2RightX); - } - - if (surfaceLine2RightX.IsLessThan(subSoilScenario.SoilProfile2D.Geometry.GetGeometryBounds().Right, tolerance)) - { - GeometryHelper.CutGeometryRight(subSoilScenario.SoilProfile2D.Geometry, surfaceLine2RightX); - } - } - /// /// Combines the surfaceline with the SoilProfile1D. ///