Parent Cesium app/viewer context.
Optional
options: object = {}Application/viewer reference.
Spacing for subsampling terrain.
Unique pit id.
True after pit entities and clipping have been created.
Human-readable name.
Main color used for pit fill/wall.
Main polygon coordinate array (mutable). Triggers resampling when set.
Get the maximum Z of the current (sampled) polygon.
Get the minimum Z of the current (sampled) polygon.
The vertical depth "cut" of the excavation.
Show/hide the pit (entities and active clipping polygons).
Removes clipping polygons (pit edges) from the globe and all mesh layers.
Destroys all Cesium entities and removes pit's clipping polygons from the scene.
Update or (re)create the Cesium polygon and wall entities for this pit, using the latest subsampled heights/z-values.
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.
Param: app
Cesium application/viewer instance.
Param: options
Param: options.id
Unique identifier for this pit.
Param: options.name
Optional user-facing name for the pit.
Param: options.cartesians
3D cartesian coordinates of the pit polygon.
Param: options.depth
Depth (vertical offset) below the maximum Z for the pit.
Param: options.show
Show/hide pit on creation.
Param: options.approxSpacing
Edge sampling spacing (meters) for accurate terrain following.
Param: options.pitColor
Color to use for pit walls and fill.
Param: options.afterInitCallback
Callback to run after initialization.
Method
update() - (async) Prepare terrain, perform subsampling, setup wall and polygon entities and clipping.
Method
subsample() - (async) Subdivide polygon edges, sample precise heights from terrain.
Method
updateEntity() - Update or create Cesium polygon and wall entities for pit.
Method
clear() - Remove/clear all globally/layer-applied clipping polygons for this pit.
Method
destroy() - Remove all visualizations and clipping from the app.
Example