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: