brepjs API Reference
    Preparing search index...

    Interface SdfHandle

    A disposable handle around an analytic SDF expression. Every combinator clones into a NEW wasm node and returns a NEW handle (the wasm Sdf is a value, not a mutable builder), so an SdfHandle is immutable — the receiver stays valid and must be disposed independently. rasterize produces a banded-SDF VoxelFieldHandle you can boolean / offset / shell / contour.

    Dispose is mandatory: use using, or call [Symbol.dispose](), to free the WASM expression tree. Intermediate handles in a chain (a.union(b).shell(t)) each own a wasm allocation; bind them to using or dispose them explicitly.

    interface SdfHandle {
        disposed: boolean;
        value: WasmSdf;
        "[dispose]"(): void;
        difference(other: SdfHandle): SdfHandle;
        intersection(other: SdfHandle): SdfHandle;
        offset(distance: number): SdfHandle;
        offsetField(field: ScalarFieldHandle): SdfHandle;
        onion(thickness: number): SdfHandle;
        rasterize(opts?: VoxelFieldOptions): Result<VoxelFieldHandle>;
        rasterizeIn(
            bounds: SdfBounds,
            opts?: VoxelFieldOptions,
        ): Result<VoxelFieldHandle>;
        rotate(ax: number, ay: number, az: number, angle: number): SdfHandle;
        round(radius: number): SdfHandle;
        roundField(field: ScalarFieldHandle): SdfHandle;
        scale(s: number): SdfHandle;
        shell(thickness: number): SdfHandle;
        shellField(field: ScalarFieldHandle): SdfHandle;
        smoothDifference(other: SdfHandle, k: number): SdfHandle;
        smoothIntersection(other: SdfHandle, k: number): SdfHandle;
        smoothUnion(other: SdfHandle, k: number): SdfHandle;
        smoothUnionField(other: SdfHandle, field: ScalarFieldHandle): SdfHandle;
        translate(x: number, y: number, z: number): SdfHandle;
        union(other: SdfHandle): SdfHandle;
    }
    Index

    Properties

    disposed: boolean

    Whether the backing WASM expression has been freed.

    value: WasmSdf

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

    Methods