Smoth curve


#1

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.


#2

Have you tried fair curve _Fair or rebuild curve _Rebuild?

Cian


#3

yes ,I have try ,but not my need


(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.


#5

thanks very much


#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.


#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


#8

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


#9

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


#10

but I don’t know how to remove these creases


(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.