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

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

                for (var i = 0; i < num; i += 3)
                {
                    Point[] controlPoints  = { start, _segment.Points[i], _segment.Points[i + 1], _segment.Points[i + 2] };
                    var     resultPolyline = new List <Point>();
                    BezierCurveFlattener.FlattenCubic(controlPoints, tolerance, resultPolyline, true);
                    points.AddRange(resultPolyline);
                    start = _segment.Points[i + 2];
                }
            }
Beispiel #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;
            }
        }