nape-js API
    Preparing search index...

    Class MarchingSquares

    Isosurface extraction using the marching squares algorithm.

    Static utility class — all functionality is in the run() method.

    Converted from nape-compiled.js lines 16879–17258.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Run the marching squares algorithm to extract polygons from an iso function.

      Parameters

      • iso: (x: number, y: number) => number

        Iso function (x: number, y: number) => number. Negative values are "inside", positive are "outside".

      • bounds: AABB

        AABB defining the region to extract surfaces from.

      • cellsize: Vec2

        Vec2 defining cell dimensions. Auto-disposed if weak.

      • quality: number = 2

        Interpolation quality (default 2). Must be >= 0.

      • subgrid: Vec2 | null = null

        Optional Vec2 for sub-grid partitioning. Auto-disposed if weak.

      • combine: boolean = true

        Whether to combine adjacent polygons (default true).

      • output: any = null

        Optional GeomPolyList to populate. If null, a new one is created.

      Returns any

      The populated GeomPolyList.