Hello and welcome to the Plugincafe,
as always, please mark your post as a question and use tags. See
Also, please do not cross post your questions on different forums.
Please notice that the COFFEE programming language has been removed since Cinema 4D R20.
I guess with "delete the mesh points gradually" you mean you want to have a slider that defines the radius of the effect.
The best (and most Cinema 4D-like) way to implement that, would be to create a generator object plugin (ObjectData).
This generator object would use the polygon object and the control object as input objects and would create a virtual object in its cache according to your algorithm. Such an object would work similiar to the "Polygon Reduction" object.
A generator plugin has to implement the function GetVirtualObjects(). You find an example of such a generator on GitHub: https://github.com/PluginCafe/cinema4d_py_sdk_extended/tree/master/plugins/py-rounded_tube_r13
Within that GetVirtualObjects() function, you can use GetHierarchyClone() to create a polygonal clone of an input object. You can apply your algorithm to this clone accordingly.
You want to delete points, but you most not forget also to delete the corresponding polygons that were referencing the delete points. I guess the best way of handling that is to use SendModelingCommand() with MCOMMAND_DELETE.
selection = op.GetPointS()
# clear existing selection
selection.DeselectAll()
# define a new selection
selection.Select(0)
mode = c4d.MODELINGCOMMANDMODE_POINTSELECTION
res = c4d.utils.SendModelingCommand(c4d.MCOMMAND_DELETE, list = [op], doc = None, mode = mode)
best wishes,
Sebastian