private static MacroStabilityInwardsSoilProfileUnderSurfaceLine Create(MacroStabilityInwardsSoilProfile1D soilProfile, MacroStabilityInwardsSurfaceLine surfaceLine) { Point2D[] localizedSurfaceLine = surfaceLine.LocalGeometry.ToArray(); double geometryBottom = Math.Min(soilProfile.Bottom, localizedSurfaceLine.Min(p => p.Y)) - 1; IEnumerable <Point2D> surfaceLineGeometry = AdvancedMath2D.CompleteLineToPolygon(localizedSurfaceLine, geometryBottom); IEnumerable <TempSoilLayerGeometry> layerGeometries = soilProfile.Layers.Select( layer => As2DGeometry( layer, soilProfile, localizedSurfaceLine.First().X, localizedSurfaceLine.Last().X)) .ToArray(); return(GeometriesToIntersections(layerGeometries, surfaceLineGeometry)); }
private static TempSoilLayerGeometry As2DGeometry(MacroStabilityInwardsSoilLayer1D layer, MacroStabilityInwardsSoilProfile1D soilProfile, double minX, double maxX) { double top = layer.Top; double bottom = top - soilProfile.GetLayerThickness(layer); return(new TempSoilLayerGeometry(new[] { new Point2D(minX, top), new Point2D(maxX, top), new Point2D(maxX, bottom), new Point2D(minX, bottom) }, layer.Data)); }
private bool Equals(MacroStabilityInwardsSoilProfile1D other) { return(AreLayersEqual(other.layers) && Bottom.Equals(other.Bottom) && string.Equals(Name, other.Name)); }