Geometry#
Classes for defining hull geometry and vessel structure.
Hull#
- class Hull(file_path)#
A hull geometry loaded from an STL file.
- Parameters:
file_path (str) – Path to the STL file
- get_bounds()#
Returns the bounding box of the hull.
- transform(translation, rotation, pivot)#
Applies a transformation to the hull.
- Parameters:
translation – (dx, dy, dz) translation vector
rotation – (rx, ry, rz) rotation angles in degrees
pivot – (px, py, pz) pivot point for rotation
- scale(factor)#
Scales the hull uniformly.
- Parameters:
factor – Scale factor
- export_stl(file_path)#
Exports the hull to an STL file.
- Parameters:
file_path – Output file path
Vessel#
- class Vessel(hull)#
A vessel containing one or more hulls, tanks, and silhouettes.
- Parameters:
hull (Hull) – The hull geometry
- get_bounds()#
Returns the combined bounding box of all hulls.
- num_hulls()#
Returns the number of hulls.
- num_tanks()#
Returns the number of tanks.
- get_total_tanks_mass()#
Returns the total mass of all tank fluids in kg.
- get_tanks_center_of_gravity()#
Returns the combined CoG of all tank fluids [x, y, z].
- add_silhouette(silhouette)#
Adds a silhouette profile to the vessel.
- Parameters:
silhouette (Silhouette) – Silhouette to add
- clear_silhouettes()#
Removes all silhouettes from the vessel.
- get_total_emerged_area(waterline_z)#
Returns the total emerged area from all silhouettes (m²).
Silhouette#
- class Silhouette(file_path)#
A 2D silhouette profile in the X-Z plane for wind heeling calculations.
Used for calculating wind heeling moments per IMO 2008 IS Code (MSC.267).
- Parameters:
file_path (str) – Path to a DXF file
- static from_vtk(file_path)#
Load a silhouette from a VTK file (.vtk or .vtp polyline).
- Parameters:
file_path (str) – Path to the VTK file
- Returns:
Silhouette object
- Return type:
- static from_points(points, name)#
Create a silhouette from a list of (x, z) points.
- get_points()#
Returns the points as a list of (x, y, z) tuples.
- get_bounds()#
Returns the bounding box (x_min, x_max, z_min, z_max).
- get_emerged_area(waterline_z)#
Returns the emerged area above waterline (m²).
OpeningType#
DownfloodingOpening#
- class DownfloodingOpening#
A downflooding opening point or contour for θf calculation.
Per IMO 2008 IS Code, used to determine when non-weathertight openings become submerged during heel.
- static from_point(name, position, opening_type)#
Create opening from a single point.
- Parameters:
- Returns:
DownfloodingOpening object
- Return type:
- static from_contour(name, points, opening_type)#
Create opening from a contour (polyline boundary).
- Parameters:
- Returns:
DownfloodingOpening object
- Return type:
- set_active(active)#
Set opening active state.
- Parameters:
active (bool) – True to include in calculations
- get_points()#
Returns points as list of (x, y, z) tuples.
- is_submerged(heel, trim, pivot, waterline_z)#
Check if opening is submerged at given conditions.