Deform a section of a mesh to be flat/planar

Hello,

How can I deform a section of a mesh to be flat/planar?

Let’s use a sphere to make a simple example of what I’m trying to achieve:
I got a sphere, and I’d like to make the bottom part of the sphere flat. The mesh should be “squished” together, as if you would press a soft clay ball on a table.

This example image was created in blender by selecting the vertex in the center and then moving it up on the Z axis with “Proportional Editing” turn on. Is there something similar to that in Rhino/Grasshopper?

Note that I do not want to simply cut off the lower part and then fill the hole with a flat surface. The surrounding vertices should deform proportionally/accordingly.

My ultimate goal is to flatten the top of this table created in grasshopper, using grasshopper to flatten it.

Here is the Grasshopper file of the model.
weaverbird-cube.gh (19.2 KB)

The quick version might be something like using SetPT to set all the mesh points to be at the same Z value. This would likely mess up your geometry. Or you could use boolean split with a flat surface to just trim the top of the brep.

The more invovled version I would try it to run this through kangaroo. If you flip the geometry so the table top is on the bottom, then use some mesh point selection strategy to set some points as anchors and others to be free. Something like all mesh points with Z < Some Value. Then include a Floor goal object so that the free points lie flat on the floor.