コード例 #1
0
        public static Bounds Dimensions(this IEnumerable <GCodeCommand> commands)
        {
            Bounds b = new Bounds();

            foreach (var Command in commands)
            {
                var MoveCommand = Command as Movement;

                if (MoveCommand == null)
                {
                    continue;
                }

                b.ExpandTo(MoveCommand.Start.X, MoveCommand.Start.Y);
                b.ExpandTo(MoveCommand.End.X, MoveCommand.End.Y);
            }

            return(b);
        }
コード例 #2
0
        public static Bounds Dimensions(this IEnumerable<GCodeCommand> commands)
        {
            Bounds b = new Bounds();

            foreach(var Command in commands)
            {
                var MoveCommand = Command as Movement;

                if (MoveCommand == null)
                    continue;

                b.ExpandTo(MoveCommand.Start.X, MoveCommand.Start.Y);
                b.ExpandTo(MoveCommand.End.X, MoveCommand.End.Y);
            }

            return b;
        }