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.

Filter by
Sorted by
Tagged with
2
votes
0answers
120 views

NURBS model from a entire mesh

I have a mesh in STL file format and imported it into Mathematica. data=Import["mesh.stl"]; or ...
2
votes
1answer
48 views

BSplineFunction returns unevaluated when its degree is equal to the number of control points

Bug persisting through 12.3.1 [CASE:4855260] It seems that BSplineFunction always returns unevaluated without warnings, when its degree is equal to the number of ...
6
votes
1answer
114 views

Texture prevents JoinedCurve from closing

Bug introduced in 11.3 or earlier and fixed in 12.1 I am running Mathematica 11.3 and would like to see if this behavior is still present in newer versions of Mathematica before submitting a bug ...
0
votes
0answers
26 views

Plot a quadratic bezier triangular patch [duplicate]

I need to construct a triangular patch by using the 6 control points: $$\begin{array}{ccc} \left(\frac{1}{2},\frac{\sqrt{3}}{4},1\right) & \left(\frac{1}{4},\frac{\sqrt{3}}{4},2\right) & \...
0
votes
1answer
169 views

Plot a bezier triangle

I have to construct a bezier triangle that interpolates these 4 points: $\qquad (0,0,1),\,(1,0,0),\,(0,1,0),\,(0.5,0.5,0.75)$ However, the surface that I get is so weird. Anyone please can help me to ...
0
votes
2answers
78 views

Access to Interpolation expression of Mathematica's Interpolate command

To reproduce fits which have been done in the framework of a standard, I was reviewing the Interpolation engine of Mathematica (for InterpolationOrder -> 3) to get more information about the ...
11
votes
3answers
402 views

Why is there a discrepancy between JoinedCurve/FilledCurve and the underlying BSplineCurve segments?

This may be related to How to discretize a BezierCurve?, but this question deals with BSplineCurves with specific SplineWeights, ...
0
votes
0answers
46 views

Part::partw: error in Custom Spline Algorithm

I am attending a Calculus course where we use Wolfram as a supporting tool, and I was trying the algorithm provided for Spline interpolation and I get the error in the picture: ...
4
votes
1answer
120 views

Find intersection points of arbitrary BSpline curve

I'm researching some computational geometry and am trying to find a method of determining the {x,y} intersection of a circle and BSplineCurve for further processing. ...
4
votes
1answer
72 views

How can I control the length of the line segments used in rendering a BSplineCurve?

Mathematica seems to render rational Bézier curves (drawn with BSplineCurve) using polylines whose segments can be annoyingly long, while polynomial Bézier curves (...
1
vote
0answers
48 views

Export Basis spline information to matlab

i am new to Mathematica. I have generated the contours of this image with the following code ...
10
votes
1answer
600 views

Rendering PNG images to spline curves

I found something interesting on this page (Generic contour smoothing with shading) that could help me improve my images. Unfortunately, they can only be used with graphics generated by the software ...
4
votes
0answers
70 views

Why FilledCurve and BezierCurve or BSplineCurve do not fit

I want to draw the outline of a circle (it's actually the glyph period from Cascadia Code font): ...
7
votes
4answers
683 views

Find smallest distance from a point to a Bézier curve

I wish to find the smallest distance from a point to a curved defined via a Bézier function. I want to do this automatically. For particular cases it is not to difficult. Here is a minimum working ...
5
votes
1answer
123 views

How to draw a colored curved shape

I can draw a polygon with a curved edge using B-splines or Bézier curves: ...
2
votes
2answers
140 views

Best parameter for smoothing splines

I am trying to implement a module to determine the best value for the smoothing parameter of a smoothing spline interpolation of a given dataset. To calculate the cross-validation score of a given ...
5
votes
0answers
86 views

Improving speed performance of 'Fit' with BSplines?

Context In the context of this (vaguely controversial) question, I am stumbling into a performance issue with Fit. Let me illustrate on fitting a set of ...
9
votes
0answers
161 views

Dividing by Zero - Unexpected Result [closed]

When I divide this number by zero I get this for an answer. ans = 2345900/0 (* *) What is surprising is that in taking the square root, Mathematica seems to ...
6
votes
1answer
267 views

Different results using spline interpolation in Wolfram and MATLAB

I use the same data for interpolation in Mathematica and MATLAB, but the result is different. ...
2
votes
2answers
222 views

How to make a natural cubic spline of {{x,y}, ...} data

Consider data = {{0, 0}, {1, 0}, {2, 0}, {3, 1}, {4, 0}, {5, 0}, {6, 0}}; f = Interpolation[data, InterpolationOrder -> 3, Method -> "Spline"]; Then the ...
5
votes
1answer
59 views

Image artifacts while using BSplineCurve

Mathematica provides an example of visualizing a Hilbert curve using splines as a Graphics object in this entry in its documentation system. However, when one attempts to change the thickness, some ...
2
votes
2answers
110 views

Manual ArcLength sampling on spline differs from MeshFunction sampling

Using Michael E2's answer, I performed a manual arclength parameterisation by solving the differential equation (or: finding the inverse of a function whose derivative is known). I compared the ...
5
votes
1answer
104 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 <...
2
votes
2answers
102 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}]}]; ...
3
votes
3answers
268 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? ...
6
votes
1answer
103 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: ...
10
votes
1answer
161 views

Why does BezierFunction not follow BezierCurve at npts>4?

This example: ...
7
votes
1answer
94 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?
3
votes
1answer
101 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 ...
3
votes
0answers
105 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 ...
2
votes
1answer
35 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: ...
2
votes
1answer
165 views

How to reproduce old SplineFit function? [duplicate]

Prior to version 8, Mathematica included a SplineFit function that could be used, for example, in the form: ...
4
votes
2answers
643 views

Integrate an Interpolating function with Integrate command

i'm trying to integrate an Interpolating function, as simple as this ...
2
votes
1answer
74 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 ...
1
vote
2answers
292 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 ...
5
votes
1answer
215 views

BezierCurve is different from BezierFunction

I am constructing Naca type profiles with Bezier curves. ...
2
votes
1answer
190 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: ...
0
votes
0answers
98 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:
3
votes
1answer
704 views

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

Here is a PDE example, adapted from Wolfram Documentation: ...
3
votes
0answers
112 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 <...
5
votes
2answers
257 views

Finding inflection points of 2D BSplineFunction

This code creates a jagged line in two dimensions and fits a BSpline function to it. ...
2
votes
1answer
235 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: ...
6
votes
1answer
137 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. ...
10
votes
2answers
753 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^...
3
votes
2answers
181 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: <...
3
votes
3answers
345 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 ...
0
votes
0answers
59 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 ...
0
votes
1answer
520 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 ...
2
votes
3answers
238 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 <...
2
votes
1answer
266 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]$. ...