Skip to content

Crystallization API

Crystallization

Extends Effect.

Factory Function

typescript
createCrystallization(config?: CrystallizationConfig)

Methods

See Effect for the full method reference.


CrystallizationConfig

typescript
interface CrystallizationConfig {
    branchAngle?: number;
    color?: string;
    maxDepth?: number;
    scale?: number;
    seeds?: number;
    speed?: number;
}
PropertyTypeDefaultDescription
branchAnglenumber60Angle in degrees at which branches split.
colorstring'#88ccff'Base color of the crystal branches.
maxDepthnumber5Maximum recursion depth for branching.
scalenumber1Scales all sizes proportionally.
seedsnumber5Number of seed points.
speednumber1Growth speed multiplier.

CrystalBranch

typescript
interface CrystalBranch {
    angle: number;
    depth: number;
    length: number;
    progress: number;
    x: number;
    y: number;
}

CrystalSeed

typescript
interface CrystalSeed {
    branches: CrystalBranch[];
    x: number;
    y: number;
}