# Questions tagged [splines]

Questions on the spline-related functions of Mathematica (BezierCurve[], BSplineCurve[], etc.), or related to the theory and use of splines in Mathematica.

156 questions
Filter by
Sorted by
Tagged with
85 views

### Using ImageGraphics in Mathematica [closed]

As a followup to my post here, I'd like to smooth the output of the image obtained from ImageGraphics. Input image is the following ...
60 views

### What are the automatic settings of a BSplineCurve object?

Consider the following object: spline = BSplineCurve[{{0,1}, {1,1}, {0,1}, {-1,1}, {-1,0}}, SplineClosed->True]; Graphics[spline] What would be an equivalent <...
54 views

### How to fit a spline (not interpolate) through points in 3D?

I have coordinates of points in 3D and want to fit a spline through these points. I found a least square approach for 2D case: https://demonstrations.wolfram.com/...
88 views

### Find optimal BezierFunction

For a given set of points (examplary quadrant) n = 5; (* number of inner points*) p = Table[{Cos[φ], Sin[φ]}, {φ, Join[{0}, RandomReal[{0, Pi/2}, n], {Pi/2}]}]; ...
142 views

### How to fit spline through points in $\mathbb{R}^3$?

I have coordinates of points that represent a curve (for example, helix or centerline of moebius strip) in $\mathbb{R^3}$. I want to fit a Bspline through these points. How to do this in Mathematica? ...
61 views

### How to construct BezierFunction for BezierCurve with npts>4 and SplineDegree -> 3?

I would like to use BezierCurve with npts=7 and SplineDegree -> 3 and access its BezierFunction. This code helps: ...
154 views

### Why does BezierFunction not follow BezierCurve at npts>4?

This example: ...
67 views

### How to obtain the function of a plotted Bezier curve?

I have some control points and I could just plot the Bezier curve, but I also need to have the function! How can I get the exact function of the plotted Bezier curve?
66 views

### elegant definition of piecewise linear functions (spline)

As far as I understand, the Spline object is the result of some approximation or interpolation, it is not for directly defining functions. That's a pity, as that ...
56 views

### BSpline vs natural spline [closed]

The BSpline in mathematica is defined mathematically here. These BSplines constitute basis for any Spline. But how do I define natural splines in mathematica, i.e. splines that are linear left of the ...
28 views

### Help with evaluation of the differential of a BSplineFunction?

It can be useful to generate a smooth random function over $[-L,L]$ with BSplineFunction: ...
51 views

### Function from a Curve

i would like to ask if it's possible to get a function from a B-spline curve besides 'InterpolatingPolynomial[]' . i'm trying to use the function to compute volume for the curve that will be revolved ...
24 views

### Computing the volume enclosed by revolving a B-spline

I would like to ask if it's possible to get a function from a B-spline curve besides InterpolatingPolynomial[...]. I'm trying to use the function to compute the ...
115 views

### How to reproduce old SplineFit function?

Prior to version 8, Mathematica included a SplineFit function that could be used, for example, in the form: ...
245 views

### Integrate an Interpolating function with Integrate command

i'm trying to integrate an Interpolating function, as simple as this ...
59 views

### Questions about higher order Bézier Curves

I can generate the same Bézier Curve using my own code as the curve generated by Mathematica's function BezierCurve, but when I increased the order of the curve, it ...
197 views

### How to generate a Bézier curve using 4 points（arbitrary), without using the built-in function of Mathematica?

How to generate a Bézier curve using 4 points（arbitrary), without using the built-in function of Mathematica? The main point is that we do not use the built-in function in Mathematica, instead use a ...
164 views

### BezierCurve is different from BezierFunction

I am constructing Naca type profiles with Bezier curves. ...
106 views

### Integrating an interpolating function: Hermite vs. BSpline

I have an interpolation through a list of points, which I need to integrate. The minimal working example looks as follows: ...
63 views

### How to write the code for a general B-spline function?

I write the code for B-spline basis and it works very nicely but now I need help to write code for general B-spline functions I would like the code to show the spline segment in this way:
226 views

### Generate a smooth random function (2D curve) with endpoints specification?

Here is a PDE example, adapted from Wolfram Documentation: ...
99 views

### The actual polynomial behind a BezierFunction [duplicate]

Let's say I have the following Mathematica code pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}}; F = BezierFunction[pts] How can I find the actual polynomial of the <...
134 views

### How to interpolate closed surface

With BSplineSurface, I was trying to interpolate data points belonging to a sphere, but unfortunately I don't get the right geometry closing: ...
113 views

### Efficiently fill sparse matrix involving BSpline

Context In order to implement regularised fitting in 2 or 3 dimensions (as is done say here) using BSplineBasis one needs to evaluate a basis over a set of data. ...
587 views

### Stiff BVP of nonlinear ODE, alternative/ enhancement to shooting method

