Virtual Testbed
Ship dynamics simulator for extreme conditions
Functions
Guile functions

Functions that are exported to Guile. More...

Functions

SCM vtb::guile::get_testbed ()
 Get the current instance of virtual testbed. More...
 
SCM vtb::guile::set_testbed (SCM other)
 Replace the current instance of virtual testbed with other. More...
 
SCM vtb::guile::testbed_gui_start_recording ()
 Start screen recording. More...
 
SCM vtb::guile::testbed_gui_stop_recording ()
 Stop screen recording. More...
 
SCM vtb::guile::testbed_gui_start ()
 Start real-time simulation. More...
 
SCM vtb::guile::testbed_gui_pause ()
 Pause real-time simulation (and screen recording). More...
 
SCM vtb::guile::testbed_gui_stop ()
 Stop real-time simulation (and screen recording). More...
 
SCM vtb::guile::import_asset (SCM rest)
 Import an asset from file using options. Options are specified as rest argument. File path is specified as input-path option. More...
 
SCM vtb::guile::export_asset (SCM s_asset, SCM rest)
 Export asset asset to file using options. Options are specified as rest argument. File path is specified as output-path option. More...
 
SCM vtb::guile::convert_asset (SCM s_asset, SCM rest)
 Convert asset asset using options. Options are specified as rest argument. Output format is specified as output-format option. More...
 
SCM vtb::guile::import_polyhedron (SCM path, SCM rest)
 Import polyhedron from file path using options. Options are specified as rest argument. More...
 
SCM vtb::guile::export_polyhedron (SCM polyhedron, SCM path, SCM rest)
 Export polyhedron polyhedron to file path using options. Options are specified as rest argument. More...
 
SCM vtb::guile::import_hull (SCM path, SCM rest)
 Import ship hull from file path using options. Options are specified as rest argument. More...
 
SCM vtb::guile::import_compartments (SCM path, SCM rest)
 Import ship compartments from file path using options. Options are specified as rest argument. More...
 
SCM vtb::guile::vtestbed_gc ()
 Run garbage collection and all object destructors. More...
 
SCM vtb::guile::make_compartment (SCM polyhedron, SCM rest)
 Construct ship compartment using polyhedron and optional name. More...
 
SCM vtb::guile::generate_compartments (SCM hull, SCM nrooms)
 Generate ship compartments for hull using 3-d grid of size nrooms. More...
 
SCM vtb::guile::make_gerstner_solver (SCM rest)
 Construct Gerstner solver. More...
 
SCM vtb::guile::make_grid (SCM rest)
 Construct multidimensional rectangular grid. More...
 
SCM vtb::guile::grid_min (SCM object)
 Get grid lower bound. More...
 
SCM vtb::guile::grid_max (SCM object)
 Get grid upper bound. More...
 
SCM vtb::guile::grid_begin_index (SCM object)
 Get grid begin index (inclusive). More...
 
SCM vtb::guile::grid_end_index (SCM object)
 Get grid end index (exclusive). More...
 
SCM vtb::guile::make_hull ()
 Construct ship hull. More...
 
SCM vtb::guile::polyhedron_reorder (SCM object)
 Fix face winding. More...
 
SCM vtb::guile::polyhedron_normalise (SCM object)
 Compute vertex and face normals. More...
 
SCM vtb::guile::polyhedron_unique (SCM object)
 Remove redundant vertices and faces. More...
 
SCM vtb::guile::polyhedron_move (SCM object, SCM arg)
 Move the polyhedron to a specified amount in three dimensions. More...
 
SCM vtb::guile::polyhedron_scale (SCM object, SCM arg)
 Scale the polyhedron by a specified factor in three dimensions. More...
 
SCM vtb::guile::polyhedron_flip (SCM object, SCM arg)
 Flip the polyhedron relative to the origin in a specified dimension. More...
 
SCM vtb::guile::polyhedron_mirror (SCM object, SCM arg)
 Mirror the polhedron relative to the origin in a specified dimension. More...
 
SCM vtb::guile::polyhedron_rotate (SCM object, SCM arg1, SCM arg2)
 Rotate the polhedron relative to the origin in a specified dimension by an angle that is multiple of 90 degrees. More...
 
SCM vtb::guile::polyhedron_empty (SCM object)
 Check if polyhedron is not initialised. More...
 
