Divooka Reference

Weed Physics

6 nodes

On this page 6

Advance

Function

Advances an immutable snapshot by additional frames, preserving particle positions, velocities, rest lengths, fixed anchors and the original integration settings. The input snapshot remains reusable for independent branches.

Signature
Advance -> Weed Cloth Result
    state: Weed Cloth Result
    frames: Integer
WeedClothResult Advance(WeedClothResult state, int frames = 1)

Parameters

nametypedefaultdescription
stateWeed Cloth Result—
framesInteger1

Returns

resultWeed Cloth Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD

Material

Function

Constructs material values. Compliance is 1/stiffness and the stiffness-proportional damping time is damping/stiffness.

Signature
Material -> Weed Cloth Material
    stiffness: Number
    damping: Number
    particleMass: Number
    thickness: Number
    friction: Number
    restitution: Number
WeedClothMaterial Material(
    double stiffness = 1000,
    double damping = 10,
    double particleMass = 1,
    double thickness = 0.02,
    double friction = 0,
    double restitution = 0.7)

Parameters

nametypedefaultdescription
stiffnessNumber1000
dampingNumber10
particleMassNumber1
thicknessNumber0.02
frictionNumber0
restitutionNumber0.7

Returns

resultWeed Cloth Material
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD

Mesh

Function

Returns an owned preview mesh from a simulation result.

Signature
Mesh(result: Weed Cloth Result) -> Mesh
Mesh Mesh(WeedClothResult result)

Parameters

nametypedefaultdescription
resultWeed Cloth Result—

Returns

resultMesh
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD

Reset

Function

Creates a rest-state snapshot. Resetting does not retain velocities, contact state or elapsed time from a previous result.

Signature
Reset -> Weed Cloth Result
    setup: Weed Cloth Setup
    timeStep: Number
    substeps: Integer
    iterations: Integer
    settledSpeed: Number
WeedClothResult Reset(
    WeedClothSetup setup,
    double timeStep = 0.016666666666666666,
    int substeps = 10,
    int iterations = 4,
    double settledSpeed = 0.001)

Parameters

nametypedefaultdescription
setupWeed Cloth Setup—
timeStepNumber0.016666666666666666
substepsInteger10
iterationsInteger4
settledSpeedNumber0.001

Returns

resultWeed Cloth Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD

Setup

Function

Copies a cloth mesh, optional fixed vertex indices, fixed obstacle meshes and a uniform force per particle. Source coordinates are Z-up metres; no axis conversion is applied.

Signature
Setup -> Weed Cloth Setup
    mesh: Mesh
    obstacles: Mesh Array
    force: Vector3d
    material: Weed Cloth Material
    anchors: Integer Array
WeedClothSetup Setup(
    Mesh mesh,
    Mesh[] obstacles,
    Vector3d force,
    WeedClothMaterial material,
    int[] anchors)

Parameters

nametypedefaultdescription
meshMesh—
obstaclesMesh Array—
forceVector3d—
materialWeed Cloth Material—
anchorsInteger Array—

Returns

resultWeed Cloth Setup
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD

Simulate

Function

Runs deterministically from the setup's rest state for a fixed frame count. Re-evaluating resets the simulation; inputs are never mutated. A settled result requires twenty consecutive low-speed frames.

Signature
Simulate -> Weed Cloth Result
    setup: Weed Cloth Setup
    frames: Integer
    timeStep: Number
    substeps: Integer
    iterations: Integer
    settledSpeed: Number
WeedClothResult Simulate(
    WeedClothSetup setup,
    int frames = 600,
    double timeStep = 0.016666666666666666,
    int substeps = 10,
    int iterations = 4,
    double settledSpeed = 0.001)

Parameters

nametypedefaultdescription
setupWeed Cloth Setup—
framesInteger600
timeStepNumber0.016666666666666666
substepsInteger10
iterationsInteger4
settledSpeedNumber0.001

Returns

resultWeed Cloth Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Weed Physics
Package
CAD