Questions tagged [bspline]

A B-spline (basis spline) is the generalization of the Bézier curve which has minimal support with respect to a given degree, smoothness, and domain partition.

A B-spline (basis spline) is the generalization of the Bézier curve which has minimal support with respect to a given degree, smoothness, and domain partition.

190 questions
17
votes
2 answers

Fast b-spline algorithm with numpy/scipy

I need to compute bspline curves in python. I looked into scipy.interpolate.splprep and a few other scipy modules but couldn't find anything that readily gave me what I needed. So i wrote my own module below. The code works fine, but it is slow…
Fnord
  • 5,365
  • 4
  • 31
  • 48
16
votes
3 answers

B-spline interpolation with Python

I am trying to reproduce a Mathematica example for a B-spline with Python. The code of the mathematica example reads pts = {{0, 0}, {0, 2}, {2, 3}, {4, 0}, {6, 3}, {8, 2}, {8, 0}}; Graphics[{BSplineCurve[pts, SplineKnots -> {0, 0, 0, 0, 2, 3, 4, 6,…
zeus300
  • 1,017
  • 2
  • 12
  • 30
15
votes
2 answers

interpretation of the output of R function bs() (B-spline basis matrix)

I often use B-splines for regression. Up to now I've never needed to understand the output of bs in detail: I would just choose the model I was interested in, and fit it with lm. However, I now need to reproduce a b-spline model in an external…
DeltaIV
  • 4,773
  • 12
  • 39
  • 86
11
votes
2 answers

How to interpret lm() coefficient estimates when using bs() function for splines

I'm using a set of points which go from (-5,5) to (0,0) and (5,5) in a "symmetric V-shape". I'm fitting a model with lm() and the bs() function to fit a "V-shape" spline: lm(formula = y ~ bs(x, degree = 1, knots = c(0))) I get the "V-shape" when I…
PDG
  • 287
  • 1
  • 3
  • 14
10
votes
3 answers

scipy BSpline fitting in python

This is my first time using BSpline, and I want to fit a curve to my data points. I've tried using Univariate Spline and attempted to use splev and splrep but I'd really like to learn how to do this using BSpline. It looks like my fitting is really…
Sophia Medallon
  • 103
  • 1
  • 1
  • 4
10
votes
1 answer

Implementing De Boors algorithm for finding points on a B-spline

I've been working on this for several weeks but have been unable to get my algorithm working properly and i'm at my wits end. Here's an illustration of what i have achieved: If everything was working i would expect a perfect circle/oval at the…
Holly
  • 1,956
  • 6
  • 41
  • 57
8
votes
2 answers

B-Spline derivative using de Boor's algorithm

Wikipedia gives us a Python implementation for the de Boor's algorithm: def deBoor(k, x, t, c, p): """ Evaluates S(x). Args ---- k: index of knot interval that contains x x: position t: array of knot positions, needs to…
paceholder
  • 1,064
  • 1
  • 10
  • 21
8
votes
1 answer

Using GNU Scientific Library (GSL) to draw a 2D B-Spline path using unevenly spaced points

I'm trying to using the GNU Scientific Library (GSL) to draw a smooth path from A to B. I'm using an API that returns a small number (8 in this case) of irregularly spaced points (in red), that you can see in the following picture: The purple…
Michael J Petrie
  • 183
  • 4
  • 13
7
votes
2 answers

Interactive BSpline fitting in Python

Using the following function, one can fit a cubic spline on input points P: def plotCurve(P): pts = np.vstack([P, P[0]]) x, y = pts.T i = np.arange(len(pts)) interp_i = np.linspace(0, i.max(), 100000 * i.max()) xi = interp1d(i, x,…
snelzb
  • 157
  • 3
  • 16
7
votes
1 answer

Cubic spline method for longitudinal series data?

I have a serial data formatted as follows: time milk Animal_ID 30 25.6 1 31 27.2 1 32 24.4 1 33 17.4 1 34 33.6 1 35 25.4 1 33 29.4 2 34 25.4 2 35 24.7 2 36 27.4 …
hieu
  • 135
  • 3
  • 11
7
votes
2 answers

Obtain spline surface on R

How do I generate a b-spline surface, let's say: x=attitude$rating y=attitude$complaints z=attitude$privileges would be x and y for the spline basis. z is the set of control points.
user3083324
  • 585
  • 8
  • 23
6
votes
1 answer

Calculating B spline basis in Matlab in the same way as R's bs() function

I am on the lookout for (an ideally inbuilt) function in Matlab that calculates a B spline basis matrix the same way as in R, e.g. for a spline basis with 20 equally spaced knots of degree 3, I would do in R require(splines) B = bs(x =…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
5
votes
1 answer

Find the center of Curvature of a point on 3D b-spline using nurbs / geomdl in python

Once again I am in over my head so please bear with me. I have a B-spline (imported from Solidworks) that I can analyze with geomdl in python. From geomdl I can extract the first and second derivatives as well as the tangent, normal, and binormal…
Burtski
  • 451
  • 5
  • 19
5
votes
2 answers

How to extract the underlying coefficients from fitting a linear b spline regression in R?

Take for instance the following one-knot, degree one, spline: library(splines) library(ISLR) age.grid = seq(range(Wage$age)[1], range(Wage$age)[2]) fit.spline = lm(wage~bs(age, knots=c(30), degree=1), data=Wage) pred.spline =…
JasonAizkalns
  • 20,243
  • 8
  • 57
  • 116
5
votes
2 answers

What's the main difference between B-Rep and Mesh index represation

I know B-Rep (ParaSolid) is the popular solid representation. From my past experience, I always touch the triangle mesh representation like OBJ, STL file format. I am wondering why B-Rep is better than mesh representation? What's the main…
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
1
2 3
12 13