Floating object?

I’m new to Grasshopper. I would like to like to use a solver to try to figure out where some object shapes would float (in water) by giving the object a mass.

My idea (which I can’t get to work) was to have a movable cutting plan that cuts to object and calculates the volume of the part below to cutting plan (water surface). This cutting plan would move to a level where the volume would equal the mass, in other words, floating.

Could someone give me some pointers to how I might go about this task please?

Have a look at this thread

Oh wow, just what I’m after, thanks.

This is great thank you! I’ve used this example to get my object to float but can you please help show how to keep the object floating in one place? along the z-axis.
I want to float a cylinder that has a pole going through it., so the cylinder floats up and down the pole.

I have tried the anchor xyz connected to the bouncy solver (after load and other have been applied) but it still doesnt work. The cylinder floats away! (which is great but not all I need sadly).
Please can you help?