SCM vtb::guile::polyhedron_signed_volume (SCM object)
 Compute signed volume of the polyhedron. More...
 
SCM vtb::guile::polyhedron_signed_volume_below (SCM object, SCM dimension, SCM level)
 Compute signed volume of the polyhedron below certain level of dimension. More...
 
SCM vtb::guile::polyhedron_volume (SCM object)
 Compute absolute volume of the polyhedron. More...
 
SCM vtb::guile::polyhedron_centroid (SCM object)
 Compute centroid of the polyhedron. More...
 
SCM vtb::guile::polyhedron_bounding_box (SCM object)
 Compute bounding box of the polyhedron. More...
 
SCM vtb::guile::polyhedron_bounds (SCM object, SCM dimension)
 Compute the extent of the polyhedron in specified dimension. More...
 
SCM vtb::guile::make_polyhedron ()
 Construct polyhedron. More...
 
SCM vtb::guile::make_ship (SCM rest)
 Construct ship from hull and compartments mass/displacement/draught. More...
 
SCM vtb::guile::ship_mass (SCM object)
 Get ship mass. More...
 
SCM vtb::guile::make_testbed (SCM rest)
 Construct virtual testbed. More...
 
SCM vtb::guile::testbed_policy (SCM object, SCM policy)
 Get policy. More...
 
SCM vtb::guile::testbed_step (SCM object, SCM dt)
 Simulate one time step dt. More...
 
SCM vtb::guile::testbed_reset (SCM object)
 Reset virtual testbed state. More...
 
SCM vtb::guile::testbed_time_instant (SCM object)
 Get current simulation time instant. More...
 
SCM vtb::guile::testbed_grid (SCM object)
 Get simulation grid. More...
 
SCM vtb::guile::make_wave (SCM type, SCM rest)
 Construct wave from amplitude, length and direction using dispersion relation. More...
 
SCM vtb::guile::make_calm_sea_generator ()
 Construct calm sea wavy surface generator. More...
 
SCM vtb::guile::make_plain_wave_generator (SCM rest)
 Construct plain wave wavy surface generator. More...
 

Detailed Description

Functions that are exported to Guile.

Function Documentation

◆ convert_asset()

SCM vtb::guile::convert_asset ( SCM  s_asset,
SCM  rest 
)

Convert asset asset using options. Options are specified as rest argument. Output format is specified as output-format option.

Date
2020-04-08
See also
vtb::assets::convert
convert-asset

Definition at line 93 of file assets.cc.

◆ export_asset()

SCM vtb::guile::export_asset ( SCM  s_asset,
SCM  rest 
)

Export asset asset to file using options. Options are specified as rest argument. File path is specified as output-path option.

Date
2020-04-08
See also
vtb::assets::export_asset
export-asset

Definition at line 71 of file assets.cc.

◆ export_polyhedron()

SCM vtb::guile::export_polyhedron ( SCM  polyhedron,
SCM  path,
SCM  rest 
)

Export polyhedron polyhedron to file path using options. Options are specified as rest argument.

Date
2020-04-08
See also
vtb::geometry::Polyhedron
vtb::assets::export_asset
export-polyhedron

Definition at line 143 of file assets.cc.

◆ generate_compartments()

SCM vtb::guile::generate_compartments ( SCM  hull,
SCM  nrooms 
)

Generate ship compartments for hull using 3-d grid of size nrooms.

Date
2020-04-08
See also
generate-compartments
Returns
a list of ship compartments

Fits the grid of rooms in the bounding box of the hull.

Definition at line 53 of file guile/compartment.cc.

◆ get_testbed()

SCM vtb::guile::get_testbed ( )

Get the current instance of virtual testbed.

Date
2020-04-10
See also
get-testbed

This can only be done when the pipeline is stopped.

Definition at line 20 of file TestbedPipelineInstance.cc.

◆ grid_begin_index()

SCM vtb::guile::grid_begin_index ( SCM  object)

Get grid begin index (inclusive).

Date
2020-04-08
See also
grid-begin-index

Definition at line 271 of file guile/grid.cc.

◆ grid_end_index()

SCM vtb::guile::grid_end_index ( SCM  object)

Get grid end index (exclusive).

