3D-City Model
    Preparing search index...

    ExcavationPit – Represents a 3D excavation (pit/trench) visualization in a Cesium scene.

    Handles polygon and wall generation, height/depth calculations, subsampling for accurate terrain following, and manages Cesium entities plus global/layer clipping polygons for rendering excavation pits.

    Cesium application/viewer instance.

    Unique identifier for this pit.

    Optional user-facing name for the pit.

    3D cartesian coordinates of the pit polygon.

    Depth (vertical offset) below the maximum Z for the pit.

    Show/hide pit on creation.

    Edge sampling spacing (meters) for accurate terrain following.

    Color to use for pit walls and fill.

    Callback to run after initialization.

    update() - (async) Prepare terrain, perform subsampling, setup wall and polygon entities and clipping.

    subsample() - (async) Subdivide polygon edges, sample precise heights from terrain.

    updateEntity() - Update or create Cesium polygon and wall entities for pit.

    clear() - Remove/clear all globally/layer-applied clipping polygons for this pit.

    destroy() - Remove all visualizations and clipping from the app.

    const pit = new ExcavationPit(app, {cartesians: coords, depth: 10, name: 'Pit A'});
    await pit.update();
    pit.show = false; // Hide pit
    pit.depth = 15; // Adjust and rerender
    Index

    Constructors

    Properties

    afterInitCallback: any
    app: any

    Application/viewer reference.

    approxSpacing: any

    Spacing for subsampling terrain.

    clippingPolygon: undefined | ClippingPolygon
    id: any

    Unique pit id.

    initialized: boolean

    True after pit entities and clipping have been created.

    name: any

    Human-readable name.

    pitColor: any

    Main color used for pit fill/wall.

    Accessors

    • get cartesians(): Cartesian3[]

      Main polygon coordinate array (mutable). Triggers resampling when set.

      Returns Cartesian3[]

    • set cartesians(cartesians: Cartesian3[]): void

      Parameters

      • cartesians: Cartesian3[]

      Returns void

    Methods

    • Destroys all Cesium entities and removes pit's clipping polygons from the scene.

      Returns void

    • Subdivides edges of the input polygon, samples new heights from terrain for full accuracy. Populates cartesian and cartographic sample arrays, minZ and maxZ.

      Returns Promise<void>

    • Main async update: fetches terrain, samples polygon, sets up Cesium entities and clipping. Calls afterInitCallback() on completion.

      Returns Promise<void>

    • Update or (re)create the Cesium polygon and wall entities for this pit, using the latest subsampled heights/z-values.

      Returns void