GDF manipulating - shiplab/wamit GitHub Wiki

GDF class

import gdf_class

A class for manipulating the geometrical data file (GDF).

The main use is to obtain the hydrostatics properties to export a model in new loading conditions.

It is also possible to scale the original mesh to obtain a vessel with new dimensions.

Load a gdf file

ship = gdf_class.GDF('ship.gdf')

The command above loads a gdf file and creates

Evaluate properties for a determined draft

ship.props(T=[], KG=[])

Optional Inputs:

  • T: new draft, if it is empty or greater than Depth it will be equal to depth.
  • KG: new KG, if it is empty it will be equal to original KG evaluated from the mesh.

Scale GDF

ship.gdf_scale(Lf, Bf, Df, T=[], KG=[])

Required inputs:

  • Lf: Final length
  • Bf: Final Beam
  • Df: Final Depth

Optional inputs:

  • T: new draft, if it is empty or greater than Depth it will be equal to depth.
  • KG: new KG, if it is empty it will be equal to original KG evaluated from the mesh.

Exporting scaled GDF

ship.gdf_write(self, gdf_out, path_out=[], LWL_rhino=False)

Required inputs:

  • gdf_out: name of gdf file. Example: ship2.gdf

Optional inputs:

  • path_out: path to export the gdf file
  • LWL_rhino: flag to call function to generate the irr surface using Rhino 5. If Rhino 5 is not installed must be equal False

Exporting Low Order GDF (Trimesh)

ship.export_low_order_tri(self, gdf_out, path_out=[])

Required inputs:

  • gdf_out: name of gdf file. Example: ship2.gdf

Optional inputs:

  • path_out: path to export the gdf file
⚠️ **GitHub.com Fallback** ⚠️