Esempio n. 1
0
        private UIBezierPath NormalPath(LiquittableCircle circle, LiquittableCircle other)
        {
            var tuple1   = CircleConnectedPoint(circle, other);
            var tuple2   = CircleConnectedPoint(other, circle);
            var cgPoint1 = tuple1.Item1;
            var cgPoint2 = tuple1.Item2;
            var cgPoint3 = tuple2.Item1;
            var cgPoint4 = tuple2.Item2;
            var nullable = CoreGraphicsExtensions.Intersection(cgPoint1, cgPoint3, cgPoint2, cgPoint4);

            if (!nullable.HasValue)
            {
                return(null);
            }
            var uiBezierPath = new UIBezierPath();
            var nfloat       = CircleRatio(circle, other);

            // ISSUE: reference to a compiler-generated method
            uiBezierPath.MoveTo(cgPoint1);
            var cgPoint5      = cgPoint2.Mid(cgPoint3);
            var cgPoint6      = cgPoint1.Mid(cgPoint4);
            var ratio         = (1 - nfloat) / (1 - AngleThreshold) * Viscosity;
            var controlPoint1 = cgPoint5.Mid(nullable.Value).Split(cgPoint6, ratio);
            var controlPoint2 = cgPoint6.Mid(nullable.Value).Split(cgPoint5, ratio);

            // ISSUE: reference to a compiler-generated method
            uiBezierPath.AddQuadCurveToPoint(cgPoint4, controlPoint1);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath.AddLineTo(cgPoint3);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath.AddQuadCurveToPoint(cgPoint2, controlPoint2);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath.ClosePath();
            return(uiBezierPath);
        }
Esempio n. 2
0
        private UIBezierPath[] SplitPath(LiquittableCircle circle, LiquittableCircle other, nfloat ratio)
        {
            var tuple1   = CircleConnectedPoint(circle, other, CoreGraphicsExtensions.DegToRad(60));
            var tuple2   = CircleConnectedPoint(other, circle, CoreGraphicsExtensions.DegToRad(60));
            var cgPoint1 = tuple1.Item1;
            var cgPoint2 = tuple1.Item2;
            var cgPoint3 = tuple2.Item1;
            var cgPoint4 = tuple2.Item2;
            var nullable = CoreGraphicsExtensions.Intersection(cgPoint1, cgPoint3, cgPoint2, cgPoint4);

            if (!nullable.HasValue)
            {
                return(new UIBezierPath[0]);
            }
            var self1         = CircleConnectedPoint(circle, other, 0).Item1;
            var self2         = CircleConnectedPoint(other, circle, 0).Item1;
            var nfloat        = (ratio - _connectThresh) / (AngleThreshold - _connectThresh);
            var controlPoint1 = self2.Split(nullable.Value, nfloat * nfloat);
            var uiBezierPath1 = new UIBezierPath();

            // ISSUE: reference to a compiler-generated method
            uiBezierPath1.MoveTo(cgPoint1);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath1.AddQuadCurveToPoint(cgPoint2, controlPoint1);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath1.ClosePath();
            var controlPoint2 = self1.Split(nullable.Value, nfloat * nfloat);
            var uiBezierPath2 = new UIBezierPath();

            // ISSUE: reference to a compiler-generated method
            uiBezierPath2.MoveTo(cgPoint3);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath2.AddQuadCurveToPoint(cgPoint4, controlPoint2);
            // ISSUE: reference to a compiler-generated method
            uiBezierPath2.ClosePath();
            return(new[]
            {
                uiBezierPath1,
                uiBezierPath2
            });
        }