Hello everyone,
I’d like to announce a package I’ve been working on as a passion project for the past few weeks: SplineGrids.jl:
- Repo: SouthEndMusic/SplineGrids.jl: Evaluating splines of arbitrary dimensionality on a grid.
- Docs: SplineGrids.jl · SplineGrids.jl
What
SplineGrids.jl is designed to efficiently evaluate a broad class of spline objects on a grid in the spline’s domain. The package supports:
- Any number of input and output dimensions (see the examples here)
- Any degree of basis functions and type of knot vector
- Using weights to define NURBS (see an example here)
- Any combination of partial derivatives (not for NURBS, coming up) (see an example here)
- Local refinement (coming up)
- CPU and GPU backends via KernelAbstractions.jl (tested with
CUDABackend
)
The intended use case of this package is to be integrated into the SciML ecosystem, for easy and efficient incorporation of spline geometries in problems of fitting, optimization, differential equation solving (isogeometric analysis?) and machine learning. Since SplineGrids.jl makes heavy use of in-place computations, the recommended automatic differentiation framework to use with SplineGrids.jl is Enzyme.
Background
This package was inspired by research I did on lens design with differentiable ray-tracing a few years ago, see the repo README for more details on that.
Why a new spline package?
There already are several spline packages for Julia, here’s an undoubtedly incomplete list:
- sp94/CubicSplines.jl: Cubic splines for Julia
- jipolanco/BSplineKit.jl: A collection of B-spline tools in Julia
- HoBeZwe/NURBS.jl: This package provides functionality to define and evaluate B-spline and NURBS (non-uniform rational B-spline) basis functions, their derivatives, as well as curves and surfaces based on both considered basis functions.
- hyrodium/BasicBSpline.jl: Basic (mathematical) operations for B-spline functions and related things with julia
What I think make this new package stand out are:
- The
KernelAbstractions.jl
backend for efficient parallelism - The flexibility in input and output dimensionality
- The efficient grid evaluation
- Local refinement support (coming up)
A note on grid evaluation
The grid evaluation is quite fundamental to this package. Evaluating the geometry at arbitrary points is not a priority, but might be added down the road as a convenience.
Roadmap
I’m currently working out local refinement and an issue with Enzyme when using CUDABackend
. After that I’ll register the package.
I’d love to hear what you think of this package and how it can be made more useful for your usecase!