https://github.com/lancelet/capstan
NURBS curves and surfaces in Rust (EARLY WIP!)
https://github.com/lancelet/capstan
Last synced: 9 months ago
JSON representation
NURBS curves and surfaces in Rust (EARLY WIP!)
- Host: GitHub
- URL: https://github.com/lancelet/capstan
- Owner: lancelet
- License: mit
- Created: 2020-10-04T04:32:05.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-23T19:08:22.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T12:04:40.013Z (9 months ago)
- Language: Rust
- Size: 38.1 KB
- Stars: 22
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Capstan

[](https://codecov.io/gh/lancelet/capstan)
[](https://crates.io/crates/capstan)
[](https://docs.rs/capstan)
[](https://opensource.org/licenses/MIT)
NURBS utilities in Rust.
## NURBS Curve Evaluation
Currently, only NURBS curve evaluation is complete. The evaluation uses a
naive version of the de Boor algorithm. With this, it's possible to evaluate
the 3D coordinates of a NURBS curve at any parameter value.
NURBS can represent conics with floating-point precision. This image shows a
tesselated NURBS circle on the left and an SVG circle on the right:

NURBS are a generalization of Bézier curves, so they can exactly represent any
order of Bézier curve. The image below shows an SVG cubic Bézier with a loop on
the right and a tesselated NURBS representation on the left:

NURBS can represent multiple Bézier curve segments in a single curve. The
example below shows an outline of the Egyptian "reed leaf" hieroglyph
(Gardiner sign M17). This curve is constructed from 2 line segments and 4
cubic Bézier curves, all of which can be represented as a single closed
NURBS curve:

## NURBS Curve Representation
The library uses the "Rhino" form of NURBS curves, where there are two fewer
knots than in "traditional" NURBS.