Divooka Reference

Shore

22 nodes

On this page 22

Add Shore Body

Function

The shore with a rigid body on it, made by the Box, Sphere, Capsule and the other body nodes. A body lighter than the water (1025 kg/m³) floats where the water is deep enough to carry it, rises and falls with the waves and goes where the flow takes it; where the water is too shallow, or has drained away, it lies on the bed. A heavier body sinks to the bed and stays. Bodies collide with each other. They do not disturb the water.

Signature
AddShoreBody -> Shore Scene Description
    scene: Shore Scene Description
    body: Body Description
ShoreSceneDescription AddShoreBody(
    ShoreSceneDescription scene,
    BodyDescription body)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
bodyBody Description—The body. Put it at about the sea's level to float, or just above the sand to lie there (Shore Bed Height gives the sand's height at a point).

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Add Shore Mound

Function

The shore with a mound on its bed: a sand bar the waves break on first, a rock, an island; or, with a negative height, a channel or a pool.

Signature
AddShoreMound -> Shore Scene Description
    scene: Shore Scene Description
    position: Vector3d
    radius: Number
    height: Number
    stretch: Number
ShoreSceneDescription AddShoreMound(
    ShoreSceneDescription scene,
    Vector3d position,
    double radius = 10,
    double height = 1.5,
    double stretch = 1)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
positionVector3d—The mound's middle (m); its Z is not used.
radiusNumber10How wide it is (m).
heightNumber1.5How high it stands above the bed around it (m); negative digs.
stretchNumber1How many times longer it is along the shore (Y) than across it: 1 is round, 10 a bar.

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Add Shore Trigger

Function

The shore with a trigger for its bodies, made by the Triggers nodes: at a time, at every interval, or when a body touches another, rises or falls past a height or moves faster than a speed, it pushes a body, releases one that was held, spawns a copy of one or removes one. A boat let go from the sand as the tide of waves reaches it, driftwood arriving piece by piece. Triggers are looked at after every step of the bodies, in the order they were added; what they did is in the events of Shore Bodies. A shore does not take Water In Region, Detonate, Set Wind or Unpin Cloth, and says so here.

Signature
AddShoreTrigger -> Shore Scene Description
    scene: Shore Scene Description
    trigger: Trigger Description
ShoreSceneDescription AddShoreTrigger(
    ShoreSceneDescription scene,
    TriggerDescription trigger)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
triggerTrigger Description—The trigger.

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Export Shore Meshes

Function

Writes the water's surface at every recorded frame of a run as a mesh file, in metres and Divooka's axes (+Z up). Returns the files written.

Signature
ExportShoreMeshes -> Text Array
    result: Shore Result
    folder: Text
    prefix: Text
    format: Text
    every: Integer
string[] ExportShoreMeshes(
    ShoreResult result,
    string folder,
    string prefix = "shore",
    string format = "ply",
    int every = 1)

Parameters

nametypedefaultdescription
resultShore Result—The run.
folderText—The folder; created if missing.
prefixTextshoreFile name prefix: files are prefix.0001.ply and on.
formatTextplyThe file format: ply (binary, the smallest), obj or stl.
everyInteger1Use every cell (1), every second one (2) and so on.

Returns

resultText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

New Beach

Function

A beach: a bed that lies flat under the sea for the first part of the way from -X, then rises evenly through the waterline to the land at +X, the same all along Y. Add Shore Mound gives it bars, rocks and channels.

Signature
NewBeach -> Shore Scene Description
    length: Number
    width: Number
    position: Vector3d
    depth: Number
    rise: Number
    cellSize: Number
ShoreSceneDescription NewBeach(
    double length = 200,
    double width = 120,
    Vector3d position,
    double depth = 5,
    double rise = 3,
    double cellSize = 0.5)

Parameters

nametypedefaultdescription
lengthNumber200The area's extent along X, from the sea to the land (m).
widthNumber120Its extent along Y, along the shore (m).
positionVector3d—The corner of the area at its lowest X and Y (m).
depthNumber5How deep the sea is where the swell comes in (m).
riseNumber3How high the land is at the far end, above the sea (m).
cellSizeNumber0.5The size of a cell (m): the smallest detail of the water. A wave wants a dozen cells along its length.

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

New Shore From Heights

Function

A shore whose bed is a picture: dark is low and bright is high. The picture is stretched over the area, its left edge at the sea (-X) and its top at the highest Y. A terrain painted or made by other nodes becomes a coast.

Signature
NewShoreFromHeights -> Shore Scene Description
    heights: Pixel Image
    length: Number
    width: Number
    position: Vector3d
    lowest: Number
    highest: Number
    cellSize: Number
