public NurbsCurve(ICurveParam curveParam) { if (canDrawCurve(curveParam)) { canDraw = true; this.curveParam = (NurbsCurveParam)curveParam; } }
public void DrawNURBSCurve(string curveName, string degree, string cutList, string weightList) { BaseDataPointList pointList = this.basePoints; ArrayString aString = new ArrayString(cutList); List<DoubleExtension> cutPoints = null, weightValues = null; if (!aString.TryParseDoubleExtension(out cutPoints)) { throw new ArgumentException("The cutList contains unrecognised string: " + cutList, "cutList"); } aString = new ArrayString(weightList); if (!aString.TryParseDoubleExtension(out weightValues)) { throw new ArgumentException("The weightList contains unrecognised string: " + weightList, "weightList"); } int degreeInt = 0; if (!Int32.TryParse(degree, out degreeInt)) { throw new ArgumentException("The degree is not a integer string: " + degree, "degree"); } if (degreeInt < 1) { throw new ArgumentException("The degree is invalid: " + degree, "degree"); } NurbsCurveParam curveParam = new NurbsCurveParam(pointList.Points, degreeInt, cutPoints, weightValues); NurbsCurve curve = new NurbsCurve(curveParam); DrawLines(curveName, curve.sampleCurvePoints()); }
public NurbsParametricCurveElement(NurbsCurveParam curveParam) : base(curveParam) { this.weights = curveParam.Weight; }
public NurbsCurveInterpolatedData(NurbsCurveParam curveParam) : base(curveParam) { this.curveParam = curveParam; InitialCurve(curveParam); }