Question: I have been trying to solve this coupled ODE set. \begin{align} ( \frac{ \mu^2}{B} +1 ) \Phi^2 + \frac{1}{A} {\Phi^{\prime 2}} + \frac{1}{2}\lambda \Phi^4 - \frac{A'}{r A^...
152 views

### Symbolic representation of a Bézier curve

The Bézier curve is defined by: $$C(t)=\sum_{i=0}^{n} {{n}\choose{i}} t^i (1-t)^{n-i} P_i$$ where the $P_i$ are the control points. I am trying to write it down in Mathematica. What I have is: <...
247 views

### FunctionInterpolation over an open interval

I'm trying to obtain an arc-length parametrization of a spline curve as per https://mathematica.stackexchange.com/a/8456. To do so, I need to calculate partial derivatives of such curve and then ...
57 views

### Display splines - problem with conditional expression

I have implemented cubic spline on my own and it is working properly (table SplineProbe consists piecewise of cubic functions). Right now I would like to display in ...
372 views

### How do I interpolate sparse data with a spline?

I have this data: data = {{0.2, 103}, {2, 13.9}, {20, 2.72}, {200, 0.8}, {2000, 0.401}, {20000, 0.433}} Is there any way of finding value at $x=5$ using ...
197 views

### Ways to quicken numeric integral over interpolating spline?

I have an integral of the form $$\int_1^{15000} f_1(k) f_2(k) dk,$$ where $f_1(k)$ is an interpolating function and $f_2(k)$ is some multiplicative function of k. I'm working with the following <...
158 views

### Transforming a Bézier Curve by a Complex Function

I have a method to plot a rectangular region and then plot the lattice transformation by some complex function $f[z]$. ...
286 views

### Length of a curve parallel to a spline

I have constructed a BSplineFunction through a set of random points: ...
346 views

### Generating a random scribble using BezierCurve won't smooth in 5th point

I'm working on generating a random scribble I'm using the code provided by a Wolfram reference(which I can't link because of 10 rep limitation of two links). This produced well looking scribbles: <...
75 views

### Tube@BSplineCurve not mapping correctly?

(There's a tl;dr at the bottom.) I'm attempting to do what's effectively fake branching in a random walk. I generate one random walk (in the real rather than the integers, but with steps of magnitude ...
119 views

### Fill space between two BezierCurves with random points

I asked a question about filling the space between two curves (Sin and Cos) with random points and the answer I received does ...
222 views

### Volume Deformation

I want to do a volume deformation based on Bezier volumes. For example, if I have a triangle mesh, then I want to deform the mesh into a weird shape like the example image attached here. Can anyone ...
201 views

### BSpline: construct surface from enclosing contours

I'm aiming to construct 3D shape from profiles (typical archaeological drawing stuff: front, side and top profiles views). Through several operation, I now have BSpline curves, which should define ...
210 views

### solve t for a (3D) Bézier curve at a given tangent vector

I'm aiming to solve t for a 3D cubic Bézier curve define through 4 points (start pt, 1st handle, 2nd handle, end pt) at which the curve has a given tangent vector (or better, a parallel one:) ...
326 views

### How to fit B-splines to unstructured grids (triangulated surfaces)?

As a continuation of trying to calculate curvature tensors on triangulated surfaces (here), I am interested in trying other methods. One approach is to use NURBS. To be more precise I would like to be ...
270 views

### Interpolating a function with splines

I would like to interpolate the following function ...
88 views

### Closed BezierCurve is cut in exported PDF or EPS

Bug introduced in 10.3 or earlier and persisting through 11.1.0 or later Exporting the filled Bézier curve to PDF or EPS yields ...
170 views

### Why Interpolation is slower than BSplineFunction?

This my question is concerned with previous about Tube cross-section. Let's use the same pts as in that question. ...
169 views

### Variables substitution in a B-Spline function

I have the following identity mapping expressed by tensor-product B-spline basis functions: ...
224 views

### Draw an alternating colors ring with B-splines

I want to draw a ring with alternating colors and an external radius r, width w and n sectors each with angle θ = 2π/n. n should be even ≥ 4 (The B-spline definition I used below to simulate the ...
368 views

### Plot 2D B-spline curve on 3D B-spline surface

I've been working on this for days. I am trying to plot the B-spline 2D curve (figure '8') on the 3D surface. How can I do that? Can anyone help me with this? Here, I provide code that I use to ...
479 views

### Create a spline function to interpolate a 3D surface [closed]

Here's my problem, I have an spreadsheet that contains data, a 202x202 matrix with x,y and z coordinates. The objective is import the data to mathematica, and then I need to create an interpolation ...
257 views

### Plot curvature comb

Does anyone here knows how to create a curvature comb as in the picture but for a 3D curve? For example if I use the 3D curve as below: ...
79 views

### Obtaining a piecewise polynomial from a plotted parametric curve using splines

Okay, so I have a picture and I have obtained a curve from it using this code: ...