8000 GitHub - ericztoa/NURBS-Python at 3.x
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ericztoa/NURBS-Python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NURBS-Python

DOI

PYPI RTD TRAVISCI APPVEYOR WAFFLEIO

Introduction

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.

Implementation

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 details on how to use the library: https://nurbs-python.readthedocs.io/en/3.x/

Examples

The Examples repository contains example scripts describing how to use NURBS-Python with advanced visualization examples. Please see the documentation for more details.

Citing NURBS-Python

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

Features

NURBS-Python consists of the following modules:

  • Core library
  • Multi module
  • Exchange module
  • Visualization module

In addition, it also contains the following experimental components:

  • Matplotlib visualization component
  • Shapes component

Core Library

The core library contains 4 modules:

  • geomdl.BSpline contains Non-Uniform B-Spline (NUBS) evaluation and storage functionality
  • geomdl.NURBS contains Non-Uniform Rational B-Spline (NURBS) evaluation and storage functionality
  • geomdl.CPGen contains simple control points grid generation algorithms
  • geomdl.utilities contains helper functions for generating and altering knot vectors and control points

geomdl.BSpline and geomdl.NURBS modules contain the following classes:

  • Curve for evaluating curves (in any dimension)
  • Surface for evaluating surfaces

geomdl.CPGen module contains 2 classes for grid generation:

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

Starting from version 3.2, NURBS-Python provides abstract Curve and Surface base classes with geomdl.Abstract module.

Multi Module

NURBS-Python provides container-like classes for visualization of multiple curves and surfaces with geomdl.Multi module. Please see the documentation for details.

Exchange Module

NURBS-Python can export Surface types in OBJ and STL format using geomdl.exchange module. This module contains 2 major functions:

  • save_obj() for saving surfaces as .obj files
  • save_stl() for saving surfaces as .stl files in ascii or binary format (default is binary)

Visualization Module

NURBS-Python provides a visualization module, geomdl.VisBase to serve as a basis for all possible visualization components, such as OpenGL, for plotting 2D/3D curves and surfaces directly using render() method.

NURBS-Python comes with an experimental visualization component, geomdl.visualization which implements Matplotlib. This component provides a variety of visualization options for surfaces and 2D/3D curves.

Shapes Component

Starting from NURBS-Python v3.1, a new experimental component geomdl.shapes is shipped with the NURBS-Python package. The aim of this component is providing an easy way to generate the most common curves and surfaces, such as circles and cylinders.

Installation

Using Pip

You can find the NURBS-Python library on Python Package Index and install using the following command:

pip install NURBS-Python

Manual Method

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 (e.g. extension development or bug fixing), you can run

python setup.py develop

from the command line to generate a link to the package directory inside site-packages.

Testing

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.

Branch Information

  • 3.x branch contains code for NURBS-Python v3.x series
  • 2.x branch contains 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.

Issues and Reporting

Contributions to NURBS-Python

All contributions to NURBS-Python are welcomed. I would recommend you reading CONTRIBUTING file for more details.

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.

About

Object-oriented pure Python B-Spline and NURBS library

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.3%
  • Dockerfile 1.5%
  • Shell 0.2%
0