Ejemplo n.º 1
0
        public Point GetPoint(double length, double segmentLength)
        {
            if (length < 0 || length > Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (_isReverse)
            {
                length = Length - length;
            }
            var parameter = GraphicHelper.GetParameter(_degree, _controlPoints, _knots, _weights, _startParameter, length, _length, segmentLength);

            return(GraphicHelper.ComputePoint(_degree, _knots, _controlPoints, _weights, parameter));
        }
Ejemplo n.º 2
0
        public Point GetPoint(double length, double segmentLength)
        {
            if (length < 0 || length > Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (_isReverse)
            {
                length = Length - length;
            }
            var parameter = GraphicHelper.GetParameter(_lr, _sr, 0, length, segmentLength);

            return(_center + new Vector(_lr * Math.Cos(parameter), _sr * Math.Sin(parameter)) * GraphicHelper.CreateRotateMatrix(_center, _rotateAngle));
        }
Ejemplo n.º 3
0
 public IEnumerable <IGraphic> Spilt(IEnumerable <Segment> segments, double segmentLength)
 {
     foreach (var segment in segments)
     {
         var startOffset = segment.StartOffset;
         var endOffset   = segment.EndOffset;
         if (_isReverse)
         {
             startOffset = _length - segment.EndOffset;
             endOffset   = _length - segment.StartOffset;
         }
         var startAngle = Utilities.RadianToAngle(GraphicHelper.GetParameter(_lr, _sr, 0, startOffset, segmentLength));
         var endAngle   = Utilities.RadianToAngle(GraphicHelper.GetParameter(_lr, _sr, 0, endOffset, segmentLength));
         yield return(new GraphicEllipticalArc(_center, _lr, _sr, startAngle, endAngle, _rotateAngle, _isReverse));
     }
 }
Ejemplo n.º 4
0
        public Vector GetTangent(double length, double segmentLength)
        {
            if (length < 0 || length > Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (_isReverse)
            {
                length = Length - length;
            }
            var parameter = GraphicHelper.GetParameter(_degree, _controlPoints, _knots, _weights, _startParameter, length, _length, segmentLength);
            var dir       = GraphicHelper.ComputeVector(_degree, 1, _knots, _controlPoints, parameter);

            if (_isReverse)
            {
                dir = -dir;
            }
            return(dir);
        }
Ejemplo n.º 5
0
        public Vector GetTangent(double length, double segmentLength)
        {
            if (length < 0 || length > Length)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (_isReverse)
            {
                length = Length - length;
            }
            var parameter = GraphicHelper.GetParameter(_lr, _sr, 0, length, segmentLength);
            var dir       = new Vector(-_lr * Math.Sin(parameter), _sr * Math.Cos(parameter));

            if (_isReverse)
            {
                dir = -dir;
            }
            return(dir);
        }