public static PathFragment TransformFragment <TSource>(this IEnumerable <TSource> sourceItems, Func <TSource, ICoordinate> transformFunction) { PathFragment targetItems = new PathFragment(); foreach (TSource sourceItem in sourceItems) { targetItems.Add(transformFunction(sourceItem)); } return(targetItems); }
private PathFragment OffsetList(PathFragment p) { PathFragment offsets = new PathFragment(); for (int indx = 1; indx < p.Count; indx++) { Cartesian pc = p[indx] as Cartesian; Cartesian pc1 = p[indx - 1] as Cartesian; Cartesian pnt = new Cartesian(pc.X - pc1.X, pc.Y - pc1.Y, pc.Z - pc1.Z); offsets.Add(pnt); } return(offsets); }
private PathFragment OffsetList(PathFragment p) { PathFragment offsets = new PathFragment(); for (int indx = 1; indx < p.Count; indx++) { Cartesian pc = p[indx] as Cartesian; Cartesian pc1 = p[indx - 1] as Cartesian; Cartesian pnt = new Cartesian(pc.X - pc1.X, pc.Y - pc1.Y, pc.Z - pc1.Z); offsets.Add(pnt); } return offsets; }