This file is a collection of bits that grew organically in the process of learning Grasshopper.
The 'Pitch / Roll' panel will accept multiple geometries and rotate each one separately. However, that isn't what you generally want in this case, so a 'Brep Join' should be used to create a single polysurface from hull and deck surfaces. Multiple hulls should use the 'Group' component as shown so they will be rotated as a single unit.
The 'Manual, Preset or Solver' panel allows use of presets for 'Roll' and 'Z-Offset'. Presets are defined and selected in the 'Presets: Roll (degs.) and Z-offset' panel to the left:
Or the 'Solver' option for 'Z-Offset':
Z-offset Solver automatically adjusts the 'Z-offset' value to re-establish buoyancy equilibrium for arbitrary values of pitch and roll, based on its at rest level trim.
PERFORMANCE NOTE: For quicker response and operation of the Z-Offset Solver:
right-click to disable 'Hydro2'.
disable entire "Hull Contours" group
'Sections by Hull' shows how to access any of the returned 'sections' (all submerged):
Graphs showing the area of each submerged section (top) and the depth of each section's center:
'Hull Contours' - not related to hydrostatics, nothing special, just provided as a convenience. Contours are very compute intensive so this panel is disabled by default. In this .gh file, contours are wired to act only on the 'belowSrfc' volume but can easily be wired to apply to the complete hull/deck, as shown below:
Additional hydrostatic values could be added to the widget (requests?) or computed separately using the 'belowSrfc' geometries that it returns.