Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.StixFileReader/SoilProfile2DDataModel.cs =================================================================== diff -u -r6181 -r6436 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.StixFileReader/SoilProfile2DDataModel.cs (.../SoilProfile2DDataModel.cs) (revision 6181) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.StixFileReader/SoilProfile2DDataModel.cs (.../SoilProfile2DDataModel.cs) (revision 6436) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2024. All rights reserved. +// Copyright (C) Stichting Deltares 2025. All rights reserved. // // This file is part of the application DAM - UI. // @@ -76,6 +76,7 @@ }; soilProfile2D.Surfaces.Add(soilLayer2D); } + soilProfile2D.Geometry.Rebox(); CreateInnerLoops(soilProfile2D); return soilProfile2D; @@ -137,7 +138,7 @@ surface.Name = layer.Label; } - + geometrySurface.Add(surface); return surface; @@ -179,7 +180,7 @@ EndPoint = new GeometryPoint(secondPoint.X + offsetX, 0, secondPoint.Z) }; } - + private bool IsCurvePresent(GeometryCurve curve, IEnumerable geometryCurves) { return geometryCurves.Any(geometryCurve => @@ -209,13 +210,6 @@ return (Math.Abs(firstPoint.X - (secondPoint.X + offsetX)) < pointTolerance) && (Math.Abs(firstPoint.Z - secondPoint.Z) < pointTolerance); } - - private struct LayerConnection(int innerLayer, int outerLayer, double areaOuterLayer) - { - public int InnerLayer { get; set; } = innerLayer; - public int OuterLayer { get; set; } = outerLayer; - public double AreaOuterLayer { get; set; } = areaOuterLayer; - } private static void CreateInnerLoops(SoilProfile2D soilProfile) { @@ -251,13 +245,15 @@ { continue; } + GeometryLoop loop2 = soilProfile.Surfaces[index2].GeometrySurface.OuterLoop; if (loop2.Points.All(loop1.IsPointInLoopArea) && CentroidOfLoop2IsInLoop1(loop2, loop1)) { layerConnections.Add(new LayerConnection(index2, index1, loop1.Area())); } } } + return layerConnections; } @@ -269,4 +265,11 @@ bool centroidOfLoop2IsInLoop1 = loop1.IsPointInLoopArea(centroidOfLoop2); return centroidOfLoop2IsInLoop1; } + + private struct LayerConnection(int innerLayer, int outerLayer, double areaOuterLayer) + { + public int InnerLayer { get; } = innerLayer; + public int OuterLayer { get; } = outerLayer; + public double AreaOuterLayer { get; } = areaOuterLayer; + } } \ No newline at end of file