Taos API Reference
    Preparing search index...

    Interface PolygonBakeOptions

    interface PolygonBakeOptions {
        baseHeight?: number;
        extrudeHeight?: NumberSpec;
        color?: ColorSpec;
        heightAt?: HeightSampler;
        drapePerVertex?: boolean;
        subdivideMeters?: number;
        collectFeatures?: { ids: number[]; props: GeoProperties[] };
    }
    Index

    Properties

    baseHeight?: number

    Base height (m above the ground / ellipsoid) of the fill or the wall bottom. Default 0.

    extrudeHeight?: NumberSpec

    Extrude each polygon to this absolute height (m above ground) → vertical walls + a roof cap. A number, or a per-feature function; undefined / ≤ base means a flat fill.

    color?: ColorSpec

    Fill / roof color (linear RGB), constant or per-feature. Default white.

    heightAt?: HeightSampler

    Drape onto streamed terrain: height (m) at a lon/lat, added to baseHeight.

    drapePerVertex?: boolean

    Sample the terrain at every fill vertex (not just the centroid), so a flat fill follows the ground under each vertex instead of sitting at one height. Only affects non-extruded fills (a roof cap stays flat). Implied by subdivideMeters. Needs heightAt; without it, has no effect. Default false (centroid — cheapest, stable for small features). See [[terrain-vector-drape]].

    subdivideMeters?: number

    Re-mesh a non-extruded fill on a metric grid of roughly this spacing (m) — clipped to the polygon (holes respected) and draped per grid vertex — so the surface conforms to terrain relief instead of chording across it between the input vertices. Undefined (default) = triangulate the raw outline only. Total cells are capped, so a huge polygon at fine spacing coarsens rather than exploding. Pairs with a small PbrMaterial.depthBias (set via the layer style) to avoid Z-fighting against terrain.

    collectFeatures?: { ids: number[]; props: GeoProperties[] }

    When set, the builder records — for CPU picking — one feature id per emitted vertex (incrementing per polygon) into ids, and that polygon's properties into props (so props[id] is the hit feature's bag). ids aligns 1:1 with the result's vertices.