[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/native-worldgen](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/index.md) / [NativeWorldgen](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/NativeWorldgen/index.md) / NativeCellProgram

# Class: NativeCellProgram

Defined in: [NativeWorldgen.ts:664](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L664)

A cell program in native memory, made by [NativeWorldgen.createCellProgram](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/NativeWorldgen/classes/NativeWorldgen.md#createcellprogram).

## Properties

### cornerCount

> `readonly` **cornerCount**: `number`

Defined in: [NativeWorldgen.ts:668](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L668)

How many corner values a fill reads: eight per interpolated cell.

***

### size

> `readonly` **size**: `number`

Defined in: [NativeWorldgen.ts:670](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L670)

How many values a fill writes: one per block of the cell.

## Methods

### destroy()

> **destroy**(): `void`

Defined in: [NativeWorldgen.ts:707](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L707)

Frees the program's native memory. Later calls throw.

#### Returns

`void`

***

### fill()

> **fill**(`corners`, `out`): `void`

Defined in: [NativeWorldgen.ts:693](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L693)

Fills `out` with the tree's value at every block of one cell, x-major, then z, then y. Hook
records take their neutral constant, so call it only for a context with no hook set.

#### Parameters

##### corners

`Float64Array`

[cornerCount](#cornercount) values: each interpolated cell's eight corners in turn.

##### out

`Float64Array`

At least [size](#size) values.

#### Returns

`void`

#### Throws

After [destroy](#destroy).

#### Throws

When a buffer is shorter than the fill.
