This project aims to implement Non-Uniform Rational B-Spline (NURBS) curve and surface computation algorithms in native Python with minimum possible dependencies. The library is fully object-oriented and does not depend on any external C/C++ libraries.
The package contains 4 modules:
geomdl.BSplinecontains Non-Uniform B-Spline (NUBS) evaluation and storage functionalitygeomdl.NURBScontains Non-Uniform Rational B-Spline (NURBS) evaluation and storage functionalitygeomdl.CPGencontains simple control points grid generation algorithmsgeomdl.utilitiescontains helper functions for generating and manipulating knot vectors and control points
geomdl.BSpline and geomdl.NURBS modules contain 3 classes for geometric evaluation:
- Curve for evaluating 3D curves
- Curve2D for evaluating 2D curves
- Surface for evaluating surfaces
geomdl.CPGen module contains 2 classes for grid generation:
- Grid for generating inputs for
geomdl.BSpline.Surfaceclass - GridWeighted for generating inputs for
geomdl.NURBS.Surfaceclass
The package also contains an experimental visualization module for plotting generated curves and surfaces. Please see the Examples repository for more details on how to use NURBS-Python and example scripts.
I would be glad if you cite this repository using the DOI provided as a badge at the top.
masterbranch contains the latest version of NURBS-Python (currently v3.x series).2.xbranch contains the code for NURBS-Python v2.x series.
There are some API changes between v2.x and v3.x series and all updates will be added to the latest version. Old versions won't be receiving any new features and updates.
You can find the NURBS-Python library on Python Package Index and install using the following command:
pip install NURBS-Python
Included setup.py script will take care of the installation and automatically copy the required files to site-packages directory. Please run the following from the command line:
python setup.py install
If you don't want to put the files into your Python distribution's site-packages directory for some reason, you can run
python setup.py develop
from the command line to generate a link to the package directory inside site-packages.
tests/ directory contains the testing scripts. In order to execute the tests which comes with NURBS-Python, you need to install pytest on your Python distribution. After installing the required packages, execute the following from your favorite IDE or from the command line:
pytest
pytest will automatically find the tests under tests/ directory, execute them and show the results.
The Examples repository contains example scripts extensively describing how to use NURBS-Python with advanced visualization examples. Please check the documentation for more details.
NURBS-Python is a high-level Python library following the object-oriented design principles. In its core, it implements the algorithms from The NURBS Book (2nd Edition) by Piegl & Tiller and combines these algorithms with other useful features. Please see the documentation for function reference and how to use the library: http://nurbs-python.rtfd.org
Please use the issue tracker for reporting bugs and other related issues.
If you have any questions or comments related to the NURBS-Python package, please don't hesitate to contact the developers by email.
- Onur Rauf Bingol (@orbingol)
I would like to thank all contributors for their help and support in testing, bug fixing and improvement of the NURBS-Python project.
- Luke Frisken (@kellpossible)
- John-Eric Dufour (@jedufour)
- Jan Heczko (@heczis)
NURBS-Python is licensed under The MIT License.
I would like to thank my PhD adviser, Dr. Adarsh Krishnamurthy, for his guidance and supervision throughout the course of this project.