ShoreSceneDescription NewShoreFromHeights(
    PixelImage heights,
    double length = 200,
    double width = 120,
    Vector3d position,
    double lowest = -5,
    double highest = 5,
    double cellSize = 0.5)

Parameters

nametypedefaultdescription
heightsPixel Image—The picture; its brightness is the height.
lengthNumber200The area's extent along X (m).
widthNumber120Its extent along Y (m).
positionVector3d—The corner of the area at its lowest X and Y (m).
lowestNumber-5The height black stands for (m): below the sea's level, which is 0.
highestNumber5The height white stands for (m).
cellSizeNumber0.5The size of a cell (m).

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Set Shore Look

Function

The shore looking differently in pictures.

Signature
SetShoreLook -> Shore Scene Description
    scene: Shore Scene Description
    sunDirection: Vector3d
    ripples: Truth
ShoreSceneDescription SetShoreLook(
    ShoreSceneDescription scene,
    Vector3d sunDirection,
    bool ripples = true)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
sunDirectionVector3d—Where the sun stands, as a direction towards it.
ripplesTruthTrueShow small wind waves on top of the swell.

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Set Shore Sea

Function

The shore with the sea of an Ocean scene coming in: the long waves of that scene's wind are the shore's swell, in place of the two regular ones, and its short waves the ripples in pictures. A coast is then one wind in two scenes: the open sea of the Ocean nodes, and its waves shoaling and breaking here. Only waves long against the water at the sea's side come in, which the shallow water can carry: Shore Sea Height says how high they are, and a light wind over deep water sends in none. Set Shore Waves after this adds a regular swell from far off on top.

Signature
SetShoreSea -> Shore Scene Description
    scene: Shore Scene Description
    sea: Ocean Scene Description
ShoreSceneDescription SetShoreSea(
    ShoreSceneDescription scene,
    OceanSceneDescription sea)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
seaOcean Scene Description—The sea: its wind's speed and direction and its seed are taken. A wind that blows to +X (0°) comes straight on shore; one that blows along the shore or off it sends its waves in slanted, or not at all.

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Set Shore Waves

Function

The shore with another swell coming in from the sea.

Signature
SetShoreWaves -> Shore Scene Description
    scene: Shore Scene Description
    amplitude: Number
    period: Number
    secondAmplitude: Number
    secondPeriod: Number
ShoreSceneDescription SetShoreWaves(
    ShoreSceneDescription scene,
    double amplitude = 0.4,
    double period = 8,
    double secondAmplitude = 0.25,
    double secondPeriod = 9.7)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
amplitudeNumber0.4The swell's height from its middle to its crest (m): 0.4 breaks gently on a beach, 1 is surf.
periodNumber8Its period (s): 6 is wind sea, 8 to 12 swell from far off.
secondAmplitudeNumber0.25The height of a second swell (m), which makes the waves come in sets; 0: none.
secondPeriodNumber9.7The second swell's period (s).

Returns

resultShore Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Bed

Function

The shore's bed as a mesh: the sand, the bars and the rocks, without the water. The 3D view draws it.

Signature
ShoreBed -> Streamed Vertex Mesh Data
    scene: Shore Scene Description
    every: Integer
StreamedVertexMeshData ShoreBed(
    ShoreSceneDescription scene,
    int every = 1)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
everyInteger1Use every cell (1), every second one (2) and so on: a coarser mesh of a large shore.

Returns

resultStreamed Vertex Mesh Data
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Bed Height

Function

The bed's height (m) at a point.

Signature
ShoreBedHeight -> Number
    scene: Shore Scene Description
    position: Vector3d
double ShoreBedHeight(
    ShoreSceneDescription scene,
    Vector3d position)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
positionVector3d—The point; its Z is not used.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Bodies

Function

The motion of the shore's bodies over a recorded run, as a result the Results nodes read (Body Position, Body Path, Bodies Mesh) and the 3D view plays. Its frames are the run's own: frame 3 of it is the bodies at the run's recorded frame 3.

Signature
ShoreBodies(result: Shore Result) -> Simulation Result
SimulationResult ShoreBodies(ShoreResult result)

Parameters

nametypedefaultdescription
resultShore Result—The run.

Returns

resultSimulation Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Foam Map

Function

The foam at a recorded frame as a picture seen from above: white where waves have broken. Columns run along X (the sea at the left) and the top row is the highest Y.

Signature
ShoreFoamMap -> Pixel Image
    result: Shore Result
    frame: Integer
PixelImage ShoreFoamMap(ShoreResult result, int frame)

Parameters

nametypedefaultdescription
resultShore Result—The run.
frameInteger—The recorded frame, from 0.

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Frame Count

Function