Date
2020-04-08
See also
grid-end-index

Definition at line 288 of file guile/grid.cc.

◆ grid_max()

SCM vtb::guile::grid_max ( SCM  object)

Get grid upper bound.

Date
2020-04-08
See also
grid-max

Definition at line 254 of file guile/grid.cc.

◆ grid_min()

SCM vtb::guile::grid_min ( SCM  object)

Get grid lower bound.

Date
2020-04-08
See also
grid-min

Definition at line 237 of file guile/grid.cc.

◆ import_asset()

SCM vtb::guile::import_asset ( SCM  rest)

Import an asset from file using options. Options are specified as rest argument. File path is specified as input-path option.

Date
2020-04-08
See also
vtb::assets::import_asset
import-asset

Definition at line 51 of file assets.cc.

Referenced by vtb::guile::import_compartments(), vtb::guile::import_hull(), and vtb::guile::import_polyhedron().

◆ import_compartments()

SCM vtb::guile::import_compartments ( SCM  path,
SCM  rest 
)

Import ship compartments from file path using options. Options are specified as rest argument.

Date
2020-04-08
See also
import-compartments

Definition at line 197 of file assets.cc.

References vtb::guile::import_asset().

◆ import_hull()

SCM vtb::guile::import_hull ( SCM  path,
SCM  rest 
)

Import ship hull from file path using options. Options are specified as rest argument.

Date
2020-04-08
See also
import-hull

This function is the same as import-polyhedron but also computes ship mass.

Definition at line 173 of file assets.cc.

References vtb::guile::import_asset().

◆ import_polyhedron()

SCM vtb::guile::import_polyhedron ( SCM  path,
SCM  rest 
)

Import polyhedron from file path using options. Options are specified as rest argument.

Date
2020-04-08
See also
vtb::geometry::Polyhedron
vtb::assets::import_asset
import-polyhedron

Definition at line 115 of file assets.cc.

References vtb::guile::import_asset().

◆ make_calm_sea_generator()

SCM vtb::guile::make_calm_sea_generator ( )
inline

Construct calm sea wavy surface generator.

Date
2020-04-08
See also
make-calm-sea-generator
vtb::core::Calm_sea_generator

Definition at line 35 of file wave_generator.cc.

◆ make_compartment()

SCM vtb::guile::make_compartment ( SCM  polyhedron,
SCM  rest 
)

Construct ship compartment using polyhedron and optional name.

Date
2020-04-08
See also
make-compartment
Returns
new ship compartment

Definition at line 32 of file guile/compartment.cc.

◆ make_gerstner_solver()

SCM vtb::guile::make_gerstner_solver ( SCM  rest)
inline

Construct Gerstner solver.

Date
2020-04-08
See also
make-gerstner-solver
vtb::core::Gerstner_solver

Definition at line 30 of file guile/gerstner.cc.

◆ make_grid()

SCM vtb::guile::make_grid ( SCM  rest)

Construct multidimensional rectangular grid.

Date
2020-04-08
See also
make-grid

Definition at line 169 of file guile/grid.cc.

◆ make_hull()

SCM vtb::guile::make_hull ( )

Construct ship hull.

Date
2020-04-08
See also
make-hull

Definition at line 26 of file guile/hull.cc.

◆ make_plain_wave_generator()

SCM vtb::guile::make_plain_wave_generator ( SCM  rest)
inline

Construct plain wave wavy surface generator.

Date
2020-04-08
See also
make-plain-wave-generator
vtb::core::Plain_wave_generator

Definition at line 48 of file wave_generator.cc.

◆ make_polyhedron()

SCM vtb::guile::make_polyhedron ( )
inline

Construct polyhedron.

Date
2020-04-08
See also
make-polyhedron

Definition at line 229 of file guile/polyhedron.cc.

◆ make_ship()

SCM vtb::guile::make_ship ( SCM  rest)

Construct ship from hull and compartments mass/displacement/draught.

Date
2020-04-08
See also
make-ship

Definition at line 32 of file guile/ship.cc.

◆ make_testbed()

SCM vtb::guile::make_testbed ( SCM  rest)

Construct virtual testbed.

Date
2020-04-08
See also
make-testbed

Definition at line 33 of file guile/testbed.cc.

◆ make_wave()

