private static RoundnessPlot ConvertToRoundness(CylindricityPlot source) { var result = new RoundnessPlot(); CopyDefaults(source, result); result.Actual.CoordinateSystem = source.Actual.CoordinateSystem; result.Nominal.CoordinateSystem = source.Nominal.CoordinateSystem; result.Actual.Radius = source.Actual.Radius; result.Nominal.Radius = source.Nominal.Radius; foreach (var segment in source.Segments) { var resultSegment = new Segment <CirclePoint, CircleGeometry>(segment.Name, segment.SegmentType) { Position = segment.Points.FirstOrDefault()?.Height *source.Actual.Height ?? 0.0 }; result.Segments.Add(resultSegment); foreach (var point in segment.Points) { var resultPoint = new CirclePoint(point.Angle, point.Deviation); resultSegment.Points.Add(resultPoint); resultPoint.State = point.State; } } return(result); }
private static StraightnessPlot ConvertToStraightness(CylindricityPlot source) { var result = new StraightnessPlot(); CopyDefaults(source, result); result.Actual.CoordinateSystem = source.Actual.CoordinateSystem; result.Nominal.CoordinateSystem = source.Nominal.CoordinateSystem; var heightFactor = source.Actual.Height; foreach (var segment in source.Segments) { var resultSegment = new Segment <LinePoint, LineGeometry>(segment.Name, segment.SegmentType); result.Segments.Add(resultSegment); foreach (var point in segment.Points) { var resultPoint = new LinePoint(point.Height * heightFactor, point.Deviation); CopyDefaults(point, resultPoint); resultSegment.Points.Add(resultPoint); } } return(result); }