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

Add Rhumb Line Support to Polygon and Polyline Geometries #7492

Merged
merged 27 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f473014
Initial implementation of using rhumb lines limited to PolygonGeometry
shehzan10 Jan 8, 2019
ba3a6dc
Rhumb lines working on PolygonGeometry with geojson load
shehzan10 Jan 8, 2019
0248d9e
Add enum for LineType.STRAIGHT
shehzan10 Jan 14, 2019
f90b6d4
Add rhumb line support to polygon and polyline geometry with extrude …
shehzan10 Jan 14, 2019
5be47b2
Add lineType support to GeoJsonDataSource
shehzan10 Jan 14, 2019
7c60e88
Add rhumb line support to GroundPolylineGeometry
shehzan10 Jan 14, 2019
d9db99a
Rename EllipsoidRhumb -> EllipsoidRhumbLine
shehzan10 Jan 15, 2019
6362be5
Fix GroundPolylineGeometry across PM and IDL, Add granularity, lineTy…
shehzan10 Jan 15, 2019
4c2141d
Add tests for all the classes where LineType is used
shehzan10 Jan 16, 2019
9cbc248
Remove usage of EllipsoidRhumbLine.fromStartAndEnd
shehzan10 Jan 17, 2019
851a21e
Fix propagation of lineType from shadow volume
shehzan10 Jan 17, 2019
39e6d95
Add rhumb line polygons and polylines to sandcastle examples
shehzan10 Jan 17, 2019
739eb52
Update CHANGES.md
shehzan10 Jan 18, 2019
62b28a8
Fix tests failing because of ground primitives
shehzan10 Jan 18, 2019
2745a2d
Revert inadvertent change to sandcastle
shehzan10 Jan 18, 2019
0f4e088
Merge remote-tracking branch 'upstream' into rhumb-lines
shehzan10 Jan 21, 2019
9ee96b7
Add PR numbers to CHANGES.md
shehzan10 Jan 21, 2019
a47ebd1
Fixes from PR comments
shehzan10 Jan 22, 2019
1dcdbe2
Some more fixes from PR review
shehzan10 Jan 23, 2019
1883350
Check polyline difference after update
shehzan10 Jan 23, 2019
6584a8f
Typo
shehzan10 Jan 23, 2019
b2e70ed
Remove lineType option from GeoJsonDataSource. Always uses RHUMB lines
shehzan10 Jan 23, 2019
81b2ecb
Add checks for invalid lineType option, cleaner checks in constructors
shehzan10 Jan 23, 2019
ce9f96b
Better desciption of changing followSurface to lineType in CHANGES.md
shehzan10 Jan 23, 2019
96d25d5
Change LineType to ArcType, LineType.STRAIGHT to ArcType.NONE
shehzan10 Jan 24, 2019
763aa70
Fix ordering of defines for ArcType
shehzan10 Jan 24, 2019
5f7a7ac
Fixes for PR comments: Remove followSurface from doc, remove redundan…
shehzan10 Jan 24, 2019
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
15 changes: 15 additions & 0 deletions Apps/Sandcastle/gallery/Polygon.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@
}
});

var purplePolygonUsingRhumbLines = viewer.entities.add({
name : 'Purple polygon using rhumb lines with outline',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-120.0, 45.0,
-80.0, 45.0,
-80.0, 55.0,
-120.0, 55.0]),
extrudedHeight: 50000,
material : Cesium.Color.PURPLE,
outline : true,
outlineColor : Cesium.Color.MAGENTA,
lineType : Cesium.LineType.RHUMB
}
});

viewer.zoomTo(viewer.entities);//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
13 changes: 12 additions & 1 deletion Apps/Sandcastle/gallery/Polyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
}
});

var greenRhumbLine = viewer.entities.add({
name : 'Green rhumb line',
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,
-125, 35]),
width : 5,
lineType : Cesium.LineType.RHUMB,
material : Cesium.Color.GREEN
}
});

