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
Main ship specifications:
- barge.json: simple square barge with cargo and ballast tanks.
- PX121.json: PSV partly based on Ulstein PX121.
- Cruise.json: cruise ship.
📁 Auxiliary Scripts
Ship3D.js: interface for constructing THREE.js Object3D from Vessel.js
scaleShipSpec.js: function for scaling a
Shipspecification. The ship is scaled geometrically with linear scaling factors. Thicknesses of structural elements (decks and bulkheads) and lightweights of derived objects remain constant. The figure below shows the original PX121 specification compared to two others scaled in 10% each.
Propulsion System Specifications
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.
Classes for different ship aspects handled by the library.
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.
setFromSpecificationwill typically be overridden by derived classes. Overriding implementations will typically do some sanity checking.
getSpecificationwill also typically be overridden. The default implementation is now at preliminary stage.
Common functions for library calculations.
Vectors.js: some small helpers for operations on 3D vectors. A vector is defined as an object with properties
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
muthat gives the position of value between
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.