The objectsToExclude of clampToHeight does not work at the second time

i use datum grid surface as objectsToExclude . it is normal when i calculate at first.
But it seem to the objectsToExclude does not work when i change the sample distance at the second time.
As a result, some or all of the mesh heights are in the plane.

Welcome to the Cesium community @lxydft !

You may have uncovered a bug. Can you reproduce this in Sandcastle? See: How to share custom Sandcastle examples

I tried to reproduce the problem at sandcastle.test page it’s normal when I repeat sampling at the terrainProvider with the same points.But in my project, the height of some points in the second result is wrong.Obviously, the height of some points in the second result is the height of the plane used.
Maybe it’s the tilt model I used.0.0

Perhaps it’s the 3D Tileset causing the bug? You can test your 3D Tiles in Sandcastle by uploading it to Cesium ion ( or you can use one of the asset depot datasets like the Melbourne photogrammetry: