Unexpected Curve.CreateBlendCurve result in RhinoCommon (C#)


In the image above, all curves are 2D planar curves. The red curve is the desired result. It was produced using a default application of the interactive command BlendCrv. In C#, all my efforts to duplicate the red curve turn out looking like the blue curve. I’ve tried everything I can think of to change the result and it just keeps returning the same result every time. Here’s the code snippet I’m using:

rhCrvBlend = Curve.CreateBlendCurve(rhCrvParent, rhCrvParent, BlendContinuity.Tangency);

I’ve tried all sorts of variations on the theme using a single parent curve and multiple parent curves, and I get the same result in Rhino 5 32-bit, Rhino 5 64-bit, and Rhino 6. I’ve tried changing the BlendContinuity to Curvature and it only makes the sharp corner less conspicuous. I don’t understand why RhinoCommon is “throwing” the control points so far away from the parent curves. When I interactively construct the BlendCrv, the control points do not extend past the midpoint of the created curve. I’ve tried scaling the model by a factor of 100 and I get the same results, so it’s not a matter of tolerances or some weird snap setting (I tried disabling Osnap, Ortho, GridSnap, and SmartTrack in code, too, just in case).

You’ll need to set the „bulge“ factor as well. The cps should be equally spaced as default factor 1.0, but this is not how this particular algorithm works. A clear weakness of this native method.

Well, that’s disappointing. Now I need to figure out what the black magic is inside the black box of BlendCrv so I can specify the “bulge factors” in code, or learn how to activate the BlendCrv command from C#.

Better documentation is needed here, I think. :frowning:


if tangency is enough you might use CreateInterpolatedCurve as a workaround and provide the tangent vectors. It is less work to find the proper tangents and if you need to flip one.


Thanks, that’s exactly the workaround I found. Since I’m working with both ends of a closed curve, I had to flip both end tangents. This gave me exactly the same result that BlendCrv gave. Problem solved.