var glowingLine = viewer.entities.add({
name : 'Glowing blue line on the surface',
polyline : {
Expand Down Expand Up @@ -73,7 +84,7 @@
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 43, 500000,
-125, 43, 500000]),
width : 10,
followSurface : false,
lineType : Cesium.LineType.STRAIGHT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At demo day, didn't we talk about coming up with a better name than STRAIGHT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can think of DIRECT. Do you have any suggestions?

I do think STRAIGHT is a fair option since the enum is LineType, so we get Geodesic line, Rhumb line and Straight line.

Anyone else have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer STRAIGHT, why do we think it would be confusing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the enum name itself, LineType is open to change. As I wrote in the PR description, options I can think of are CurveType PathType.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only idea is something super pedantic like NOT_CURVED_TO_ELLIPSOID_SURFACE lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel super strongly, but I thought it was something Patrick pointed out during demo day

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ArcType GEODESIC RHUMB or NONE?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rhumb lines are straight only in a Mercator projection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ ^ ^
Proof that "STRAIGHT" is confusing. @GatorScott in this case we were using 'STRAIGHT' for a line with neither rhumb or geodesic subdivision that connects two points in space. ie a line from the ground to a satellite.

I'm in favor of switching to my suggestion above: ArcType GEODESIC RHUMB or NONE

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against the proposed ArcType enum and values, I tried to google around and didn't see anything anyone else was already doing that we could reference.

material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.PURPLE)
}
});
Expand Down
21 changes: 21 additions & 0 deletions Apps/Sandcastle/gallery/development/Ground Primitive.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
terrainProvider: Cesium.createWorldTerrain()
});
var scene = viewer.scene;
viewer.extend(Cesium.viewerCesiumInspectorMixin);

function offsetPositions(positions, degreeOffset) {
positions = scene.globe.ellipsoid.cartesianArrayToCartographicArray(positions);
Expand Down Expand Up @@ -325,6 +326,26 @@
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Rhumb line polygon geometry
scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([
-130, 55,
-100, 55,
-100, 45,
-130, 45
])),
lineType : Cesium.LineType.RHUMB
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 0.0, 0.5))
},
id : 'rhumbPolygon'
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));
});

Sandcastle.reset = function() {
Expand Down
14 changes: 14 additions & 0 deletions Apps/Sandcastle/gallery/development/Polylines.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@
})
});
Sandcastle.declare(fadingPolyline); // For highlighting on mouseover in Sandcastle.

// A rhumb line with two points.
var rhumbLine = polylines.add({
positions : Cesium.PolylinePipeline.generateCartesianRhumbArc({
positions : Cesium.Cartesian3.fromDegreesArray([-130.0, 30.0,
-75.0, 30.0])
}),
width: 5,
material : Cesium.Material.fromType('Color', {
color : new Cesium.Color(0.0, 1.0, 0.0, 1.0)
})
});
Sandcastle.declare(rhumbLine); // For highlighting on mouseover in Sandcastle.

}

var viewer = new Cesium.Viewer('cesiumContainer');
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Change Log

