I create planes at intervals along the curve and take the intersections between adjacent planes. Because the output from Plane | Plane intersection is a minute line I scale them up:
But a flat curve still shows the distance between intersections oscillating between larger and smaller values (illustrated by the repeated apparently darker and lighter regions in your screenshot). Another possible reason for this may be that these intersections show very small curvature variations in the base curve more clearly than the curvature graph and the problem is inherent in the curve. Hopefully a grasshopper guru at McNeel can explain it.
Thanks for the reminder about Extend Curve. In this case though I am extending lines that vary in length to a standard set length rather than by a set distance.
I had hoped this was being caused by dividing the length. Length of a spline is not a fundamental property but has to be calculated with some gnarly calculus.
However, you get the same scalloping (same wavelength and amplitude) when using Parameter (which is a fundamental property of a spline) instead of Length. So it’s not that.
It’s also independent of scale. Making the source curve 10x bigger doesn’t change the scallops.
Sorry to bump with no progress, but at least some avenues are closed off…
Rebuilding the curve with degree upped from 3 to 4 gets rid of the scalloping (rebuilding with same degree doesn’t).
I’m thinking that degree 3 compromises the smoothness of the curve. You can’t see the difference from the curvature graphs but we are revealing it through these intersections.
I would expect that the parameter space of an interpolated curve may be wavy at a microscopic level. Especially since it looks like the number of waves is the same as the number of knot spans.
Whatever is causing the waviness in this process it definitely has to do with the positioning of the planes along the curve (not the accuracy of intersection of planes). It suggests the tangent direction of the curve may be wavy depending on whether it lands on a knot or half way between a knot. Whether that waviness comes from the tangent calculation (doubtful) or just the nature of the spline curve that there are very slight bulges between knots.
If you try this on an arc you won’t get any waviness because all the intersection lines will be the same :^}
Yes … IIRC, degree 3 curves have G2 continuity between spans, while degree 4 curves have G3 continuity.
Might the rate of curvature variation be the problem here ?
@Gijs This is a weird one! I keep going back and forth on what the root cause of the scalloping might be. Here are some thoughts.
First issue: The knots of the curve are uniform, and there are no extra knots inserted. So, I would expect the curve to be C^2, in which case I would expect its tangent vector to be C^1. @jeremy5 is intersecting normal planes placed at equally spaced arc length parameters along the curve. The only data that these planes depend on is the curve point and the tangent vector. If what I just said is true, then it is surprising to me that rebuilding the curve at degree 4 fixes the problem, but I’m not familiar with how curve rebuilding works. In principal one can easily just elevate the degree of the curve: the parametrization and the graph of the curve should remain exactly the same. I suppose that is not happening, and some approximation is taking place…
Second issue: To what extent can we expect to observe scalloping like this for a degree 3 C^2 spline? The tangent vector is C^1, hence its derivative is C^0, hence “the derivative” of the normals planes is also C^0. Is there something going on with this construction that makes this C^0-ness visually apparent? It is more obvious closer to the focus of the arrangement of rays, which makes sense, since focusing like this has a tendency to amplify a lack of smoothness.
My gut feeling is that there is no bug, and that @jeremy5 has discovered a clever way of visualizing C^2 discontinuities. If the rebuilt curve is an approximation of the original, it should be much smoother in a quantifiable way, which might explain the fix.
(FWIW, I doubt very much the plane-plane intersector has much to do with any of this.)
Here’s something else to think about, maybe it’s helpful.
Let’s call the curve x = x(ℓ), where we let ℓ be its arc length parameter. Let T(ℓ) be the unit tangent vector. What @jeremy5 is doing is intersecting pairs of normal planes which get closer and closer as his equispaced arc length grid gets finer. Let’s convert this into some mathematical specification of the intersection curve/ruled surface as we let the grid spacing go to zero.
If a point z lies on the normal plane at parameter ℓ, then T(ℓ)·(z - x(ℓ)) = 0. Likewise, if the same point z lies on the “next” normal plane—say, at parameter ℓ+h—then T(ℓ+h)·(z - x(ℓ+h)) = 0. Taylor expanding this second expression in h about the parameter ℓ ultimately leads to N(ℓ)·(z - x(ℓ)) = ρ(ℓ), where N is the unit normal and ρ is the radius of curvature of the curve (in the osculating plane). This follows by applying T(ℓ)·(z - x(ℓ)) = 0 and the Frenet-Serret formula T’(ℓ) = κ(ℓ)N(ℓ). Our goal is to characterize the point z. We have two equations and three degrees of freedom (the coordinates of z), and we have now fixed the T and N coordinates of z in the curve’s Frenet frame at parameter ℓ. This leaves the B (unit binormal) coordinate free, giving an intersection line.
Basically, the ruled surface you’re getting by intersecting these planes is actually given explicitly by X(ℓ,ζ) = x(ℓ) + ρ(ℓ)N(ℓ) + ζB(ℓ) (the parameter ζ is just some free parameter that controls the “binormal offset”). So you could just sample curves on it however you like if you can compute the necessary data.