NurbsSharp 0.4.0
See the version list below for details.
dotnet add package NurbsSharp --version 0.4.0
NuGet\Install-Package NurbsSharp -Version 0.4.0
<PackageReference Include="NurbsSharp" Version="0.4.0" />
<PackageVersion Include="NurbsSharp" Version="0.4.0" />
<PackageReference Include="NurbsSharp" />
paket add NurbsSharp --version 0.4.0
#r "nuget: NurbsSharp, 0.4.0"
#:package NurbsSharp@0.4.0
#addin nuget:?package=NurbsSharp&version=0.4.0
#tool nuget:?package=NurbsSharp&version=0.4.0
NURBS Sharp
NURBS Sharp is a small, dependency-free NURBS (Non-Uniform Rational B-Spline) library for .NET. It provides data structures, evaluators, topology operators, I/O and tessellation utilities implemented using only the .NET standard library.
<img width="800" height="800" alt="test" src="https://github.com/user-attachments/assets/b92a4e5e-70df-49f0-bcd7-7ba1030fb881" />
Table of Contents
Features
- Generation and evaluation of NURBS curves, surfaces and volumes
- Topology operators: degree elevation/reduction, knot insertion/removal/refinement, join/split
- Generation capabilities: interpolation, least squares approximation, primitive shapes
- Analysis utilities: curve length, arc-length parameterization/sampling, closest points, curvature, normals and curve continuity
- Transformations for curves, surfaces and volumes: translation, rotation, scaling and transformation matrices
- Intersection calculations: Ray-Box, Ray-Mesh, Ray-Surface, Curve-Curve, Curve-Surface, Surface-Surface, Surface-Plane
- IO helpers:
- Mesh only: OBJ/STL export, simple BMP export
- NURBS only: IGES import/export (Point, Curve, Surface entities supported)
- Tessellation utilities for curves and surfaces
- Targets: .NET 8 and .NET Standard 2.1
Limitations
- Viewer: This library does not include a 3D model viewer. To inspect model details, a 3D rendering library or file export is required.
- NURBS Surface:
TrimSurfaceis not yet implemented. - Knot Vector: Currently, only "Clamped" knot vectors are supported (multiplicity = degree + 1).
- IGES Support:
- Import: Only supports Entity Type 126 (Rational B-spline curve), and 128 (Rational B-spline surface).
- Export: Only supports Point and NURBS entities. Mesh export is not supported.
- Mesh Export (OBJ/STL): Only supports Mesh objects. Direct export from NURBS is not supported (tessellation required).
- Intersection Calculations:
- The current state may be unstable due to its dependence on initial conditions.
- Isolated tangent contacts in surface-plane intersections are not reliably classified as curve intersections.
Installation
Install via NuGet:
dotnet add package NurbsSharp
Or add the package reference to your project file.
Quick Start
Basic usage (C#):
using System;
using NurbsSharp.Core;
using NurbsSharp.Geometry;
// Create a NURBS surface and evaluate a point
int degreeU = 1, degreeV = 1;
var kvU = new KnotVector(new[] { 0.0, 0.0, 1.0, 1.0 }, degreeU);
var kvV = new KnotVector(new[] { 0.0, 0.0, 1.0, 1.0 }, degreeV);
// Build control points (u x v grid)
var controlPoints = new[] {
new[] {
new ControlPoint(0.0, 0.0, 0.0, 1.0),
new ControlPoint(0.0, 1.0, 0.0, 1.0)
},
new[] {
new ControlPoint(1.0, 0.0, 0.0, 1.0),
new ControlPoint(1.0, 1.0, 1.0, 1.0)
}
};
var surface = new NurbsSurface(degreeU, degreeV, kvU, kvV, controlPoints);
var point = surface.GetPos(0.5, 0.5);
Console.WriteLine(point);
Examples
tessellate a surface and export to STL:
int divideN = 20;
var mesh = SurfaceTessellator.Tessellate(surface, divideN, divideN);
using (var fs = new FileStream("test_output.stl", FileMode.Create, FileAccess.Write))
{
await STLExporter.ExportAsync(mesh, fs);
}
Examples Project: https://github.com/nyarurato/NurbsSharpSample
Github Wiki: https://github.com/nyarurato/NurbsSharp/wiki/Samples
Documentation
API Docs: https://nyarurato.github.io/NurbsSharp/
Development
Clone the repo and build locally:
dotnet restore
dotnet build -c Debug
Run unit tests:
dotnet test -c Debug
Project layout highlights:
src/Core— numeric helpers and core types (BoundingBox,Ray,KnotVector,LinAlg, etc.)src/Geometry—NurbsCurve,NurbsSurface,NurbsVolume,Mesh, etc.src/Evaluation— evaluators (curve/surface/volume)src/Operation— topology operators (degree, knot, join, split, surface operators)src/Generation— interpolation, least squares approximation, primitive shape generationsrc/Intersection— intersection calculations (Ray-Box, Ray-Mesh, Curve-Curve, Curve-Surface, BVH structures)src/IO—OBJExporter,STLExporter,BMPExporter, IGES import/exportsrc/Tesselation— tessellation (curve/surface)src/Analysis- analyzers (curvature, curve length, etc.)
Contributing
Contributions are welcome. Typical workflow:
- Fork the repository
- Create a branch with a descriptive name
- Add tests for new behavior where appropriate
- Open a pull request against
master
Acknowledgements
This project was significantly influenced by Kodatuno and geomdl (NURBS-Python) during its early stages.
The design and algorithms of these projects provided substantial inspiration for the data structures and evaluation logic design of this library.
We extend our gratitude to the maintainers and contributors of both projects.
- Kodatuno: http://www-mm.hm.t.kanazawa-u.ac.jp/research/kodatuno/
- geomdl (NURBS-Python): https://github.com/orbingol/NURBS-Python
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.0 | 167 | 9/21/2026 |
| 0.5.0 | 109 | 9/19/2026 |
| 0.4.0 | 113 | 9/16/2026 |
| 0.3.0 | 492 | 12/12/2025 |
| 0.2.0 | 556 | 12/1/2025 |
| 0.1.1 | 258 | 11/25/2025 |
| 0.1.0 | 420 | 11/21/2025 |
| 0.0.1-beta5 | 464 | 11/19/2025 |
| 0.0.1-beta4 | 457 | 11/18/2025 |
| 0.0.1-beta3 | 366 | 11/17/2025 |
| 0.0.1-beta2 | 316 | 11/14/2025 |
| 0.0.1-beta | 323 | 11/14/2025 |