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.

TP7 : B-spline surfaces

Update: OpenGL

The problems with OpenGL and GLFW should be resolved with the updated — don't forget to put the dot . before the command.

cd GeoNum2017/
git pull

This will download and compile PyOpenGL, PyGLFW and GLFW (as a static library). The* files are automatically copied to repo's root dir. For the viewer to function properly, python scripts need to be executed from the root dir.

# test the viewer
python viewer/
# test TP7
python TP7/

Moreover, the $PYTHONPATH needs to be set up everytime you open the terminal by executing preceded by the dot.


You can echo the path to see if it's been set correctly.


Functions to modify

  • DeBoorSurf : recursively implement De Boor's algorithm for surfaces.
  • main part : for each patch of the B-spline surface, evaluate surface points by calling DeBoorSurf in a double loop.


  1. Implement evaluation of B-spline surfaces. Test with the provided datasets (simple.bspline and torus.bspline).
  2. Modify the knot vectors for the simple dataset. Experiment with various configurations. How does the surface change?
  3. [Bonus] NURBS surfaces can be used to represent the unit sphere, the same way we used NURBS curves to represent the unit circle in TP3. Modify your implementation of B-spline surfaces to compute NURBS surfaces. Test with the hemisphere (hemi.nurbs) and the modified torus (torus.nurbs).
    Note: full sphere control points, weights, and knots can be found in Representing a Circle or a Sphere with NURBS by David Eberly.
You can’t perform that action at this time.