Skip to content

Commit

Permalink
specs
Browse files Browse the repository at this point in the history
  • Loading branch information
hpinkos committed Sep 18, 2019
1 parent 4ce8d61 commit 8f14356
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Change Log
* Reduces size of approximateTerrainHeights.json by rounding the numbers [#7959](https://github.com/AnalyticalGraphicsInc/cesium/pull/7959)
* Fixed undefined `quadDetails` error from zooming into the map really close. [#8011](https://github.com/AnalyticalGraphicsInc/cesium/pull/8011)
* Fixed triangulation bug in polygons using `ArcType.RHUMB`. [#8042](https://github.com/AnalyticalGraphicsInc/cesium/issues/8042)
* Fixed a bug where extruded polygons would sometimes be missing segments. [#8035](https://github.com/AnalyticalGraphicsInc/cesium/pull/8035)

### 1.61 - 2019-09-03

Expand Down
38 changes: 38 additions & 0 deletions Specs/Core/PolygonGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,44 @@ describe('Core/PolygonGeometry', function() {
expect(geometry.attributes.normal).toBeUndefined();
});

it('does not include indices for extruded walls that are too small', function() {
var positions = Cartesian3.fromDegreesArray([
7.757161063097392, 48.568676799636634,
7.753968290229146, 48.571796467099077,
7.755340073906587, 48.571948854067948,
7.756263393414589, 48.571947951609708,
7.756894446412183, 48.569396703043992
]);

var pRhumb = PolygonGeometry.createGeometry(PolygonGeometry.fromPositions({
vertexFormat : VertexFormat.POSITION_ONLY,
positions : positions,
extrudedHeight: 1000,
closeTop: false,
closeBottom: false,
arcType: ArcType.RHUMB
}));

var numVertices = 20;
var numTriangles = 10; // 3 top + 3 bottom + 5 all segments with 2 triangles each
expect(pRhumb.attributes.position.values.length).toEqual(numVertices * 3);
expect(pRhumb.indices.length).toEqual(numTriangles * 3);

var pGeodesic = PolygonGeometry.createGeometry(PolygonGeometry.fromPositions({
vertexFormat : VertexFormat.POSITION_ONLY,
positions : positions,
extrudedHeight: 1000,
closeTop: false,
closeBottom: false,
arcType: ArcType.GEODESIC
}));

numVertices = 20;
numTriangles = 10;
expect(pGeodesic.attributes.position.values.length).toEqual(numVertices * 3);
expect(pGeodesic.indices.length).toEqual(numTriangles * 3);
});

it('computing rectangle property', function() {
var p = new PolygonGeometry({
vertexFormat : VertexFormat.POSITION_AND_ST,
Expand Down

0 comments on commit 8f14356

Please sign in to comment.