SCM vtb::guile::make_wave ( SCM  type,
SCM  rest 
)

Construct wave from amplitude, length and direction using dispersion relation.

Date
2020-04-08
See also
make-wave

Definition at line 61 of file wave.cc.

◆ polyhedron_bounding_box()

SCM vtb::guile::polyhedron_bounding_box ( SCM  object)

Compute bounding box of the polyhedron.

Date
2020-04-08
See also
polyhedron-bounding-box
vtb::geometry::Polyhedron::bounding_box

Definition at line 204 of file guile/polyhedron.cc.

◆ polyhedron_bounds()

SCM vtb::guile::polyhedron_bounds ( SCM  object,
SCM  dimension 
)

Compute the extent of the polyhedron in specified dimension.

Date
2020-04-08
See also
polyhedron-bounds
vtb::geometry::Polyhedron::bounds

Definition at line 217 of file guile/polyhedron.cc.

◆ polyhedron_centroid()

SCM vtb::guile::polyhedron_centroid ( SCM  object)

Compute centroid of the polyhedron.

Date
2020-04-08
See also
polyhedron-centroid
vtb::geometry::centroid

Definition at line 192 of file guile/polyhedron.cc.

◆ polyhedron_empty()

SCM vtb::guile::polyhedron_empty ( SCM  object)

Check if polyhedron is not initialised.

Date
2020-04-08
See also
polyhedron-empty?
vtb::geometry::Polyhedron::empty

Definition at line 142 of file guile/polyhedron.cc.

◆ polyhedron_flip()

SCM vtb::guile::polyhedron_flip ( SCM  object,
SCM  arg 
)

Flip the polyhedron relative to the origin in a specified dimension.

Date
2020-04-08
See also
polyhedron-flip
vtb::geometry::Polyhedron::flip

Definition at line 114 of file guile/polyhedron.cc.

◆ polyhedron_mirror()

SCM vtb::guile::polyhedron_mirror ( SCM  object,
SCM  arg 
)

Mirror the polhedron relative to the origin in a specified dimension.

Date
2020-04-08
See also
polyhedron-mirror
vtb::geometry::Polyhedron::mirror

Definition at line 123 of file guile/polyhedron.cc.

◆ polyhedron_move()

SCM vtb::guile::polyhedron_move ( SCM  object,
SCM  arg 
)

Move the polyhedron to a specified amount in three dimensions.

Date
2020-04-08
See also
polyhedron-move
vtb::geometry::Polyhedron::move

Definition at line 96 of file guile/polyhedron.cc.

◆ polyhedron_normalise()

SCM vtb::guile::polyhedron_normalise ( SCM  object)

Compute vertex and face normals.

Date
2020-04-08
See also
polyhedron-normalise
vtb::geometry::Polyhedron::normalise

Definition at line 78 of file guile/polyhedron.cc.

◆ polyhedron_reorder()

SCM vtb::guile::polyhedron_reorder ( SCM  object)

Fix face winding.

Date
2020-04-08
See also
polyhedron-reorder
vtb::geometry::Polyhedron::reorder

Definition at line 69 of file guile/polyhedron.cc.

◆ polyhedron_rotate()

SCM vtb::guile::polyhedron_rotate ( SCM  object,
SCM  arg1,
SCM  arg2 
)

Rotate the polhedron relative to the origin in a specified dimension by an angle that is multiple of 90 degrees.

Date
2020-04-08
See also
polyhedron-rotate
vtb::geometry::Polyhedron::rotate

Definition at line 133 of file guile/polyhedron.cc.

◆ polyhedron_scale()

SCM vtb::guile::polyhedron_scale ( SCM  object,
SCM  arg 
)

Scale the polyhedron by a specified factor in three dimensions.

Date
2020-04-08
See also
polyhedron-scale
vtb::geometry::Polyhedron::scale

Definition at line 105 of file guile/polyhedron.cc.

◆ polyhedron_signed_volume()

SCM vtb::guile::polyhedron_signed_volume ( SCM  object)

Compute signed volume of the polyhedron.

Date
2020-04-08
See also
polyhedron-signed-volume
vtb::geometry::Polyhedron::signed_volume

Definition at line 154 of file guile/polyhedron.cc.

◆ polyhedron_signed_volume_below()

