Hacker News new | past | comments | ask | show | jobs | submit login
Spurious Splines (inconvergent.net)
119 points by sebg on Dec 5, 2016 | hide | past | favorite | 16 comments



A spline/splinelike curve question: is there a smooth spline-like curve which can be "consumed", that is, you can move an endpoint along the curve without changing the remainder of the curve? This is useful for path planning. A sequence of arcs has this property, but a smooth curve with control points through which the curve passes would be convenient.


Disclaimer, late in the night and math do not mix well.

Its been a while since I looked at splines, but (if I recall correctly) the points list of points do not fully define the curve (even for quadratic splines). One common approach to uniquely define a spline is to add the additional requirement that the derivative of the curve be 0 at the endpoints. If you define it in such a way that the derivative of the end point is the same as that point on the original curve, then I think you will get a curve with the property you are looking for. However, I cannot think of a natural way of defining such a curve that does not amount to remembering the original curve.

I suppose, depending on your use-case, when you move the point, you can compute the new derivative then forget about the old curve entirely; but I still don't see the advantage over remembering the old curve.


Catmull-Rom spline is a "smooth curve with control points through which the curve passes". Not sure about the "consumed" property though. Interesting question.


Yes, the unity math packages uses those to localize changes to a small part of the spline for effecient incremental updates https://www.assetstore.unity3d.com/en/#!/content/14912


Search for "B-splines knot insertion", which will enable what (I think) you want to do.


If I understand your question correctly, you're asking about "interpolating splines" as opposed to "approximating splines".

For example: http://www.moreprocess.com/computer-graphics/interpolation-a...

There are a bunch of interpolating splines.

But, since you mention a sequence of arcs, you may be interested to know that a very common usage of splines is to create a sequence of low-order splines, such as cubic. A cubic Bezier is a 4-point spline that you can think of as a curve defined by 2 end points and 2 tangents. Place a bunch of those back to back, and you can have an arbitrarily long curve where the effect of moving any point in the curve is localized to 2 segments of the chain, and none of the other segments will change.

Using a higher order spline where moving any point will affect the whole curve is pretty uncommon in practice, I think. At least for practice that includes modeling and animating in film & video games.


I don't know a spline off the top of my head that inherently has the property you want, but you can split Bezier curves to form what you want: https://pomax.github.io/bezierinfo/#splitting . You can also drop earlier control points from any spline once you get to the next curve in the piecewise formula.

Also, I suspect you might want to know that you can construct cubic Bezier curves as a pair of (point + derivative at point)s instead of using four control points, and you can also easily get the derivative at any point along the curve. You can use this to change your mind about where an animation is headed halfway through but still always get a smooth result.


Take a look at the TCB curve: http://cubic.org/docs/hermite.htm


Why not just use a spline and leave the control points where they are as you traverse the curve? Once the path is planned there is no need to re-plan at every step—you can use your choice of line-following controller to minimize your distance to the planned path as you go.


"you can move an endpoint along the curve without changing the remainder of the curve" Is trivial true. Think of a curve as t(0..1)->p as a function. Change (0..1) to (0..a) with a<=1. It's the same function, just scale t by 1/a first.


The spline function itself is defined as a function of the points. In general, if you change the points of a spline, then you change the resulting curve. Animats seems to be asking about special cases where, if you change the endpoint of the curve such that it is still on the original curve, the resulting curve happens to be the same as the original (over the interval on which it is defined).


I got that. I think I provided a trivial way to do that. I might be wrong but how/why? Pick the new end point at p'(a) = curve(a), a[0..1], multiply the curve by 1/a. Same curve, new endpoint?


I am not sure I understand what you are suggesting.

Are you suggesting to think of the spline-like curve as a function that with domain [0,1]. For simplicity, let us simply say that original curve is defined between 0 and 1 on the x axis, so t(x) gives you the curve without additional work.

If you simply change the domain of t to be [0,a], then you have (trivially) produced an otherwise identical function (call it t') with a different endpoint; but I am not sure where the scaling t' by 1/a comes in. If you literally mean take t'(x)/a, then (unless a is 1) that is clearly a different function. If you mean take t'(x/a) then you have arrived back at the original function, but compressed along the x axis.

As I mentioned above, simply changing the domain without scaling does "work". The problem is that it is not obvious that the resulting curve is "spline-like". Admittedly, to my knowledge, "spline-like" has never been formally defined. However, we defined a spline by the fixed points through which it passes.

For example, suppose t(x) is the spline-like curve under discussion. We should have t = SplineLike((x1,y1),(x2,y2),...,(xn,yn)). Where SplineLike is a function that takes a set of points, and produces a spline-like curve that passes through said points.

Now consider the curve t' = SplineLike((x1,y1),(x2,y2),...,(a,t(a))). That is to say, take the previous set of points, and move the last point to somewhere else on the resulting curve. For simplicities sake, make the additional assumption that (a,t(a)) is still the rightmost point.

We are looking for a higher order function SplineLike such that t'(x) = t(x) where t' is defined. Additionally, SplineLike should produce functions that "feel" like a spline. Since the splines we are talking about are quadratic, a reasonable criteria for this is that the resulting functions are continuous, and have a continuous derivative.

Providing a way to go straight from t to t' does not provide any insight to the higher order SplineLike function; or even if such a function exists.


Still no information on reticulating splines.


The last part of this article resembles a tutorial for generating Heptapod glyphs.


This is beautiful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: