Skip to main content

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
1 vote
1 answer
63 views

Can I make rendering of BSplineCurves more accurate?

My gently curving BSplines are being rendered as straight lines that are long enough to look bad. As an example, consider drawing a dartboard, with its twenty colored sectors. The outer boundaries ...
Lyle Ramshaw's user avatar
15 votes
3 answers
1k views

Edna Andrade's Black Dragon: Winding Around Control Points

Edna Andrade Edna Andrade (1917-2008) is now recognized as an early leader in the Op Art movement. She lived and worked in Philadelphia for the majority of her career after first moving to the city ...
eldo's user avatar
  • 82.4k
8 votes
2 answers
401 views

How to make Region from Spline curve

Let bsf = BSplineFunction[{{1, 1}, {-0.5, -0.7}, {-0.4, -1}, {1, 0}}, SplineClosed -> True, SplineDegree -> 3] Than ...
lesobrod's user avatar
  • 1,894
21 votes
4 answers
2k views

Paul Klee's Notebooks: Loops Around Control Points

Paul Klee Paul Klee (1879 - 1940) was a Swiss-born German artist. His highly individual style was influenced by expressionism, cubism, and surrealism. Klee was a natural draftsman who deeply explored ...
eldo's user avatar
  • 82.4k
1 vote
1 answer
60 views

Replacing Terms of a Table of Functions

I define a table of functions, and I receive and error when I want to change a term of the table. As a minimal example, I can give the following. ...
bkarpuz's user avatar
  • 809
7 votes
1 answer
155 views

Creating a Random T-Spline Instead of a B-Spline

I want to be able to create a function so that instead of BSplineSurface[pts], it would be TSplineSurface[pts,error]. I think it ...
Teg Louis's user avatar
  • 114
1 vote
2 answers
99 views

Positive Change, Negative Change, and Total Change with Values on Graph

I am trying to show a change in cross-section geometry between years, and have good visual plots but would like actual values to use also. I am using spline curves to visualize the cross sections, ...
Andrew Bowsher's user avatar
2 votes
3 answers
261 views

Coordinates of spline plot using ArcLength mesh function

The following code produces a 3D spline with equidistant interpolation points: ...
Jaka Belec's user avatar
5 votes
2 answers
294 views

What do the arguments of a generated BSplineFunction mean?

For example, if we evaluate this: BSplineFunction@{{0,100},{200,50},{200,0}} we'll get ...
rnotlnglgq's user avatar
  • 3,740
1 vote
1 answer
161 views

Proper way to discretize a parametric spline surface

Given that I have a triangular mesh model defined in obj format (1590 vertices and 300 faces), I reconstruct it to a single B-spline surface. Now I want to export ...
Lavender's user avatar
  • 119
4 votes
2 answers
100 views

How to integrate 2 compoonent spline function

I have a Spline function defined as follows. Points = {{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}}; bsf = BSplineFunction[Points, SplineDegree -> 1]; A Parametric ...
jabru's user avatar
  • 205
2 votes
2 answers
97 views

Options to find an analytical description of some points

I have a set of points {{x1,y1},...{xn,yn}} and I would like to have the analytical expression of a function that describes them reasonably well. So that I can plot this function on a ...
Luigi's user avatar
  • 1,303
0 votes
0 answers
57 views

Getting Log10 axis in Graphics Function

In the output shown in the following image, I need x axis to be logarithmic (base 10) instead of linear. When I used ListLogLinearPlot function I got scattered points instead of the required B Spline ...
Srihari M Subodha's user avatar
3 votes
2 answers
97 views

How to NIntegrate multiple ranges of data at the same time with an output that can be plotted?

I am trying to use the NIntegrate function to find the difference in the area beneath two 2 dimensional splines (how much area of the river bed was lost or gained from one year to the next) but, I ...
Andrew Bowsher's user avatar
4 votes
1 answer
99 views

CaputoD of (Edge) BSplines

tl;dr Why does this works: CaputoD[BSplineBasis[{3, {0, 1, 2, 3, 4}}, 0, x], {x, 1/2}] // Simplify Whereas this fails ...
chris's user avatar
  • 23.1k
6 votes
1 answer
325 views

Convert interpolating function to a Bezier curve

I've been wondering, is there a way to convert an interpolation into a sequence of BezierCurve objects that form each step in the interpolation? There is an easy ...
Michael E2's user avatar
  • 241k
