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 wall segments for tiny extruded geometry #8177

Merged
merged 3 commits into from
Sep 20, 2019
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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ 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)
* 3D Tiles geometric error now scales with transform. [#8182](https://github.com/AnalyticalGraphicsInc/cesium/pull/8182)
* Fixed per-feature post processing from sometimes selecting the wrong feature. [#7929](https://github.com/AnalyticalGraphicsInc/cesium/pull/7929)
* Fixed labels not showing for individual entities in data sources when clustering is enabled. [#6087](https://github.com/AnalyticalGraphicsInc/cesium/issues/6087)
* Fixed a crash for 3D Tiles that have zero volume. [#7945](https://github.com/AnalyticalGraphicsInc/cesium/pull/7945)


### 1.61 - 2019-09-03

##### Additions :tada:
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/PolygonGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ define([

p1 = Cartesian3.fromArray(edgePositions, UL * 3, p1Scratch);
p2 = Cartesian3.fromArray(edgePositions, UR * 3, p2Scratch);
if (Cartesian3.equalsEpsilon(p1, p2, CesiumMath.EPSILON14, CesiumMath.EPSILON6)) {
if (Cartesian3.equalsEpsilon(p1, p2, CesiumMath.EPSILON10, CesiumMath.EPSILON10)) {
//skip corner
continue;
}

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; //5 wall segments, 2 triangles each wall
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