Esempio n. 1
0
 /// <summary>
 ///     Initializes a new instance of <see cref="NurbsCurve" /> by it's control points and degree.
 /// </summary>
 /// <param name="controlPoints">The control points to create the curve with.</param>
 /// <param name="degree">The desired degree of the curve. Degree cannot be > (ControlPoints - 1)</param>
 public NurbsCurve(List <Point4d> controlPoints, int degree)
 {
     this.ControlPoints = controlPoints;
     this.Knots         = NurbsCalculator.CreateUniformKnotVector(controlPoints.Count, degree)
                          .ToList();
     this.Degree = degree;
 }
Esempio n. 2
0
        /// <summary>
        ///     Initializes a new instance of <see cref="NurbsSurface" /> by it's control points and degrees.
        /// </summary>
        /// <param name="controlPoints">Grid of control points for the surface.</param>
        /// <param name="degreeU">Degree of the surface in the U direction.</param>
        /// <param name="degreeV">Degree of the surface in the V direction.</param>
        public NurbsSurface(Matrix <Point4d> controlPoints, int degreeU, int degreeV)
        {
            this.ControlPoints = controlPoints;

            this.DegreeU = degreeU;
            this.DegreeV = degreeV;

            this.KnotsU = NurbsCalculator
                          .CreateUniformKnotVector(this.ControlPoints.N, this.DegreeU)
                          .ToList();
            this.KnotsV = NurbsCalculator
                          .CreateUniformKnotVector(this.ControlPoints.M, this.DegreeV)
                          .ToList();
        }