Smoth curve

I need write a funtion to let my curves more smoth.
my ideas is like that :smile:
first find the points on the curve which directions changed suddenly.
then split the curve usting these points.
and blend the splited curves to one curve.
my questions:
1: how to find these points on the curves which directions changed suddenly.
2: how to blend the splited curves and ensure the curves transformation not to much.
I can’t find a c++ funtion equivalently to the blend command
3: my ideas maybe is not good,can you give my a more good ideas?
curve.rar(1.0 MB)
file has a test curve,and the curve has a point which directions changed suddenly.

Have you tried fair curve _Fair or rebuild curve _Rebuild?


yes ,I have try ,but not my need

To search a curve for discontinuity, ON_Curve::GetNextDiscontinuity. See opennurbs_curve.h for details.

Once you have these locations, you can split the curve using ON_TrimCurve. Again, see opennurbs_curve.h for details.

To perform the blending, use RhinoSdkBlend::CurveBlend. See rhinoSdkBlend.h for details.

thanks very much

I find rhino has a smoth command.
I try using these comand to smoth my curve,and I think this command is just i need.
but i need a correspond c++ function.
does the sdk has this function.if has"t ,i will write it using the ideas mentioned above.

I using GetNextDiscontinuity function to find the discontinuity points of my test curve,but the test result have’t these points.but my test curve is not smoth?
can you help me to see why these happens?

I think Discontinuity points maybe not the points which directions changed suddenly. ?

I think if I want let my curve become smoth,I should find the creases.

but I don’t know how to remove these creases

No, the functionality provided by the Smooth command is not available in an SDK function. I’ll see if we can change this for a future service release.