1 vote
1 answer
106 views

Recurrence relation for B-spline polynomials

I am trying to get the explicit polynomials of cardinal B-splines. So far I have this implementation (for cardial B-splines of degree 3 on the knots 0, 1, 2, 3): ...
Luca Thiede's user avatar
1 vote
0 answers
161 views

How does Mathematica's B-Spline NURBS work?

I'm finding that Mathematica is getting hung up on a numerical integration and I suspect I can do it faster myself in C++. I can scoop the control points of the BSplineFunction out of the ...
user2603428's user avatar
3 votes
1 answer
449 views

Geogebra spline command in Mathematica

Spline(pts, order, Weight Function) Creates a spline with given order through all points. The weight function says what should be the difference of t values for point $P_i$ and $P_{(i+1)}$ given ...
expression's user avatar
  • 5,672
6 votes
1 answer
849 views

Understanding Interpolation with Cubic Splines

My ultimate question: given data, what function is Interpolation with Method->"Spline" creating? I recall from my ...
GregH's user avatar
  • 1,919
1 vote
2 answers
119 views

Is task to find intersections of a line and a cubic Bezier curve really so hard?

I wrote formulas for parametric Bezier curves of different orders ...
Dims's user avatar
  • 755
3 votes
1 answer
276 views

how to PiecewiseExpand BSplineBasis to get Basis matrices of uniform B-splines presented in the paper?

As we all know, the definition of B-spline contains the B-spline basis function, which has the recursive form $B_{j,k}$ is the j-th degree $k-1$ polynomial. It has nonzeros only in interval $[t_j,t_{...
eason's user avatar
  • 197
3 votes
0 answers
254 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 ...
Hans Ulli's user avatar
4 votes
1 answer
144 views

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

Bug fixed in 13.0.0 [CASE:4855260] It seems that BSplineFunction always returns unevaluated without warnings, when its degree is equal to the number of control ...
Alexey Popkov's user avatar
1 vote
1 answer
388 views

Cubic spline fitting

If I have the following data: ...
John's user avatar
  • 1,651
7 votes
1 answer
146 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 ...
robjohn's user avatar
  • 1,071
0 votes
0 answers
31 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) & \...
user75419's user avatar
0 votes
1 answer
429 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 ...
user5836's user avatar
1 vote
2 answers
189 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 ...
Rainer's user avatar
  • 2,931
12 votes
3 answers
456 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, ...
robjohn's user avatar
  • 1,071
0 votes
0 answers
53 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: ...
Davide Pugliese's user avatar
5 votes
1 answer
254 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. ...
BBirdsell's user avatar
  • 1,226
4 votes
1 answer
110 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 (...
Lyle Ramshaw's user avatar
1 vote
0 answers
109 views

Export Basis spline information to matlab

i am new to Mathematica. I have generated the contours of this image with the following code ...
Paolo Amato's user avatar
11 votes
1 answer
1k 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 ...
LCarvalho's user avatar
  • 9,263
4 votes
1 answer
151 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): ...
stone-zeng's user avatar
9 votes
4 answers
1k 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 ...
Hugh's user avatar
  • 16.6k
7 votes
1 answer
167 views

How to draw a colored curved shape

I can draw a polygon with a curved edge using B-splines or Bézier curves: ...
Musang's user avatar
  • 1,048
2 votes
2 answers
251 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 ...
Daniele Binosi's user avatar
5 votes
0 answers
112 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 ...
chris's user avatar
  • 23.1k
9 votes
0 answers
175 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 ...
MikeY's user avatar
  • 7,193
6 votes
1 answer
579 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. ...
srtie's user avatar
  • 63
3 votes
2 answers
1k 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 ...
Ted Ersek's user avatar
  • 7,144
5 votes
1 answer
81 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 ...
aghostinthefigures's user avatar
2 votes
2 answers
214 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 ...
johk95's user avatar
  • 123
6 votes
1 answer
144 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 <...
Carl Woll's user avatar
  • 131k
3 votes
2 answers
155 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}]}]; ...
Ulrich Neumann's user avatar
3 votes
3 answers
404 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? ...
akr's user avatar
  • 177
6 votes
1 answer
130 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: ...
Igor's user avatar
  • 303
10 votes
1 answer
179 views

Why does BezierFunction not follow BezierCurve at npts>4?

This example: ...
Igor's user avatar
  • 303