I am still struggling with my current project, so after hours of thinking Ive decided to ask another question to you guys again. For my current project, I am implementing a software which interpolates a spline with given vertices. For this, I am using the deBoor algorithm with uniformed vector knots (3rd degree).
Since I am reproducing the behaviour of another software (basically I am creating an open source version of it), I want to analyse and know how certain things are implemented on his software.
Imagine you have 6 vertices, so there are 5 Segments (t 0..1, t 1..2, t 2..3, t 3..4, t 4..5). I want to know the lenghts of each segment, which is generated in that software (but can´t figure out how he calculates the segment lengths). Thats my question. Based on following example data, how did he calculated those segment lengths? What do you guys think?
Here, some example data, from the other software.
P0 (0, 0)
P1 (10, 10)
P2 (0, -10)
P3 (50, 10)
P4 (30, -10)
P5 (20, -10)
Which results following Segment lengths:
S0 7,86m
S1 7,9m
S2 26,33m
S3 11,28m
S4 11,39m
These are the Choord lengths of the segments:
C0 14,1421m
C1 22,3606m
C2 53,8609m
C3 28,302m
C4 10mm
Spline length:
64.76m
Here is an example plot (shows how the spline is subdevided into those segments):
Maybe this graph also helps to visualize how the segments are splitted (on straight line, so ignore y axis):
**Here is another example with 12 vertices (11 segments) **
P00 (0, 0)
P01 (10, 50)
P02 (10, -10)
P03 (30, 40)
P04 (30, 10)
P05 (20, 0)
P06 (20, -10)
P07 (40, -30)
P08 (49, -20)
P09 (50, 30)
P10 (39, 20)
P11 (39, 70)
Which results following Segment lengths:
S0 23.06m
S1 23.04m
S2 21.83m
S3 15.92m
S4 14.93m
S5 12.66m
S6 20.3m
S7 17.66m
S8 32.8m
S9 26.11m
S10 26.2m
These are the Choord lengths of the segments:
C0 10m
C1 22.3607m
C2 53.8609m
C3 30.0167m
C4 14.1421m
C5 10m
C6 28.2843m
C7 14.1421m
C8 50m
C9 14.1421m
C10 50m
Spline length:
234.51m




First, let's try to get some terminology straight. On a cubic b-spline curve, there are four important types of points:
When you use the word "vertices", I can't tell which kind of points you're talking about.
Then, there are two important sets of real numbers:
To construct a b-spline curve that interpolates a given set of i-points, you just have to solve a linear system of equations to calculate the deBoor points. But, before you can do this, you have to decide what nodes and knots you're going to use. As I said above, most people make the nodes and the knots the same on cubic splines. In fact any increasing set of values will work as nodes, but the values are usually chosen so that their differences are somehow related to chord lengths (i.e distances between the i-points). The choice will dramatically change the shape of the resulting curve. There is a good discussion in these notes.
Your problem, as I understand it, is this: you are trying to guess what algorithm is being used to assign node values in some piece of software. That way, you can construct curves with the same shapes yourself.
You seem to be referring to the node values (or their differences, actually) as "segment lengths", or "chord lengths". But, in the pictures you showed, it appears to me that the node and knot values that are being used are just equally spaced, and are not related to any sort of length. See here for a discussion.
The other area of freedom in constructing b-spline curves is the end-conditions. Common techniques are "natural", "clamped", and "not-a-knot". I can't tell which of these is being used in your examples.