How to implement this sensor in Cesium JS?

The conicsensor seems to have no minrange parameter? How to implement a sensor with a spherical void inside?

Hey @earth38324, welcome to the forum!

I believe you’re using a third-party sensor library for the conic sensor. The official CesiumGS/cesium-sensors plugin was archived back in 2020 (last commit ~9 years ago), so if you’re using a fork or community-maintained version, the API surface may differ from what’s documented.

I’m not aware of a built-in minRange property in ConicSensorGraphics - the standard implementation controls the outer cone geometry only, without support for an inner exclusion radius. That said, various forks have extended the API in different ways.

Could you share which package and version you’re using? Your best bet would be to reach out to the maintainers of that specific library to ask whether they support a minrange parameter, or whether they’d accept a feature request for one. They’ll have the most context on what’s feasible within their geometry pipeline.

Cheers!

I saw that someone else had implemented this feature, but I can only get his build version. However, I found that using an ellipsoid can achieve a similar shape, but the grid lines become messed up.

let minrange = 350000;

viewer.entities.add({

name: "inside",

position: center,

ellipsoid: {

  radii: new Cesium.Cartesian3(minrange, minrange, minrange),

  innerRadii: new Cesium.Cartesian3(100000, 100000, 100000),

  minimumCone: Cesium.Math.toRadians(10),

  maximumCone: Cesium.Math.PI_OVER_TWO,                       

  minimumClock: Cesium.Math.toRadians(-100),                   

  maximumClock: Cesium.Math.toRadians(100),           

  material: new Cesium.GridMaterialProperty({

    color: Cesium.Color.CYAN.withAlpha(0.8),

    cellAlpha: 0.35,

    lineCount: new Cesium.Cartesian2(20, 20),

    lineThickness: new Cesium.Cartesian2(2.0, 2.0),

  }),

  outline: false,

}

});