##### Deprecated :hourglass_flowing_sand:
* `Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. The previous function definition will no longer work in 1.56. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
* `PolylineGeometry.followSurface` has been superceded by `PolylineGeometry.lineType`. The previous definition will no longer work in 1.55.
shehzan10 marked this conversation as resolved.
Show resolved Hide resolved
* `SimplePolylineGeometry.followSurface` has been superceded by `SimplePolylineGeometry.lineType`. The previous definition will no longer work in 1.55.

##### Additions :tada:
* Added support for textured ground entities (entities with unspecified `height`) and `GroundPrimitives` on 3D Tiles. [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434)
Expand All @@ -17,6 +19,7 @@ Change Log
* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/AnalyticalGraphicsInc/cesium/pull/7361)
* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/AnalyticalGraphicsInc/cesium/pull/7484)
* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)

##### Fixes :wrench:
* Fixed 3D Tiles performance regression. [#7482](https://github.com/AnalyticalGraphicsInc/cesium/pull/7482)
Expand All @@ -28,6 +31,7 @@ Change Log
* Fixed Sandcastle's "Open in New Window" button not displaying imagery due to blob URI limitations. [#7250](https://github.com/AnalyticalGraphicsInc/cesium/pull/7250)
* Fixed an issue where setting `scene.globe.cartographicLimitRectangle` to `undefined` would cause a crash. [#7477](https://github.com/AnalyticalGraphicsInc/cesium/issues/7477)
* Fixed `PrimitiveCollection.removeAll` to no longer `contain` removed primitives. [#7491](https://github.com/AnalyticalGraphicsInc/cesium/pull/7491)
* Fixed `GeoJsonDataSource` to use polygons and polylines that use rhumb lines. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)

### 1.53 - 2019-01-02

Expand Down
83 changes: 73 additions & 10 deletions Source/Core/GroundPolylineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ define([
'./defineProperties',
'./Ellipsoid',
'./EllipsoidGeodesic',
'./EllipsoidRhumbLine',
'./EncodedCartesian3',
'./GeographicProjection',
'./Geometry',
'./GeometryAttribute',
'./IntersectionTests',
'./LineType',
'./Matrix3',
'./Plane',
'./Quaternion',
Expand All @@ -38,11 +40,13 @@ define([
defineProperties,
Ellipsoid,
EllipsoidGeodesic,
EllipsoidRhumbLine,
EncodedCartesian3,
GeographicProjection,
Geometry,
GeometryAttribute,
IntersectionTests,
LineType,
Matrix3,
Plane,
Quaternion,
Expand Down Expand Up @@ -80,6 +84,7 @@ define([
* @param {Number} [options.width=1.0] The screen space width in pixels.
* @param {Number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
* @param {Boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
* @param {LineType} [options.lineType=LineType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link LineType.GEODESIC} and {@link LineType.RHUMB}.
*
* @exception {DeveloperError} At least two positions are required.
*
Expand All @@ -104,6 +109,9 @@ define([
if ((!defined(positions)) || (positions.length < 2)) {
throw new DeveloperError('At least two positions are required.');
}
if (defined(options.lineType) && options.lineType === LineType.STRAIGHT) {
throw new DeveloperError('Only Geodesic and Rhumb line types are supported.');
}
//>>includeEnd('debug');

/**
Expand All @@ -130,6 +138,13 @@ define([
*/
this.loop = defaultValue(options.loop, false);

/**
* The type of path the polyline must follow. Valid options are {@link LineType.GEODESIC} and {@link LineType.RHUMB}.
* @type {LineType}
* @default LineType.GEODESIC
*/
this.lineType = defaultValue(options.lineType, LineType.GEODESIC);

this._ellipsoid = Ellipsoid.WGS84;

// MapProjections can't be packed, so store the index to a known MapProjection.
Expand All @@ -150,7 +165,7 @@ define([
*/
packedLength: {
get: function() {
return 1.0 + this._positions.length * 3 + 1.0 + 1.0 + Ellipsoid.packedLength + 1.0 + 1.0;
return 1.0 + this._positions.length * 3 + 1.0 + 1.0 + 1.0 + Ellipsoid.packedLength + 1.0 + 1.0;
}
}
});
Expand Down Expand Up @@ -195,12 +210,19 @@ define([
var interpolatedBottomScratch = new Cartesian3();
var interpolatedTopScratch = new Cartesian3();
var interpolatedNormalScratch = new Cartesian3();
function interpolateSegment(start, end, minHeight, maxHeight, granularity, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray) {
function interpolateSegment(start, end, minHeight, maxHeight, granularity, lineType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray) {
if (granularity === 0.0) {
return;
}
var ellipsoidGeodesic = new EllipsoidGeodesic(start, end, ellipsoid);
var surfaceDistance = ellipsoidGeodesic.surfaceDistance;

var ellipsoidLine;
if (lineType === LineType.GEODESIC) {
ellipsoidLine = new EllipsoidGeodesic(start, end, ellipsoid);
} else if (lineType === LineType.RHUMB) {
shehzan10 marked this conversation as resolved.
Show resolved Hide resolved
ellipsoidLine = new EllipsoidRhumbLine(start, end, ellipsoid);
}

var surfaceDistance = ellipsoidLine.surfaceDistance;
if (surfaceDistance < granularity) {
return;
}
Expand All @@ -214,7 +236,7 @@ define([
var pointsToAdd = segments - 1;
var packIndex = normalsArray.length;
for (var i = 0; i < pointsToAdd; i++) {
var interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(distanceFromStart, interpolatedCartographicScratch);
var interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(distanceFromStart, interpolatedCartographicScratch);
var interpolatedBottom = getPosition(ellipsoid, interpolatedCartographic, minHeight, interpolatedBottomScratch);
var interpolatedTop = getPosition(ellipsoid, interpolatedCartographic, maxHeight, interpolatedTopScratch);

Expand Down Expand Up @@ -266,6 +288,7 @@ define([

array[index++] = value.granularity;
array[index++] = value.loop ? 1.0 : 0.0;
array[index++] = value.lineType;

Ellipsoid.pack(value._ellipsoid, array, index);
index += Ellipsoid.packedLength;
Expand Down Expand Up @@ -299,6 +322,7 @@ define([

var granularity = array[index++];
var loop = array[index++] === 1.0;
var lineType = array[index++];

var ellipsoid = Ellipsoid.unpack(array, index);
index += Ellipsoid.packedLength;
Expand All @@ -311,6 +335,7 @@ define([
positions : positions,
granularity : granularity,
loop : loop,
lineType : lineType,
ellipsoid : ellipsoid
});
geometry._projectionIndex = projectionIndex;
Expand All @@ -321,6 +346,7 @@ define([
result._positions = positions;
result.granularity = granularity;
result.loop = loop;
result.lineType = lineType;
result._ellipsoid = ellipsoid;
result._projectionIndex = projectionIndex;
result._scene3DOnly = scene3DOnly;
Expand Down Expand Up @@ -384,6 +410,9 @@ define([
var nextBottomScratch = new Cartesian3();
var vertexNormalScratch = new Cartesian3();
var intersectionScratch = new Cartesian3();
var cartographicScratch0 = new Cartographic();
var cartographicScratch1 = new Cartographic();
var cartographicIntersectionScratch = new Cartographic();
/**
* Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.
* Vertices are "fat," packing all the data needed in each volume to describe a line on terrain or 3D Tiles.
Expand All @@ -397,6 +426,7 @@ define([
var loop = groundPolylineGeometry.loop;
var ellipsoid = groundPolylineGeometry._ellipsoid;
var granularity = groundPolylineGeometry.granularity;
var lineType = groundPolylineGeometry.lineType;
var projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](ellipsoid);

var minHeight = WALL_INITIAL_MIN_HEIGHT;
Expand All @@ -417,7 +447,12 @@ define([
// may get split by the plane of IDL + Prime Meridian.
var p0;
var p1;
var c0;
var c1;
var rhumbLine = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);
var intersection;
var intersectionCartographic;
var intersectionLongitude;
var splitPositions = [positions[0]];
for (i = 0; i < positionsLength - 1; i++) {
p0 = positions[i];
Expand All @@ -426,7 +461,21 @@ define([
if (defined(intersection) &&
!Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&
!Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)) {
splitPositions.push(Cartesian3.clone(intersection));
if (groundPolylineGeometry.lineType === LineType.GEODESIC) {
splitPositions.push(Cartesian3.clone(intersection));
} else if (groundPolylineGeometry.lineType === LineType.RHUMB) {
intersectionLongitude = ellipsoid.cartesianToCartographic(intersection, cartographicScratch0).longitude;
c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
rhumbLine.setEndPoints(c0, c1);
intersectionCartographic = rhumbLine.findIntersectionWithLongitude(intersectionLongitude, cartographicIntersectionScratch);
intersection = ellipsoid.cartographicToCartesian(intersectionCartographic, intersectionScratch);
if (defined(intersection) &&
!Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&
!Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)) {
splitPositions.push(Cartesian3.clone(intersection));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this will have an impact on javascript optimization, but this could be easier to read as two loops within if (groundPolylineGeometry.lineType === LineType.GEODESIC) {.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is better the way it is. If we do something like

if (GEODESIC) {
} else if (RHUMB) {
}

we'll need to duplicate the initial intersection test code.

Since the test will always pass or always fail inside the for-loop, branch prediction should work well and minimize any performance drops.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right that it won't make a difference for performance, but it still just feels kind of "off" to me reading that there's a boolean check with the same result repeated so many times.

I'd still prefer separate loops, but it's not a huge deal.

}
splitPositions.push(p1);
}
Expand All @@ -438,7 +487,21 @@ define([
if (defined(intersection) &&
!Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&
!Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)) {
splitPositions.push(Cartesian3.clone(intersection));
if (groundPolylineGeometry.lineType === LineType.GEODESIC) {
splitPositions.push(Cartesian3.clone(intersection));
} else if (groundPolylineGeometry.lineType === LineType.RHUMB) {
intersectionLongitude = ellipsoid.cartesianToCartographic(intersection, cartographicScratch0).longitude;
c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
rhumbLine.setEndPoints(c0, c1);
intersectionCartographic = rhumbLine.findIntersectionWithLongitude(intersectionLongitude, cartographicIntersectionScratch);
intersection = ellipsoid.cartographicToCartesian(intersectionCartographic, intersectionScratch);
if (defined(intersection) &&
!Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&
!Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)) {
splitPositions.push(Cartesian3.clone(intersection));
}
}
}
}
var cartographicsLength = splitPositions.length;
Expand Down Expand Up @@ -495,7 +558,7 @@ define([
cartographicsArray.push(startCartographic.latitude);
cartographicsArray.push(startCartographic.longitude);

interpolateSegment(startCartographic, nextCartographic, minHeight, maxHeight, granularity, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);
interpolateSegment(startCartographic, nextCartographic, minHeight, maxHeight, granularity, lineType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);

// All inbetween points
for (i = 1; i < cartographicsLength - 1; ++i) {
Expand All @@ -514,7 +577,7 @@ define([
cartographicsArray.push(vertexCartographic.latitude);
cartographicsArray.push(vertexCartographic.longitude);

interpolateSegment(cartographics[i], cartographics[i + 1], minHeight, maxHeight, granularity, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);
interpolateSegment(cartographics[i], cartographics[i + 1], minHeight, maxHeight, granularity, lineType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);
}

// Last point - either loop or attach a normal "perpendicular" to the wall.
Expand Down Expand Up @@ -542,7 +605,7 @@ define([
cartographicsArray.push(endCartographic.longitude);

if (loop) {
interpolateSegment(endCartographic, startCartographic, minHeight, maxHeight, granularity, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);
interpolateSegment(endCartographic, startCartographic, minHeight, maxHeight, granularity, lineType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray);
index = normalsArray.length;
for (i = 0; i < 3; ++i) {
normalsArray[index + i] = normalsArray[i];
Expand Down
Loading