How many frames a run recorded.

Signature
ShoreFrameCount(result: Shore Result) -> Integer
int ShoreFrameCount(ShoreResult result)

Parameters

nametypedefaultdescription
resultShore Result—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Frame Time

Function

The simulated time of a recorded frame (s).

Signature
ShoreFrameTime(result: Shore Result, frame: Integer) -> Number
double ShoreFrameTime(ShoreResult result, int frame)

Parameters

nametypedefaultdescription
resultShore Result—
frameInteger—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Picture

Function

Runs the shore for a time and takes a picture of it: the sand, the water with its foam, the bodies where the water has taken them, and the flat sea beyond the area, under the scene's sun.

Signature
ShorePicture -> Pixel Image
    scene: Shore Scene Description
    time: Number
    eye: Vector3d
    target: Vector3d
    width: Integer
    height: Integer
    fieldOfView: Number
PixelImage ShorePicture(
    ShoreSceneDescription scene,
    double time,
    Vector3d eye,
    Vector3d target,
    int width = 640,
    int height = 480,
    double fieldOfView = 40)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
timeNumber—How long to run before the picture (s).
eyeVector3d—Where the camera stands (m).
targetVector3d—What it looks at (m).
widthInteger640The picture's width in pixels.
heightInteger480The picture's height in pixels.
fieldOfViewNumber40The camera's vertical field of view in degrees.

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Run Up

Function

How far up the beach the water has run at a recorded frame: the largest X (m) that is wet.

Signature
ShoreRunUp(result: Shore Result, frame: Integer) -> Number
double ShoreRunUp(ShoreResult result, int frame)

Parameters

nametypedefaultdescription
resultShore Result—The run.
frameInteger—The recorded frame, from 0.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Sea Height

Function

The significant height (m) of the sea that comes in at the shore's sea side: the mean height, trough to crest, of the highest third of its waves there. 0 when the shore has no sea (Set Shore Sea), or when all of its wind's waves are too short for the water at that side to carry as shallow water does: a stronger wind or a shallower sea side lets them in. A sea more than about half as high as the water is deep breaks as soon as it enters.

Signature
ShoreSeaHeight(scene: Shore Scene Description) -> Number
double ShoreSeaHeight(ShoreSceneDescription scene)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Surface

Function

The water's surface at a recorded frame as a mesh: an open sheet over the cells that are wet, which ends where the beach is dry. The 3D view draws it; with Shore Bed under it, it is the shore.

Signature
ShoreSurface -> Streamed Vertex Mesh Data
    result: Shore Result
    frame: Integer
    every: Integer
StreamedVertexMeshData ShoreSurface(
    ShoreResult result,
    int frame,
    int every = 1)

Parameters

nametypedefaultdescription
resultShore Result—The run.
frameInteger—The recorded frame, from 0.
everyInteger1Use every cell (1), every second one (2) and so on.

Returns

resultStreamed Vertex Mesh Data
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Water Depth

Function

How deep the water is at a point at a recorded frame (m): 0 where the sand is dry. With a body's position it says whether the body is afloat or aground.

Signature
ShoreWaterDepth -> Number
    result: Shore Result
    frame: Integer
    position: Vector3d
double ShoreWaterDepth(
    ShoreResult result,
    int frame,
    Vector3d position)

Parameters

nametypedefaultdescription
resultShore Result—The run.
frameInteger—The recorded frame, from 0.
positionVector3d—The point; its Z is not used.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Shore Water Volume

Function

How much water is on the area at a recorded frame (m³).

Signature
ShoreWaterVolume(result: Shore Result, frame: Integer) -> Number
double ShoreWaterVolume(ShoreResult result, int frame)

Parameters

nametypedefaultdescription
resultShore Result—The run.
frameInteger—The recorded frame, from 0.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation

Simulate Shore

Function

Runs the shore for a time and records the water at every frame, for the surface nodes to read. A frame is 8 bytes a cell, so record few frames of a large shore (Keep Every). The first waves take a while to cross the area: at 5 m depth they travel 7 m a second.

Signature
SimulateShore -> Shore Result
    scene: Shore Scene Description
    duration: Number
    framesPerSecond: Number
    keepEvery: Integer
ShoreResult SimulateShore(
    ShoreSceneDescription scene,
    double duration = 30,
    double framesPerSecond = 30,
    int keepEvery = 30)

Parameters

nametypedefaultdescription
sceneShore Scene Description—The shore.
durationNumber30How long to run (s).
framesPerSecondNumber30Frames per second of simulated time.
keepEveryInteger30Record every frame (1), every second one (2) and so on; the last frame is always recorded.

Returns

resultShore Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Shore
Package
Physics Simulation