[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) / NativeNoiseStack

# Class: NativeNoiseStack

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

An octave stack in native memory, made by [NativeWorldgen.createStack](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/NativeWorldgen/classes/NativeWorldgen.md#createstack).

## Accessors

### nativeHandle

#### Get Signature

> **get** **nativeHandle**(): `number`

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

The stack's handle, for a native program that samples it. It stays valid until
[destroy](#destroy), so keep this stack alive while a program names it.

##### Returns

`number`

## Methods

### destroy()

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

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

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

#### Returns

`void`

***

### fill()

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

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

Fills `out[i]` with the value at `xyz[3i]`, `xyz[3i + 1]`, `xyz[3i + 2]`, in one call. The
two may be views of the same memory.

#### Parameters

##### xyz

`Float64Array`

The positions, three coordinates each.

##### out

`Float64Array`

Where the values go; positions beyond its length are not sampled.

#### Returns

`void`

#### Throws

After [destroy](#destroy).

***

### get3()

> **get3**(`x`, `y`, `z`): `number`

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

The stack's value at one position.

#### Parameters

##### x

`number`

##### y

`number`

##### z

`number`

#### Returns

`number`

The sum of the octaves, rounded to single precision as `NoiseStack.get3` rounds it.

#### Throws

After [destroy](#destroy).
