示例#1
0
        /// <summary>
        ///     Gets a Point3D collection representing all locations between 'start' and 'end', including 'start' and 'end', on the given 'map'.
        /// </summary>
        public static Point3D[] GetLine3D(this IPoint3D start, IPoint3D end, Map map, bool avgZ = true)
        {
            var path2d = GetLine2D(start, end, map);
            var path3d = new Point3D[path2d.Length];

            if (avgZ)
            {
                path3d.SetAll(i => path2d[i].ToPoint3D(map.GetAverageZ(path2d[i].X, path2d[i].Y)));
            }
            else
            {
                path3d.SetAll(i => path2d[i].ToPoint3D(start.Z + (int)Math.Floor((end.Z - start.Z) * (i / (double)path2d.Length))));
            }

            return(path3d);
        }
示例#2
0
		/// <summary>
		///     Gets a Point3D collection representing all locations between 'start' and 'end', including 'start' and 'end', on the given 'map'.
		/// </summary>
		public static Point3D[] GetLine3D(this IPoint3D start, IPoint3D end, Map map, bool avgZ = true)
		{
			var path2d = GetLine2D(start, end, map);
			var path3d = new Point3D[path2d.Length];

			if (avgZ)
			{
				path3d.SetAll(i => path2d[i].ToPoint3D(map.GetAverageZ(path2d[i].X, path2d[i].Y)));
			}
			else
			{
				path3d.SetAll(i => path2d[i].ToPoint3D(start.Z + (int)Math.Floor((end.Z - start.Z) * (i / (double)path2d.Length))));
			}

			return path3d;
		}