brepjs API Reference
    Preparing search index...

    Interface VoxelFieldHandle

    A persistent, disposable voxel field. Carries the wrapped WASM field as value and a fluent op-chain (.boolean().offset().shell().contour()) that throws on the rare WASM error (mirroring the shape() facade's throw-on-Err convention), so a using-scoped chain reads cleanly:

    using field = voxelField(meshA).unwrap();
    using other = voxelField(meshB).unwrap();
    const mesh = field.boolean(other, 'union').offset(2).contour();

    Dispose is mandatory (FinalizationRegistry is an unreliable safety net): use using, or call [Symbol.dispose]() explicitly, to free the WASM grid.

    interface VoxelFieldHandle {
        disposed: boolean;
        value: WasmVoxelField;
        "[dispose]"(): void;
        boolean(other: VoxelFieldHandle, op: VoxelBooleanOp): VoxelFieldHandle;
        contour(): KernelMeshResult;
        offset(distance: number): VoxelFieldHandle;
        reinit(): VoxelFieldHandle;
        shell(thickness: number): VoxelFieldHandle;
    }
    Index

    Properties

    disposed: boolean

    Whether the backing WASM grid has been freed.

    value: WasmVoxelField

    The wrapped WASM field. Throws if the handle has been disposed.

    Methods

    • Surface-Nets contour the current field to a mesh (the field stays alive).

      Returns KernelMeshResult