Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

TP3 : B-splines, De Boor's algorithm



In this TP, you'll implement the De Boor's algorithm for computation of B-spline curves.

cd GeoNum2017/
git pull

or, if you don't have the local repo

git clone


cd TP3/

As before, you can pass dataname and density parameters directly as command line args.

python [simple,spiral,circle,camel]  [sampling_density]
python [circle7,circle9]  [sampling_density] nurbs
# example
python spiral 24

If specified, the last argument tells the program to compute NURBS (circle7.nurbs or circle9.nurbs).


  • ReadBSpline : helper function to read B-spline control points and knots from a file.
  • DeBoor : perform the De Boor algorithm.
  • main part : evaluation and plotting.


  1. Implement the De Boor's algorithm.
  2. Evaluate B-spline for the simple dataset. Modify the knot vector and recompute. What changed?
  3. Evaluate B-spline for the spiral dataset. Modify the knot vector to 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5. What changed?
  4. Evaluate B-spline for the camel dataset. Move the front leg by changing the x-coordinate of the last control point to -1.5. Which segments of the curve have changed? Why?
  5. Modify your code to work in homogeneous coordinates (if dim=3).
  6. Evaluate circle9.nurbs and circle7.nurbs. Compare the results with circle.bspline.
You can’t perform that action at this time.