I need write a funtion to let my curves more smoth.

my ideas is like that

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.

# Smoth curve

**NiceDay**#1

**dale**(Dale Fugier) #4

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.

**NiceDay**#6

dale:

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.

**NiceDay**#7

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?

thanks

**dale**(Dale Fugier) #11

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.