예제 #1
0
 public Point CalculateLocation(double uParam)
 {
     if (Curves.Length == 1)
     {
         return(new Point(((double[])Curves.First().Evaluate2(uParam, 1)).Take(3).ToArray()));
     }
     else
     {
         throw new Exception("Only single curve is supported");
     }
 }
예제 #2
0
 public double CalculateLength(double startParamU, double endParamU)
 {
     if (Curves.Length == 1)
     {
         return(Curves.First().GetLength3(startParamU, endParamU));
     }
     else
     {
         throw new Exception("Only single curve is supported");
     }
 }
예제 #3
0
 public double CalculateUParameter(Point point)
 {
     if (Curves.Length == 1)
     {
         return(Curves.First().ReverseEvaluate(point.X, point.Y, point.Z));
     }
     else
     {
         throw new Exception("Only single curve is supported");
     }
 }
예제 #4
0
        protected virtual IXPoint GetPoint(bool isStart)
        {
            var curve = isStart ? Curves.First() : Curves.Last();

            if (curve.IsTrimmedCurve())
            {
                if (curve.GetEndParams(out double start, out double end, out _, out _))
                {
                    var pt = curve.Evaluate2(isStart ? start : end, 1) as double[];
                    return(new SwPoint()
                    {
                        Coordinate = new Point(pt[0], pt[1], pt[2])
                    });
                }
                else
                {
                    throw new Exception("Failed to get end parameters of curve");
                }
            }
            else
            {
                throw new NotSupportedException("Only trimmed curves are supported");
            }
        }