CesiumGS / CesiumGS/cesium

Overly restrictive assumption about ellipsoid radii being equal

Open
#12,110 1 comment 0 reactions 0 assignees View on GitHub
category - math type - enhancement
Dominant language
JavaScript
Stars
15.8k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

There are a few places in the code that make the assumption that ellipsoids are "ellipsoids of revolution", meaning that `radii.x===radii.y` must hold.

Examples (not exhaustive):

- [`UniformState.js`](https://github.com/CesiumGS/cesium/blob/0a69f67b393ba194eefb7254600811c4b712ddc0/packages/engine/Source/Renderer/UniformState.js#L1298)
- [`Ellipsoid.js`](https://github.com/CesiumGS/cesium/blob/0a69f67b393ba194eefb7254600811c4b712ddc0/packages/engine/Source/Core/Ellipsoid.js#L704)
- ... (others might be added here...)

This assumption makes sense insofar that certain computations that are "just a bit tricky" for such ellipsoids can become _really_ complicated when the assumption can _not_ be made.

But given the recent changes that generalize aspects of the ellispoid handling (e.g. the `Ellipsoid.default`) and that allow users to essentially define "arbitrary" ellipsoids, it could make sense to review the places where the assumption about `radii.x===radii.y` is made, and think about whether or how this requirement could be relaxed.

(In some cases, it might even be possible to just _no longer pose this requirement_ - but the implications and effects on the lower-level ellipsoid computations should be thought through. Maybe one could get away with some `"Warning: [...] some computations may be imprecise"` here or there, but that remains to be investigated...)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the cited locations in packages/engine/Source/Renderer/UniformState.js and packages/engine/Source/Core/Ellipsoid.js, then search for other assumptions that radii.x equals radii.y. Determine which computations can support arbitrary ellipsoids and which need a documented limitation or warning. Done means the affected cases and their supported behavior are identified and consistently handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.