PolylineVolumeGeometry crashes with large granularity
Open
Nobody has claimed this yet.
category - graphics
type - bug
- Dominant language
- JavaScript
- Stars
- 15.8k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
The following code snippet results in an 'Invalid array length' crash in PolylinePipeline.generateArc. This crash does not happen when using granularity: Cesium.Math.PI.
var viewer = new Cesium.Viewer('cesiumContainer');
function computeCircle(radius) {
var positions = [];
for (var i = 0; i < 360; i++) {
var radians = Cesium.Math.toRadians(i);
positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
}
return positions;
}
viewer.entities.add({
polylineVolume : {
positions : Cesium.Cartesian3.fromDegreesArray([-85.0, 32.0,
-105.0, 32.0]),
shape : computeCircle(60000.0),
material : Cesium.Color.RED,
granularity: Cesium.Math.TWO_PI
}
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied PolylineVolumeGeometry example with granularity set to Cesium.Math.TWO_PI, then inspect PolylinePipeline.generateArc where the Invalid array length crash occurs. Trace the large-granularity path and verify that the example completes without the crash, ideally with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100