Skip to content

Resources

Ícaro Fonseca edited this page Jul 2, 2018 · 23 revisions

Wiki β–Έ Resources

This page briefly outlines the main repository resources and files. You can use it to understand how the library is arranged and what each file does. For detailed documentation of library classes and methods, visit API Reference.

Table of Contents

πŸ“ Ship Specifications

Includes ship specifications:

  • PX121
  • Cruise
  • barge

πŸ“ Three.js Interfaces

  • πŸ“„ Ship3D.js: interface for constructing THREE.js Object3D from Vessel.js Ship object.

Propulsion System Specifications

  • πŸ“ Propeller specifications for usage with fuel consumption simulations. Read more.

  • πŸ“ Power plant specifications for usage with fuel consumption simulations. Read more.

πŸ“ build

Contains a build version of the library for easy inclusion in external projects.

  • πŸ“„ Vessel.js: compact version of the library including all classes, objects and functions.

  • πŸ“„ makeBuild.py: Python script for building the library source code into the Vessel.js file.

πŸ“ examples

Examples of applications built with the library.

πŸ“ source

Library source code used to create the build file. Contains sub-folders:

πŸ“ classes

Classes for different ship aspects handled by the library.

  • πŸ“„ BaseObject.js: image of every class object defined in the library. Depends on JSONSpecObject.js.

  • πŸ“„ DerivedObject.js: classes for each kind of ship component object, derived from baseObject. Defines properties for component states such as mass, CoG and tank filling.

  • πŸ“„ Hull.js: this class represents the ship hull, with properties for calulating weight and water line shape. It also includes properties for GM calculation and for truncating hull visualization according to draft. When having a class for this, the specification can possibly be in one of several formats, and the handling will be contained in this class.

  • πŸ“„ JSONSpecObject.js: base class for objects that are constructed from a literal object, (or optionally from a JSON string). Constructors can take more parameters than the specification, but the specification must be the first parameter. setFromSpecification will typically be overridden by derived classes. Overriding implementations will typically do some sanity checking. getSpecification will also typically be overridden. The default implementation is now at preliminary stage.

πŸ“ math

Common functions for library calculations.

  • πŸ“„ Vectors.js: some small helpers for operations on 3D vectors. A vector is defined as an object with properties x, y and z.

  • πŸ“„ areaCalculations.js: calculation of sectional areas and moments of inertia.

  • πŸ“„ combineWeights.js: returns mass and CG for a combination of weight arrays.

  • πŸ“„ interpolation.js: linear and bilinear interpolation helpers. Also includes bisectionSearch, a function that takes a sorted array as input, and finds the last index that holds a numerical value less than, or equal to, a given value. Returns an object with the index and an interpolation parameter mu that gives the position of value between index and index+1.

  • πŸ“„ parametricWeightParsons.js: this function estimates the structural weight of the hull. This includes the weight of the basic hull to its depth amidships. It is based on Watson and Gilfillan modeling approach using a specific modification of the Lloyd's Equipment Numeral E as the independent variable.

  • πŸ“„ volumeCalculations.js: volume calculation for vessel displacement based on numerical integration of sectional areas.

Clone this wiki locally