SCM vtb::guile::polyhedron_signed_volume_below ( SCM  object,
SCM  dimension,
SCM  level 
)

Compute signed volume of the polyhedron below certain level of dimension.

Date
2020-04-08
See also
polyhedron-signed-volume-below
vtb::geometry::Polyhedron::signed_volume_below

Definition at line 166 of file guile/polyhedron.cc.

◆ polyhedron_unique()

SCM vtb::guile::polyhedron_unique ( SCM  object)

Remove redundant vertices and faces.

Date
2020-04-08
See also
polyhedron-unique
vtb::geometry::Polyhedron::unique

Definition at line 87 of file guile/polyhedron.cc.

◆ polyhedron_volume()

SCM vtb::guile::polyhedron_volume ( SCM  object)

Compute absolute volume of the polyhedron.

Date
2020-04-08
See also
polyhedron-volume
vtb::geometry::volume

Definition at line 180 of file guile/polyhedron.cc.

◆ set_testbed()

SCM vtb::guile::set_testbed ( SCM  other)

Replace the current instance of virtual testbed with other.

Date
2020-04-10
See also
set-testbed!

This can only be done when the pipeline is stopped.

Definition at line 34 of file TestbedPipelineInstance.cc.

◆ ship_mass()

SCM vtb::guile::ship_mass ( SCM  object)

Get ship mass.

Date
2020-04-08
See also
ship-mass

Definition at line 87 of file guile/ship.cc.

◆ testbed_grid()

SCM vtb::guile::testbed_grid ( SCM  object)

Get simulation grid.

Date
2020-04-08
See also
testbed-grid

Definition at line 107 of file guile/testbed.cc.

◆ testbed_gui_pause()

SCM vtb::guile::testbed_gui_pause ( )

Pause real-time simulation (and screen recording).

Date
2020-04-10
See also
testbed-gui-pause!

Definition at line 89 of file TestbedPipelineInstance.cc.

◆ testbed_gui_start()

SCM vtb::guile::testbed_gui_start ( )

Start real-time simulation.

Date
2020-04-10
See also
testbed-gui-start!

Definition at line 77 of file TestbedPipelineInstance.cc.

◆ testbed_gui_start_recording()

SCM vtb::guile::testbed_gui_start_recording ( )

Start screen recording.

Date
2020-04-10
See also
testbed-gui-start-recording!

Can be done before or after the pipeline has been started. The screen is recorded os OGV file in the current working directory. When testbed gui is stopped or paused, screen recording is stopped.

Definition at line 51 of file TestbedPipelineInstance.cc.

◆ testbed_gui_stop()

SCM vtb::guile::testbed_gui_stop ( )

Stop real-time simulation (and screen recording).

Date
2020-04-10
See also
testbed-gui-stop!

Definition at line 101 of file TestbedPipelineInstance.cc.

◆ testbed_gui_stop_recording()

SCM vtb::guile::testbed_gui_stop_recording ( )

Stop screen recording.

Date
2020-04-10
See also
testbed-gui-stop-recording!

This procedure is needed to properly close output file.

Definition at line 65 of file TestbedPipelineInstance.cc.

◆ testbed_policy()

SCM vtb::guile::testbed_policy ( SCM  object,
SCM  policy 
)

Get policy.

Date
2020-04-08
See also
testbed-policy

Definition at line 61 of file guile/testbed.cc.

◆ testbed_reset()

SCM vtb::guile::testbed_reset ( SCM  object)

Reset virtual testbed state.

Date
2020-04-08
See also
testbed-reset!

Definition at line 86 of file guile/testbed.cc.

◆ testbed_step()

SCM vtb::guile::testbed_step ( SCM  object,
SCM  dt 
)

Simulate one time step dt.

Date
2020-04-08
See also
testbed-step!

Definition at line 75 of file guile/testbed.cc.

◆ testbed_time_instant()

SCM vtb::guile::testbed_time_instant ( SCM  object)

Get current simulation time instant.

Date
2020-04-08
See also
testbed-time-instant

Definition at line 97 of file guile/testbed.cc.

◆ vtestbed_gc()

SCM vtb::guile::vtestbed_gc ( )
inline

Run garbage collection and all object destructors.

Date
2020-04-08
See also
vtestbed-gc

Definition at line 45 of file base.hh.