Exemplo n.º 1
0
            public override void Flatten(IList <Point> points, double tolerance)
            {
                Point[] controlPoints  = { Start, _segment.Point1, _segment.Point2 };
                var     resultPolyline = new List <Point>();

                BezierCurveFlattener.FlattenQuadratic(controlPoints, tolerance, resultPolyline, true);
                points.AddRange(resultPolyline);
            }
Exemplo n.º 2
0
            public override void Flatten(IList <Point> points, double tolerance)
            {
                var start = Start;
                var num   = _segment.Points.Count / 2 * 2;

                for (var i = 0; i < num; i += 2)
                {
                    Point[] controlPoints  = { start, _segment.Points[i], _segment.Points[i + 1] };
                    var     resultPolyline = new List <Point>();
                    BezierCurveFlattener.FlattenQuadratic(controlPoints, tolerance, resultPolyline, true);
                    points.AddRange(resultPolyline);
                    start = _segment.Points[i + 1];
                }
            }
Exemplo n.º 3
0
        public void Flatten(IList <Point> resultPolyline, double tolerance, IList <double> resultParameters)
        {
            switch (Type)
            {
            case SegmentType.Line:
                resultPolyline.Add(Points[1]);
                if (resultParameters == null)
                {
                    break;
                }
                resultParameters.Add(1.0);
                return;

            case SegmentType.CubicBeizer:
                BezierCurveFlattener.FlattenCubic(Points, tolerance, resultPolyline, true,
                                                  resultParameters);
                break;

            default:
                return;
            }
        }