Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue in rhumb arc polylines #8787

Merged
merged 7 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
##### Fixes :wrench:

- Fixed error with `WallGeoemtry` when there were adjacent positions with very close values [#8952](https://github.com/CesiumGS/cesium/pull/8952)
- Fixed a bug where certain rhumb arc polylines would lead to a crash. [#8787](https://github.com/CesiumGS/cesium/pull/8787)

### 1.70.1 - 2020-06-10

Expand Down
9 changes: 4 additions & 5 deletions Source/Core/PolylinePipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,15 @@ function generateCartesianRhumbArc(
array,
offset
) {
var first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
var last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
var start = ellipsoid.cartesianToCartographic(first, carto1);
var end = ellipsoid.cartesianToCartographic(last, carto2);

var start = ellipsoid.cartesianToCartographic(p0, carto1);
var end = ellipsoid.cartesianToCartographic(p1, carto2);
var numPoints = PolylinePipeline.numberOfPointsRhumbLine(
start,
end,
granularity
);
start.height = 0.0;
end.height = 0.0;
var heights = subdivideHeights(numPoints, h0, h1);

if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {
Expand Down
9 changes: 9 additions & 0 deletions Specs/Core/PolylinePipelineSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,13 @@ describe("Core/PolylinePipeline", function () {
expect(newPositions.length).toEqual(3);
expect(newPositions).toEqual([0, 0, 1]);
});

it("generateRhumbArc return values for each position", function () {
var newPositions = PolylinePipeline.generateRhumbArc({
positions: Cartesian3.fromDegreesArray([0, 0, 10, 0, 10, 5]),
});
for (let i = 0; i < newPositions.length; i++) {
expect(newPositions[i]).toBeDefined();
}
});
});