Hull Definition and Hydrostatics

Define, visualize a hull and calculate its hydrostatic properties.

A Ship object in the Vessel.js library is created from a specification object. The specification below defines a prismatic hull, without any additional part. The hull lines (stored in the halfBreadths property) are taken as symmetrical and are defined proportionally to the ship's main dimensions (stored in the attributes property):


				

Then, we create a Ship object from this specification:


				

The visualization is created with an interface built to transform the Ship object above in a Three.js render (see here for more details). The result is displayed below. The different colors indicate the position of the design draft.

To calculate the hydrostatic properties of the hull for a given draft, say, 2 m, the following method can be evoked:


				

Which returns: