private ProfilePathPoint GetProfilePath(Range range, int rowIndex) { ProfilePathPoint profilePathPoint = new ProfilePathPoint(); profilePathPoint.VerticalDepth = ConvertParser.GetConvertValue <double>(range.Worksheet.Cells[rowIndex, range.FirstColumn].StringValue); profilePathPoint.InclinationAngle = ConvertParser.GetConvertValue <double>(range.Worksheet.Cells[rowIndex, range.FirstColumn + 1].StringValue); profilePathPoint.AzimuthAngle = ConvertParser.GetConvertValue <double>(range.Worksheet.Cells[rowIndex, range.FirstColumn + 2].StringValue); profilePathPoint.Extension = ConvertParser.GetConvertValue <double>(range.Worksheet.Cells[rowIndex, range.FirstColumn + 3].StringValue); return(profilePathPoint); }
public List <Point3D> Get3DProfilePathPoints(List <ProfilePathPoint> profilePathPoints) { List <Point3D> point3Ds = new List <Point3D>(); Point3D currentPoint3D = new Point3D(); if (profilePathPoints.Count < 2) { return(point3Ds); } point3Ds.Add(new Point3D(0, 0, 0)); if (!MathHelper.IsMiscalculationEqual(profilePathPoints[0].VerticalDepth, 0)) { profilePathPoints.Insert(0, new ProfilePathPoint(0, 0, 0, 0)); } for (int i = 1; i < profilePathPoints.Count; i++) { ProfilePathPoint previousPoint = profilePathPoints[i - 1]; ProfilePathPoint currentPoint = profilePathPoints[i]; double mediumLenght = (currentPoint.GetLength() - previousPoint.GetLength()) / 2; double radI1 = MathHelper.AngleToRadian(previousPoint.InclinationAngle); double radA1 = MathHelper.AngleToRadian(previousPoint.AzimuthAngle); double radI2 = MathHelper.AngleToRadian(currentPoint.InclinationAngle); double radA2 = MathHelper.AngleToRadian(currentPoint.AzimuthAngle); double dogLegAngle = GetDogLegAngle(radI1, radI2, previousPoint.InclinationAngle, currentPoint.InclinationAngle, previousPoint.AzimuthAngle, currentPoint.AzimuthAngle); double ratioFactor = GetRatioFactor(dogLegAngle); Point3D point3D = new Point3D(); point3D.X = currentPoint3D.X + GetXMinimumCurvatureMethod(mediumLenght, ratioFactor, radI1, radA1, radI2, radA2); point3D.Y = currentPoint3D.Y + GetYMinimumCurvatureMethod(mediumLenght, ratioFactor, radI1, radA1, radI2, radA2); point3D.Z = currentPoint3D.Z - GetZMinimumCurvatureMethod(mediumLenght, ratioFactor, radI1, radI2); point3Ds.Add(point3D); currentPoint3D = point3D; } return(point3Ds); }