A really simple NURBS library based on libigl. libigl is a simple C++ geometry processing library, and I use it mainly for displaying the NURBS curve and surface.
Existing functions:
- compute points on curve or surface with parameters
- display NURBS curve and surface by libigl
to be continued:
- readIO and writeIO
- knot insertion and knot removal
- degree elevation and degree reduction
- NURBS curve and surface fitting
- T-Spline (it's hard ...)
This project's cmake structure is from libigl/libigl-example-project, which is a blank project example showing how to use libigl and cmake.
Then build, run and understand the libigl tutorial.
After downloading and installing libigl, you need to add the Path of libigl to this project by modifying FindLIBIGL.cmake
find_path(LIBIGL_INCLUDE_DIR igl/readOBJ.h
HINTS
ENV LIBIGL
ENV LIBIGLROOT
ENV LIBIGL_ROOT
ENV LIBIGL_DIR
PATHS
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/libigl
${CMAKE_SOURCE_DIR}/../libigl
${CMAKE_SOURCE_DIR}/../../libigl
D:/Program\ Files/libigl # you can add the path like this
/usr
/usr/local
/usr/local/igl/libigl
PATH_SUFFIXES include
)
Compile this project using the standard cmake routine:
mkdir build
cd build
cmake ..
make
This should find and build the dependencies and create a NURBS_bin
binary.
From within the build
directory just issue:
./NURBS_bin
A glfw app should launch displaying a Torus surface.