voronoid WASM API
    Preparing search index...

    Class Tessellation3D

    Index

    Constructors

    • Creates a new 3D tessellation.

      Parameters

      • bounds: BoundingBox3D

        The bounding box of the simulation.

      • nx: number

        The number of grid bins in the x direction.

      • ny: number

        The number of grid bins in the y direction.

      • nz: number

        The number of grid bins in the z direction.

      Returns Tessellation3D

    Properties

    cells: Cell3D[]

    Returns all cells.

    count_cells: number

    Returns the number of computed cells.

    count_generators: number

    Returns the number of generators.

    generators: Float64Array

    Returns all generators as a flat array.

    prune_log: Int32Array

    Returns the prune log as a flat array [cell_id, neighbor_id, wall_id, ...].

    prune_pos_log: Float64Array

    Returns the intermediate generator positions from the prune log as a flat array [x, y, z, ...].

    seal_log: Int32Array

    Returns the seal log as a flat array [cell_id, neighbor_id, wall_id, ...].

    Methods

    • Returns void

    • Adds a wall to the tessellation.

      Parameters

      Returns void

    • Calculates the Voronoi tessellation.

      Returns void

    • Calculates the Voronoi tessellation and seals the boundaries.

      Returns void

    • Removes all walls.

      Returns void

    • Returns void

    • Gets a cell by index.

      Parameters

      • index: number

      Returns Cell3D | undefined

    • Gets a generator's position by index.

      Parameters

      • index: number

      Returns Float64Array

    • Runs a post-processing pass to prune the cell faces at the boundaries.

      Returns void

    • Generates random points within the bounds and walls.

      Parameters

      • count: number

      Returns void

    • Reads generators from a string representation.

      Each line should contain an ID followed by coordinates (e.g., "id x y z").

      Parameters

      • input: string

      Returns void

    • Performs one step of Lloyd's relaxation to smooth the cell distribution.

      Returns void

    • Updates a specific generator's position.

      Parameters

      • index: number
      • x: number
      • y: number
      • z: number

      Returns void

    • Sets the generator points.

      Parameters

      • generators: Float64Array

        A flat array of coordinates [x0, y0, z0, x1, y1, z1, ...].

      Returns void