Liquid
23 nodes
On this page 23
Add Liquid Body
FunctionThe scene with a rigid body in the tank, made by the Box, Sphere, Capsule and the other body nodes. A moving body floats or sinks by its density (water is 1000 kg/m³), is carried and thrown by the liquid and pushes it in turn; bodies collide with each other, with the scene's solids and with the tank's floor, its walls and its lid, where it has them: what holds the liquid holds what floats in it. The liquid feels a sphere, a box and a capsule as they are and any other shape as the box round it, and it does not feel a body thinner than a cell.
AddLiquidBody -> Liquid Scene Description
scene: Liquid Scene Description
body: Body DescriptionLiquidSceneDescription AddLiquidBody(
LiquidSceneDescription scene,
BodyDescription body)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| body | Body Description | — | The body. A static one stands where it is, as a solid does; a kinematic one is moved by a session's Move Solid. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Liquid Box
FunctionThe scene with a box of liquid in it, at rest or moving.
AddLiquidBox -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
size: Vector3d
velocity: Vector3dLiquidSceneDescription AddLiquidBox(
LiquidSceneDescription scene,
string name,
Vector3d position,
Vector3d size,
Vector3d velocity)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The body's name. |
| position | Vector3d | — | The box's centre (m). |
| size | Vector3d | — | The box's size (m) along X, Y and Z; what lies outside the tank or inside a solid is left out. |
| velocity | Vector3d | — | The velocity it starts with (m/s). |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Liquid Drain
FunctionThe scene with a drain: a box in which liquid disappears. Set into the floor it is a plughole, and the liquid round it flows in as into a hole; a tank with a tap and a drain finds the depth at which one takes what the other gives.
AddLiquidDrain -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
size: Vector3dLiquidSceneDescription AddLiquidDrain(
LiquidSceneDescription scene,
string name,
Vector3d position,
Vector3d size)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The drain's name. |
| position | Vector3d | — | Its centre (m). |
| size | Vector3d | — | Its size (m) along X, Y and Z: two cells deep or more, so that liquid falling fast does not pass through it in a step. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Liquid Sphere
FunctionThe scene with a ball of liquid in it, at rest or moving: a drop about to fall.
AddLiquidSphere -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
radius: Number
velocity: Vector3dLiquidSceneDescription AddLiquidSphere(
LiquidSceneDescription scene,
string name,
Vector3d position,
double radius,
Vector3d velocity)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The body's name. |
| position | Vector3d | — | The ball's centre (m). |
| radius | Number | — | The ball's radius (m). |
| velocity | Vector3d | — | The velocity it starts with (m/s). |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Liquid Tap
FunctionThe scene with a tap: a round nozzle that pours liquid in for as long as it is open, as a jet with the velocity given. A hose, a waterfall's lip, a tap over a basin. The tank is given room for what its taps pour in their time, or in twenty seconds when they never close; Liquid Refused says when a run asked for more.
AddLiquidTap -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
radius: Number
velocity: Vector3d
Rate (l/s): Number
start: Number
end: NumberLiquidSceneDescription AddLiquidTap(
LiquidSceneDescription scene,
string name,
Vector3d position,
double radius,
Vector3d velocity,
double rate = 0,
double start = 0,
double end = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The tap's name. |
| position | Vector3d | — | The middle of its mouth (m), inside the tank. |
| radius | Number | — | Its mouth's radius (m); a jet wants a few cells across it. |
| velocity | Vector3d | — | The velocity the liquid leaves with (m/s): (0, 0, -2) pours straight down. |
| Rate (l/s) | Number | 0 | How much it pours, in litres a second. 0 is a full jet, its mouth's area times its speed: 31 l/s for a radius of 5 cm at 4 m/s. |
| start | Number | 0 | When it opens (s). |
| end | Number | 0 | When it closes (s); 0: never. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Liquid Trigger
FunctionThe scene with a trigger for its bodies, made by the Triggers nodes: at a time, at every interval, or when a body touches something, 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. Crates dropped into a tank one after another, a gate let go when a float rises. Triggers are looked at after every step of the bodies, in the order they were added; what they did is in the events of Liquid Bodies. A real-time scene does not take Water In Region, Detonate, Set Wind or Unpin Cloth, and says so here.
AddLiquidTrigger -> Liquid Scene Description
scene: Liquid Scene Description
trigger: Trigger DescriptionLiquidSceneDescription AddLiquidTrigger(
LiquidSceneDescription scene,
TriggerDescription trigger)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| trigger | Trigger Description | — | The trigger. A spawn that repeats has room for 32 bodies the liquid flows round; later ones still fall and collide. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Solid Box
FunctionThe scene with a solid box standing in the tank.
AddSolidBox -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
size: Vector3dLiquidSceneDescription AddSolidBox(
LiquidSceneDescription scene,
string name,
Vector3d position,
Vector3d size)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The solid's name. |
| position | Vector3d | — | Its centre (m). |
| size | Vector3d | — | Its size (m) along X, Y and Z. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Add Solid Sphere
FunctionThe scene with a solid ball standing in the tank.
AddSolidSphere -> Liquid Scene Description
scene: Liquid Scene Description
name: Text
position: Vector3d
radius: NumberLiquidSceneDescription AddSolidSphere(
LiquidSceneDescription scene,
string name,
Vector3d position,
double radius)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| name | Text | — | The solid's name. |
| position | Vector3d | — | Its centre (m). |
| radius | Number | — | Its radius (m). |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Export Liquid Meshes
FunctionRuns the scene and writes the liquid's surface at every frame as a mesh file, closed where it meets the tank, in metres and Divooka's axes (+Z up). Nothing is kept in memory. Returns the files written.
ExportLiquidMeshes -> Text Array
scene: Liquid Scene Description
folder: Text
duration: Number
framesPerSecond: Number
prefix: Text
format: Text
smoothing: Integerstring[] ExportLiquidMeshes(
LiquidSceneDescription scene,
string folder,
double duration = 1,
double framesPerSecond = 24,
string prefix = "liquid",
string format = "ply",
int smoothing = 2)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| folder | Text | — | The folder; created if missing. |
| duration | Number | 1 | How long to run (s). |
| framesPerSecond | Number | 24 | Frames per second of simulated time. |
| prefix | Text | liquid | File name prefix: files are prefix.0001.ply and on. |
| format | Text | ply | The file format: ply (binary, the smallest), obj or stl. |
| smoothing | Integer | 2 | How often the surface is smoothed before it is meshed. |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Export Liquid Mesh Frame
FunctionWrites one frame of a recorded run as a mesh file (.ply, .obj or .stl by the path's ending) and returns the path.
ExportLiquidMeshFrame -> Text
result: Liquid Result
frame: Integer
path: Textstring ExportLiquidMeshFrame(
LiquidResult result,
int frame,
string path)Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
| path | Text | — | The file to write; its folder is created if missing. |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Bodies
FunctionThe motion of the scene's bodies and solids 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 here is the moment of Liquid Surface's frame 3.
LiquidBodies(result: Liquid Result) -> Simulation Result
SimulationResult LiquidBodies(LiquidResult result)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | The run of a scene that has bodies. |
Returns
| result | Simulation Result |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Frame Count
FunctionHow many frames a run recorded.
LiquidFrameCount(result: Liquid Result) -> Integer
int LiquidFrameCount(LiquidResult result)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Frame Particle Count
FunctionHow many particles the liquid is at a recorded frame: with taps and drains it changes. A particle is an eighth of a cell of liquid.
LiquidFrameParticleCount -> Integer
result: Liquid Result
frame: Integerint LiquidFrameParticleCount(LiquidResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Frame Time
FunctionThe simulated time of a recorded frame (s).
LiquidFrameTime(result: Liquid Result, frame: Integer) -> Number
double LiquidFrameTime(LiquidResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | |
| frame | Integer | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Particle Count
FunctionHow many particles the liquid is at the end of the run.
LiquidParticleCount(result: Liquid Result) -> Integer
int LiquidParticleCount(LiquidResult result)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Picture
FunctionRuns the scene for a time and takes a picture of it: the ground, the solids and the liquid with its whitewater, lit by the sun.
LiquidPicture -> Pixel Image
scene: Liquid Scene Description
time: Number
eye: Vector3d
target: Vector3d
width: Integer
height: Integer
fieldOfView: NumberPixelImage LiquidPicture(
LiquidSceneDescription scene,
double time,
Vector3d eye,
Vector3d target,
int width = 640,
int height = 480,
double fieldOfView = 40)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| time | Number | — | How long to run before the picture (s). |
| eye | Vector3d | — | Where the camera stands (m). |
| target | Vector3d | — | What it looks at (m). |
| width | Integer | 640 | The picture's width in pixels. |
| height | Integer | 480 | The picture's height in pixels. |
| fieldOfView | Number | 40 | The camera's vertical field of view in degrees. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Refused
FunctionHow many particles the taps could not pour during the run because the tank had no room left for them; 0 when every tap gave all it was asked for. A tank is given room for what its taps pour in their time (twenty seconds for a tap that never closes): close the taps, drain the tank, or run for less.
LiquidRefused(result: Liquid Result) -> Large Integer
long LiquidRefused(LiquidResult result)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — |
Returns
| result | Large Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Surface
FunctionThe liquid's surface at a recorded frame as a mesh: closed where it meets the tank, its triangles facing outwards.
LiquidSurface -> Streamed Vertex Mesh Data
result: Liquid Result
frame: IntegerStreamedVertexMeshData LiquidSurface(
LiquidResult result,
int frame)Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Streamed Vertex Mesh Data |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Liquid Surface Volume
FunctionThe volume the liquid's surface encloses at a recorded frame (m³): how much liquid the mesh holds.
LiquidSurfaceVolume -> Number
result: Liquid Result
frame: Integerdouble LiquidSurfaceVolume(LiquidResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Liquid Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
New Tank
FunctionAn empty tank standing on the ground: its floor and its four walls hold the liquid, and nothing leaves through its top.
NewTank -> Liquid Scene Description
size: Vector3d
position: Vector3d
cellSize: Number
whitewater: TruthLiquidSceneDescription NewTank(
Vector3d size,
Vector3d position,
double cellSize = 0.025,
bool whitewater = true)Parameters
| name | type | default | description |
|---|---|---|---|
| size | Vector3d | — | The tank's size (m) along X, Y and Z (up). It is made of whole cells counted in eights, so each side is rounded up to the next multiple of eight cells: choose a size that is one, such as 1.6 m in cells of 0.025 m, when the walls have to stand exactly there. |
| position | Vector3d | — | The middle of the tank's floor (m). |
| cellSize | Number | 0.025 | The size of a cell (m): the smallest detail the liquid has. A cell of liquid is eight particles, and halving the size is eight times as many. |
| whitewater | Truth | True | Make spray, foam and bubbles where the liquid breaks; they show in pictures. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Open Tank
FunctionThe scene with its tank opened: without its lid, or without one or more of its walls. Liquid that reaches an open side leaves and is gone. A tank has a lid unless it is opened here, so that what splashes up comes down again.
OpenTank -> Liquid Scene Description
scene: Liquid Scene Description
top: Truth
Side at smallest X: Truth
Side at largest X: Truth
Side at smallest Y: Truth
Side at largest Y: TruthLiquidSceneDescription OpenTank(
LiquidSceneDescription scene,
bool top = true,
bool minX = false,
bool maxX = false,
bool minY = false,
bool maxY = false)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| top | Truth | True | Take the lid off: liquid thrown over the top is gone. |
| Side at smallest X | Truth | False | Take away the wall at the tank's smallest X. |
| Side at largest X | Truth | False | Take away the wall at its largest X. |
| Side at smallest Y | Truth | False | Take away the wall at its smallest Y. |
| Side at largest Y | Truth | False | Take away the wall at its largest Y. |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Set Liquid Gravity
FunctionThe scene with another gravity (m/s²), pointing down along -Z; 0 is weightless.
SetLiquidGravity -> Liquid Scene Description
scene: Liquid Scene Description
gravity: NumberLiquidSceneDescription SetLiquidGravity(
LiquidSceneDescription scene,
double gravity = 9.81)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | |
| gravity | Number | 9.81 |
Returns
| result | Liquid Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation
Simulate Liquid
FunctionRuns the scene for a time and records the liquid's surface at every frame as a mesh, for the Liquid Surface node to read. A mesh of a tank of a few million particles is some hundred thousand triangles, so record few frames of a large tank (Keep Every).
SimulateLiquid -> Liquid Result
scene: Liquid Scene Description
duration: Number
framesPerSecond: Number
keepEvery: Integer
smoothing: IntegerLiquidResult SimulateLiquid(
LiquidSceneDescription scene,
double duration = 1,
double framesPerSecond = 30,
int keepEvery = 1,
int smoothing = 2)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Liquid Scene Description | — | The scene. |
| duration | Number | 1 | How long to run (s). |
| framesPerSecond | Number | 30 | Frames per second of simulated time. |
| keepEvery | Integer | 1 | Record every frame (1), every second one (2) and so on; the last frame is always recorded. |
| smoothing | Integer | 2 | How often the surface is smoothed before it is meshed: 0 keeps the particles' unevenness, 2 takes most of it out, more rounds off what is thin. |
Returns
| result | Liquid Result |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Liquid
- Package
- Physics Simulation