How to know if a line segment covers 3DTiles?

It is easy to draw a two-points segment line using Entity API:

viewer.entities.add({
  id: 'segment-line',
  polyline: {
    positions: new Cesium.ConstantProperty([cartesian1, cartesian2]),
    material: new Cesium.PolylineOutlineMaterialProperty({
      // ...
    }),
  }
})

Then I add a 3DTileset:

const tileset = await Cesium.Cesium3DTileset.fromUrl('path/to/tileset.json')
viewer.scene.primitives.add(tileset)

I want to know wheather the segment line is covering the tileset or not, but using start point and end point to drillpick the scene is not a good idea, because it is possible that the starting and ending points are outside the range of tileset, but the middle part actually crosses tileset.

Like this:

What is the definition of the “cover”? In the case as shown in the figure, I think pick API can do it.

“cover” can be simply understood as the similar effect of setting the entity.polyline.classificationType to ClassificationType.CESIUM_3D_TILE, that is, the line segment project on 3dtiles’ surface.