Home Reference Source
import {HermiteData} from 'rabbit-hole'
public class | source

HermiteData

Hermite data.

Static Member Summary

Static Public Members
public static get

The global isovalue.

public static set

Warning: changing the isovalue is not recommended.

public static get

The material grid resolution.

public static set

Warning: this value should only be set once.

Constructor Summary

Public Constructor
public

constructor(initialize: Boolean)

Constructs a new set of Hermite data.

Member Summary

Public Members
public get

Indicates whether this data is currently compressed.

public

The edge data.

public get

Indicates whether this data container is empty.

public get

Indicates whether this data container is full.

public

The grid points.

public

Describes how many material indices are currently solid:

public get

Indicates whether this data is currently gone.

public

Run-length compression data.

Method Summary

Public Methods
public

Removes all data.

public

Compresses this data.

public

createTransferList(transferList: Array): Transferable[]

Creates a list of transferable items.

public

Decompresses this data.

public

Adopts the given serialised data.

public

serialize(deflate: Boolean): Object

Serialises this data.

public

Adopts the given data.

public

setMaterialIndex(index: Number, value: Number)

Sets the specified material index.

Static Public Members

public static get isovalue: Number source

The global isovalue.

A constant distance value that denotes the boundaries of SDFs.

public static set isovalue: Number source

Warning: changing the isovalue is not recommended.

public static get resolution: Number source

The material grid resolution.

The effective resolution of a chunk of Hermite data is the distance between two adjacent grid points with respect to the size of the containing world octant.

public static set resolution: Number source

Warning: this value should only be set once.

The upper limit is 256.

Public Constructors

public constructor(initialize: Boolean) source

Constructs a new set of Hermite data.

Params:

NameTypeAttributeDescription
initialize Boolean
  • optional
  • default: true

Whether the data should be initialised immediately.

Public Members

public get compressed: Boolean source

Indicates whether this data is currently compressed.

public edgeData: EdgeData source

The edge data.

public get empty: Boolean source

Indicates whether this data container is empty.

public get full: Boolean source

Indicates whether this data container is full.

public materialIndices: Uint8Array source

The grid points.

public materials: Number source

Describes how many material indices are currently solid:

  • The chunk lies outside the volume if there are no solid grid points.
  • The chunk lies completely inside the volume if all points are solid.

public get neutered: Boolean source

Indicates whether this data is currently gone.

public runLengths: Uint32Array source

Run-length compression data.

Public Methods

public clear(): HermiteData source

Removes all data.

Return:

HermiteData

This data.

public compress(target: HermiteData): HermiteData source

Compresses this data.

Params:

NameTypeAttributeDescription
target HermiteData
  • optional
  • default: this

A target data set. The compressed data will be assigned to this set.

Return:

HermiteData

The target data set.

public createTransferList(transferList: Array): Transferable[] source

Creates a list of transferable items.

Params:

NameTypeAttributeDescription
transferList Array
  • optional

An optional target list. The transferable items will be added to this list.

Return:

Transferable[]

The transfer list.

public decompress(target: HermiteData): HermiteData source

Decompresses this data.

Params:

NameTypeAttributeDescription
target HermiteData
  • optional
  • default: this

A target data set. If none is provided, the compressed data will be replaced with the decompressed data.

Return:

HermiteData

The target data set.

public deserialize(object: Object): Deserializable source

Adopts the given serialised data.

Params:

NameTypeAttributeDescription
object Object

Serialised Hermite data. Can be null.

Return:

Deserializable

This object or null if the given serialised data was null.

public serialize(deflate: Boolean): Object source

Serialises this data.

Params:

NameTypeAttributeDescription
deflate Boolean
  • optional
  • default: false

Whether the data should be compressed if possible.

Return:

Object

The serialised data.

public set(data: HermiteData): HermiteData source

Adopts the given data.

Params:

NameTypeAttributeDescription
data HermiteData

The data to adopt.

Return:

HermiteData

This data.

public setMaterialIndex(index: Number, value: Number) source

Sets the specified material index.

Params:

NameTypeAttributeDescription
index Number

The index of the material index that should be updated.

value Number

The new material index.