var tileAvailability = that._viewer.terrainProvider.availability;
var maxLevel = 0;
var minHeight = 15000;
for (var i = 0; i < this._positions.length; i++) {
var cartographic = Cesium.Cartographic.fromCartesian(this._positions[i]);
var height = this._scene.globe.getHeight(cartographic);
if (minHeight > height) minHeight = height;
var level = tileAvailability.computeMaximumLevelAtPosition(cartographic);
if (maxLevel < level) maxLevel = level;
Hi @Bikash_Ranjan_Mallic , What are you assigning in this and that ? It seems like you are getting error on retrieving height of terrain at certain location. You should go with sampleTerrainMostDetailed to calculate terrain height.
It would be easy to understand with the help of sandcastle example.
It’s not easy to understand the issue without study the source code. Cut/Fill Analysis is not the inbuilt feature in cesiumjs. Please create a sandcastle example or share the source code.
There can be one reason, you are trying to get terrainProvider availability before it gets ready. Check the documentation for detail.