I was trying to built a slightly different weighted curve blend tool in grasshopper. (think of apple typical blends, I saw at least five feature request for a parametric / reproducable blend
While its easy to determine the position of the CVs while blending two first-degree curves, I couldn’t find the geometric definition of that second point if the curves are not straight lines themself.
The problem is that the number of ‘answers’ quickly goes to infinity. Also, Apple makes their blends through sheer brute-force-point pushing for days until it’s perfect, nothing so predictable as an ‘algorithm.’
Another hack I am now thinking of would be to generate a BlendC and then move the CVs along the vector defined by themselves and the previous point in line.
Yeah just moving one point, outside of trivial examples like they’re all in a line, will throw off G2, there’s a relationship between them…and lol that’s the extent of my knowledge on the subject, and probably a bit beyond that.
here is a repro which also contains a binary (.gha) for matching a curve onto another:
Just a couple of word on how that works.
Pos: P0 and P0’ need to be coincident (obviously) Tan: P1’ must be on the tangent of (P0-P1). Moving on that tangent is what we call the factor. Where the factor 1 is located is up to you. You either make it the vector length of P0P1 or you divide the length of the curve-to-match by the amount of cps Cur: Moving P2’ on the tangent of P0P1 does not change the curvature. You can use it to mody the factor as well (G2). If you rotate the tangent in 90 degrees (CrossProduct with P0P1 and Z axis), you need step for 1, calculate the curvature change (delta). Once you have that delta you do a simple ratio calculation to see how far you need to move in the normal direction to match up the curvature. Thats it.
Thanks for coming back at me!
However, by moving the points in rhino I could not reproduce your last statement:
Moving p1 along p0p1 in a g2 layout will break continuity.
Then this means we are not talking about the thing. My plugin should prove that this works. It offers the option to provide a tangency factor and a curvature factor. They both are based on what I have said. Have you actually tried it?
They are all measured at the location to match. ‘A’ refers to the curve to match against, and ‘B’ to the curve to match. ‘B0’ is before moving for one step, whereas ‘B1’ is after that. In other words, this is the curvature change or delta. After the delta is known for one step, you can compute the correct offset, due to its linear relationship.