Ejemplo n.º 1
0
        public static int FindShortestRoutingTime(IList <Point> points, WireRoute a, WireRoute b)
        {
            int minTime = int.MaxValue;

            foreach (var point in points)
            {
                int timea = a.GetRoutingTime(point);
                int timeb = b.GetRoutingTime(point);
                int time  = a.GetRoutingTime(point) + b.GetRoutingTime(point);
                minTime = Min(minTime, time);
            }

            return(minTime);
        }
Ejemplo n.º 2
0
        public static IList <Point> FindIntersections(WireRoute firstRoute, WireRoute secondRoute)
        {
            var list = new List <Point>();

            foreach (var firstSegment in firstRoute.Segments)
            {
                foreach (var secondSegment in secondRoute.Segments)
                {
                    if (firstSegment.FindIntersection(secondSegment, out var point))
                    {
                        list.Add(point);
                    }
                }
            }

            return(list);
        }