Skip to content

orbingol/NURBS-Python

Repository files navigation

B-Spline and NURBS Evaluation Library

DOI RTFD

Introduction

This project implements Non-Uniform Rational B-Spline (NURBS) curve and surface computation algorithms in native Python with minimum possible dependencies. The package contains 3 modules:

  • BSpline contains Non-Uniform B-Spline (NUBS) algorithms
  • NURBS contains Non-Uniform Rational B-Spline (NURBS) algorithms
  • CPGen contains simple control points grid generation algorithms

BSpline and NURBS modules contain 3 classes for geometric evaluation:

  • Curve for evaluating 3D curves
  • Curve2D for evaluating 2D curves
  • Surface for evaluating surfaces

CPGen module contains 2 classes for grid generation:

  • Grid for generating inputs for BSpline.Surface class
  • GridWeighted for generating inputs for NURBS.Surface class

Information for Researchers

I would be glad if you cite this repository using the DOI provided as a badge at the top.

Installation

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.

Example Scripts

Please see NURBS-Python Examples repository for examples.

Algorithms Implemented

NURBS-Python currently implements the following algorithms from The NURBS Book (2nd Edition) by Piegl & Tiller:

  • Algorithm A2.1: FindSpan (page 68)
  • Algorithm A2.2: BasisFuns (page 70)
  • Algorithm A2.3: DersBasisFuns (pages 72,73)
  • Algorithm A3.1: CurvePoint (page 82)
  • Algorithm A3.2: CurveDerivsAlg1 (page 93)
  • Algorithm A3.3: CurveDerivCpts (page 98)
  • Algorithm A3.4: CurveDerivsAlg2 (pages 99,100)
  • Algorithm A3.5: SurfacePoint (page 103)
  • Algorithm A3.6: SurfaceDerivsAlg1 (pages 111,112)
  • Algorithm A4.1: CurvePoint (page 124)
  • Algorithm A4.2: RatCurveDerivs (page 127)
  • Algorithm A4.3: SurfacePoint (page 134)
  • Algorithm A4.4: RatSurfaceDerivs (pages 137,138)
  • Algorithm A5.1: CurveKnotIns (page 151)
  • Algorithm A5.3: SurfaceKnotIns (pages 155-157)

Issues and Reporting

Bugs and Issues

Please use the issue tracker for reporting bugs and other related issues.

Comments and Questions

If you have any questions or comments related to the NURBS-Python package, please don't hesitate to contact the developers by email.

Author

Contributors

I would like to thank all contributors for their help and support in testing, bug fixing and improvement of the NURBS-Python project.

License

NURBS-Python is licensed under The MIT License.

Acknowledgments

I would like to thank my PhD adviser, Dr. Adarsh Krishnamurthy , for his guidance and supervision throughout the course of this project.