예제 #1
0
파일: BSplineD.cs 프로젝트: 15831944/WW
 public BSplineD(int power, int controlPointCount, bool closed)
 {
     this.int_0      = power;
     this.KnotValues = BSplineD.CreateDefaultKnotValues(power, controlPointCount, closed);
     this.double_1   = new double[power + 1];
     this.double_2   = new double[power + 1];
     this.double_3   = this.double_0[power];
     this.double_4   = this.double_0[this.double_0.Length - power - 1];
 }
예제 #2
0
        public SplineCurve3D(int degree, double[] knots, Vector4D[] controlPoints)
        {
            this.bsplineD_0 = new BSplineD(degree, knots);
            this.point3D_0  = new Point3D[controlPoints.Length];
            this.double_0   = new double[controlPoints.Length];
            bool flag = false;

            for (int index = controlPoints.Length - 1; index >= 0; --index)
            {
                Vector4D controlPoint = controlPoints[index];
                this.point3D_0[index] = new Point3D(controlPoint.X, controlPoint.Y, controlPoint.Z);
                double w = controlPoint.W;
                this.double_0[index] = w;
                flag = flag || w != 1.0;
            }
            if (flag)
            {
                return;
            }
            this.double_0 = (double[])null;
        }
예제 #3
0
 public SplineCurve3D(int degree, double[] knots, Point3D[] controlPoints, double[] weights)
 {
     this.bsplineD_0 = new BSplineD(degree, knots);
     this.point3D_0  = controlPoints;
     if (weights != null)
     {
         bool flag = false;
         foreach (double weight in weights)
         {
             if (weight != 1.0)
             {
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             this.double_0 = weights;
             return;
         }
     }
     this.double_0 = weights;
 }