Visualization
Interactive 3D visualization tools using Plotly.
-
navaltoolbox.visualization.plot_vessel_3d(vessel, show_hulls=True, show_tanks=True, show_silhouettes=True, show_openings=True, opacity_hull=0.5, opacity_tank=0.3, title='Vessel Visualization', enable_opacity_slider=True, show_axes=True)
Create an interactive 3D plot of the vessel using Plotly.
- Parameters:
vessel (Vessel) – The vessel to visualize.
show_hulls (bool) – Whether to show hull meshes.
show_tanks (bool) – Whether to show tank meshes.
show_silhouettes (bool) – Whether to show silhouette profiles.
show_openings (bool) – Whether to show downflooding openings.
opacity_hull (float) – Opacity for hull meshes (0.0 to 1.0).
opacity_tank (float) – Opacity for tank meshes (0.0 to 1.0).
title (str) – Title of the plot.
enable_opacity_slider (bool) – Whether to add a slider to control hull opacity.
show_axes (bool) – Whether to show axes, grid, and background.
- Returns:
A Plotly Figure object.
- Return type:
plotly.graph_objects.Figure
-
navaltoolbox.visualization.plot_hydrostatic_condition(vessel, draft, trim=0.0, heel=0.0, show_hulls=True, show_tanks=True, show_silhouettes=True, show_openings=True, opacity_hull=0.5, opacity_tank=0.3, title='Hydrostatic Condition', enable_opacity_slider=True, cog=None, show_axes=True)
Visualize the vessel at a specific hydrostatic condition (floating in water).
The waterplane is fixed at Z=0. The vessel is transformed (translated and rotated) to match the draft, trim, and heel.
- Parameters:
vessel (Vessel) – The vessel to visualize.
draft (float) – Draft at midship (or reference point) in meters.
trim (float) – Trim angle in degrees (positive = stern down usually).
heel (float) – Heel angle in degrees (positive = starboard down usually).
show_hulls (bool) – Whether to show hull meshes.
show_tanks (bool) – Whether to show tank meshes.
show_silhouettes (bool) – Whether to show silhouette profiles.
show_openings (bool) – Whether to show downflooding openings.
opacity_hull (float) – Opacity for hull meshes (0.0 to 1.0).
opacity_tank (float) – Opacity for tank meshes (0.0 to 1.0).
title (str) – Title of the plot.
enable_opacity_slider (bool) – Whether to add a slider to control hull opacity.
cog (tuple[float, float, float] or None) – Optional Center of Gravity (x, y, z) to display.
show_axes (bool) – Whether to show axes, grid, and background.
- Returns:
A Plotly Figure object.
- Return type:
plotly.graph_objects.Figure