There is also a goal for this in Kangaroo- G2_curves_kangaroo.gh (16.2 KB)
Can be handy if you want 2 separate curves to meet G2, yet control an interpolating point where they meet. It’s on my long term to-do list to improve the interface for this, and maybe extend to other conditions for degree/weights/knot-vector.
Actually, a few days ago I searched in this forum and found your component . It’s really awsome.
But I can’t see the component’s logic and I really want to know it, so I studied just for interest and found the basic function. If someone wants to use it, they can make their own logic according to their need.
Since I’m only evaluating the tangent and curvature at a parameter, I can match at any point of a curve. It is not directly based on the controlpoints.
Furthermore the main difference between both components is, that my reference curve is not changing its cvs for matching. It just matches a to b at any given point, but doesn’t change b actually.
Anyway to match two curves with g2 you just move the third cv in h2 direction for a length of 0.001. Before and after you do this you measure the curvature at t. then get the delta curvature. You just need to find the length of the vector which is required to get the length of the reference curvature. After you matched the curvature you can move p2 (third cv) in tangent direction. This does not destroy the g2. This is what is refered as “factor” in my component. Maybe I push it on git…
Ah I see now, you are only adjusting one curve to match at a given parameter of a fixed input curve.
Depending on the application, I think both parametric (1-directional dependency) and variational (multi-directional) can be useful. If you want to be able connect things in loops then an iterative method is essential.
(I also really like the tools XirusCAD has for this)
Three plus decades ago I developed algorithms for similar questions involving B-splines and wrote Fortran code to implement the algorithms. Using control points and the NURBS formulation the problem of matching G2 matching of a degree 2 or higher at a selected location/parameter value to a selected point on another curve can be set up as a linear set of equations which can be solved directly for non-rational, ie all weights equal to 1 curves. Is there interest in details?