How to select a part of region to do smooth for mesh ?(MFC/Rhino)

I know those region which have to be handled with smooth function like below.

In my code, how to do Step 2. & Step 3. ?

Process:
Step 1. Select mesh.
Step 2. Set those region which have to be smoothed.
Step 3. Doing smooth.

For Step 2, RhinoRegionSelect() might work. See rhinoSdkUtilities.h

For Step 3, I don’t know if Rhino has a function to do this. Is there an existing command that works?

Those points is selected by program.
It is not to select them by user.

Like below:
Point Index: 1 ~ 10000
Need smooth Point Index: 20~70, 1000~3000, 3524~3600 and so on.

This 2th parameter of function seems to select screen region. Right ?

bool RhinoRegionSelect(
    CRhinoViewport& vp, 
    const ON_SimpleArray<ON_3dPoint>& region,
    const int selectionmode = 0, 
    unsigned int geometry_filter = ON::any_object, 
    ON_ClassArray<CRhinoObjRef>* output = 0);

About Step3, I look for smooth function for mesh.

No, it is a 3d point region. These points will be translated to 2d screen point based on the viewport you pass as the first argument.

If you were just using Rhino, how would you do this?

I got it, so I create an array to include those points,20~70, 1000~3000, 3524~3600 and so on. Right ?
Thanks you. :smile:

About smooth, I found this, so whether this function exists to be used with C++.

The Rhino 5 SDK does not expose the calculations behind the Smooth command. But the forthcoming Rhino 6 SDK has a new RhinoSmoothMesh() function that might help you. We have not yet released the Rhino 6 SDK. But when we do, you will hear it here first…

Thank you, Dale. :smiley:

A post was split to a new topic: Smooth region of mesh