The mooring does not have a general function for inserting it. Therefore, it is being repeated over again in several codes:
|
this.InsertMooring = function(ship, states, motion, anchorPoint) { |
|
mooringForce = this.InsertMooring(this.ship, this.states, motion, seaDepth, mooring.anchorPoint); |
|
this.InsertMooring = function(ship, states, motion, seaDepth, anchorPoint) { |
|
function InsertMooring(ship, states, motion, seaDepth, anchorPoint, mooringPointOnShip, anchorLength, radialDistance, density, mooringAngle) { |
In aditional, the defined functions are using global variables, preventing the js files to work as snippets, problem stated also in #100:
|
lwl = floatingStates.LWL/2+floatingStates.trim; |
As a solution I will create a snippet InsertCatenary.js which will receive the starting and final points of the line, an object containing the geometry, materials and coefficients of the catenary, the number of division, and the scene. The function itself will be responsible for changing the 3D model according to the initial and final points and return the forces (If appliable).
The function will also calculate for the cases in which the Horizontal Force is known (eletrical cables and uni dimensional mooring) and the cases that it is unknown (6DOF arrangement). I will also make a Observable tutorial to standardize this procedure.
The mooring does not have a general function for inserting it. Therefore, it is being repeated over again in several codes:
vesseljs/examples/snippets/DynamicalMovementMooringWaveParametric.js
Line 343 in f5a5b1c
vesseljs/examples/snippets/DynamicalMovementMooringWave.js
Line 52 in f5a5b1c
vesseljs/examples/snippets/Explore_file_side_to_side.js
Line 273 in f5a5b1c
vesseljs/examples/snippets/Subsea.js
Line 258 in f5a5b1c
In aditional, the defined functions are using global variables, preventing the js files to work as snippets, problem stated also in #100:
vesseljs/examples/snippets/DynamicalMovementMooringWave.js
Line 368 in f5a5b1c
As a solution I will create a snippet InsertCatenary.js which will receive the starting and final points of the line, an object containing the geometry, materials and coefficients of the catenary, the number of division, and the scene. The function itself will be responsible for changing the 3D model according to the initial and final points and return the forces (If appliable).
The function will also calculate for the cases in which the Horizontal Force is known (eletrical cables and uni dimensional mooring) and the cases that it is unknown (6DOF arrangement). I will also make a Observable tutorial to standardize this procedure.