예제 #1
0
        public static bool SegmentToAboveArc(Segment seg, Arc arcAbove, ref double distance)
        {
            bool success = false;

            distance = double.MaxValue;
            List <Segment> listArc = arcAbove.Explode(20);

            foreach (Segment segArc in listArc)
            {
                double dist = 0.0f;
                if (PointToAboveSegment(seg.P0, segArc, ref dist) && dist > 0)
                {
                    distance = System.Math.Min(distance, dist);
                    success  = true;
                }
                if (PointToAboveSegment(seg.P1, segArc, ref dist) && dist > 0)
                {
                    distance = System.Math.Min(distance, dist);
                    success  = true;
                }
                if (PointToAboveSegment(segArc.P0, seg, ref dist) && dist < 0)
                {
                    distance = System.Math.Min(distance, -dist);
                    success  = true;
                }
                if (PointToAboveSegment(segArc.P1, seg, ref dist) && dist < 0)
                {
                    distance = System.Math.Min(distance, -dist);
                    success  = true;
                }
            }
            return(success);
        }
예제 #2
0
 public static bool PointToAboveArc(Vector2D p, Arc arc, ref double distance)
 {
     bool success = false;
     distance = double.MaxValue;
     IList<Segment> list = arc.Explode(20);
     foreach (Segment seg in list)
     {
         double dist = 0.0f;
         if (PointToAboveSegment(p, seg, ref dist) && dist > 0)
         {
             distance = System.Math.Min(dist, distance);
             success = true;
         }
     }
     return success;
 }
예제 #3
0
        public static bool PointToAboveArc(Vector2D p, Arc arc, ref double distance)
        {
            bool success = false;

            distance = double.MaxValue;
            IList <Segment> list = arc.Explode(20);

            foreach (Segment seg in list)
            {
                double dist = 0.0f;
                if (PointToAboveSegment(p, seg, ref dist) && dist > 0)
                {
                    distance = System.Math.Min(dist, distance);
                    success  = true;
                }
            }
            return(success);
        }
예제 #4
0
        public static bool ArcToAboveArc(Arc arc1, Arc arc2, ref double distance)
        {
            bool success = false;

            distance = double.MaxValue;
            List <Segment> listArc1 = arc1.Explode(20);
            List <Segment> listArc2 = arc2.Explode(20);

            foreach (Segment seg1 in listArc1)
            {
                foreach (Segment seg2 in listArc2)
                {
                    double dist = double.MaxValue;
                    if (VerticalDistance.SegmentToAboveSegment(seg1, seg2, ref dist) && dist > 0)
                    {
                        distance = System.Math.Min(distance, dist);
                        success  = true;
                    }
                }
            }
            return(success);
        }
예제 #5
0
        public static bool SegmentToAboveArc(Segment seg, Arc arcAbove, ref double distance)
        {
            bool success = false;
            distance = double.MaxValue;
            List<Segment> listArc = arcAbove.Explode(20);

            foreach (Segment segArc in listArc)
            {
                double dist = 0.0f;
                if (PointToAboveSegment(seg.P0, segArc, ref dist) && dist > 0)
                {
                    distance = System.Math.Min(distance, dist);
                    success = true;
                }
                if (PointToAboveSegment(seg.P1, segArc, ref dist) && dist > 0)
                {
                    distance = System.Math.Min(distance, dist);
                    success = true;
                }
                if (PointToAboveSegment(segArc.P0, seg, ref dist) && dist < 0)
                {
                    distance = System.Math.Min(distance, -dist);
                    success = true;
                }
                if (PointToAboveSegment(segArc.P1, seg, ref dist) && dist < 0)
                {
                    distance = System.Math.Min(distance, -dist);
                    success = true;
                }
            }
            return success;
        }
예제 #6
0
        public static bool ArcToAboveArc(Arc arc1, Arc arc2, ref double distance)
        {
            bool success = false;
            distance = double.MaxValue;
            List<Segment> listArc1 = arc1.Explode(20);
            List<Segment> listArc2 = arc2.Explode(20);

            foreach (Segment seg1 in listArc1)
                foreach (Segment seg2 in listArc2)
                {
                    double dist = double.MaxValue;
                    if (VerticalDistance.SegmentToAboveSegment(seg1, seg2, ref dist) && dist > 0)
                    {
                        distance = System.Math.Min(distance, dist);
                        success = true;
                    }
                }
            return success;
        }