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

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Sep 18, 2019

Replaces #8035

This if statement was incorrectly passing for the test case below, so I made it more robust. It should only continue if the adjacent positions are the same, meaning we are at a corner of the wall and shouldn't connect those vertices.

var viewer = new Cesium.Viewer('cesiumContainer', {
    imageryProvider : Cesium.createTileMapServiceImageryProvider({
        url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
    })
});

var positions = Cesium.Cartesian3.fromDegreesArray([
    7.757161063097392, 48.568676799636634,
    7.753968290229146, 48.571796467099077,
    7.755340073906587, 48.571948854067948,
    7.756263393414589, 48.571947951609708,
    7.756894446412183, 48.569396703043992
]);

viewer.entities.add({
    polygon : {
        hierarchy : positions,
        extrudedHeight: 100.0,
        material : Cesium.Color.GREEN,
        outline : true,
        closeTop : false,
        closeBottom : false,
        arcType : Cesium.ArcType.RHUMB // causes missing volume
    }
});

function lookAt() {
    viewer.camera.lookAt(positions[1], new Cesium.Cartesian3(1000.0, 1000.0, 1000.0));
    viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
}

Sandcastle.addToolbarButton('reset view', function() {
    lookAt();
});

lookAt();

@cesium-concierge
Copy link

cesium-concierge commented Sep 18, 2019

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@hpinkos
Copy link
Contributor Author

hpinkos commented Sep 18, 2019

@likangning93 please review

@likangning93
Copy link
Contributor

@hpinkos works as advertised 👍

Just seeing the issue in #8188, but that doesn't seem like a reason to hold this PR back.

@hpinkos hpinkos merged commit 3007bdd into master Sep 20, 2019
@hpinkos hpinkos deleted the fix-wall-segment branch September 20, 2019 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants