Skip to main content

Library for manipulating and rendering non-uniform b-splines

Project description

BSpy

Library for manipulating and rendering B-spline curves, surfaces, and multidimensional manifolds with non-uniform knots in each dimension.

The Spline class has a method to fit multidimensional data for scalar and vector functions of single and multiple variables. It also has methods to create points, lines, circular arcs, spheres, tori, ruled surfaces, surfaces of revolution, and four-sided patches. Other methods add, subtract, multiply, and linearly transform splines, as well as confine spline curves to a given range. There are methods to evaluate spline values, derivatives, integrals, normals, curvature, and the Jacobian, as well as methods that return spline representations of derivatives, normals, integrals, graphs, and convolutions. In addition, there are methods to manipulate the domain of splines, including trim, join, reparametrize, transpose, reverse, add and remove knots, elevate and extrapolate, and fold and unfold. Finally, there are methods to compute the zeros and contours of a spline and to intersect two splines.

The SplineOpenGLFrame class is an OpenGLFrame with custom shaders to render spline curves and surfaces.

The DrawableSpline class converts a Spline to a curve, surface, or solid that can be drawn in a SplineOpenGLFrame. Only 1D, 2D, and 3D splines can be converted. Spline surfaces and solids with more than 3 dependent variables will have their added dimensions rendered as colors (up to 6 dependent variables are supported).

The bspyApp class is a tkinter.Tk app that hosts a SplineOpenGLFrame, a listbox full of splines, and a set of controls to adjust and view the selected splines.

The bspyGraphics class is a graphics engine to display splines. It launches a bspyApp and issues commands to the app for use in jupyter notebooks and other scripting environments.

bspyApp rendering the Utah teapot

The full documentation for BSpy can be found here, its GitHub project can be found here, a test suite can be found here, and a set of examples, including a jupyter notebook, can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bspy-2.2.2.tar.gz (86.3 kB view hashes)

Uploaded Source

Built Distribution

bspy-2.2.2-py3-none-any.whl (75.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page