1. 程式人生 > >使用Mathematica繪製NURBS曲線

使用Mathematica繪製NURBS曲線

在Mathematica軟體中,使用函式BSplineCurve來根據控制頂點繪製NURBS曲線。

BSplineCurve的預設選項有如下:

  • By default, BSplineCurve uses cubic splines;
  • By default, knots are chosen uniformly in parameter space, with additional knots added so that the curve starts at the first control point and ends at the last one;
  • With the default setting SplineWeights->Automatic, all control points are chosen to have equal weights, corresponding to a polynomial B-spline curve;

基本例項:

Basic Example

圓的NURBS曲線表示:

不同節點向量和權因子的情況:

NURBS Circle 1

情況2:

NURBS Circle 2

使用軟體可對書中的理論進行驗證,加深對知識點的理解。