Skip to content
New issue

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

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

Already on GitHub? # to your account

RectangleOutlineGeometry doesn't extrude some heights #2823

Closed
pjcozzi opened this issue Jun 19, 2015 · 2 comments
Closed

RectangleOutlineGeometry doesn't extrude some heights #2823

pjcozzi opened this issue Jun 19, 2015 · 2 comments

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 19, 2015

With height = 4.8095555532180825 and extrudedHeight = 4.9999999992399875, the outline doesn't extrude. Try the following code in Sandcastle and zoom in close to AGI HQ.

image

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var instance = new Cesium.GeometryInstance({
    geometry : new Cesium.RectangleOutlineGeometry({
        rectangle : new Cesium.Rectangle(-1.319408113323835, 0.698808399855315, -1.3194079152503557, 0.6988084250085754),
        height : 4.8095555532180825,
        extrudedHeight : 4.9999999992399875
    }),
    attributes : {
        color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)
    }
});

scene.primitives.add(new Cesium.Primitive({
    geometryInstances : instance,
    appearance : new Cesium.PerInstanceColorAppearance({
        flat : true,
        renderState : {
            lineWidth : Math.min(2.0, scene.maximumAliasedLineWidth)
        }
    })
}));
@hpinkos
Copy link
Contributor

hpinkos commented Jun 19, 2015

I bet the same behavior happens in RectangleGeometry also. I think they both check to see if the difference between height and extrudedHeight is greater than some epsilon before deciding to draw the extrusion. That just needs to be changed.

@hpinkos
Copy link
Contributor

hpinkos commented Jul 27, 2015

updated example:

var viewer = new Cesium.Viewer('cesiumContainer');

var rectangle = viewer.entities.add({
    name : 'Green translucent, rotated, and extruded rectangle at height with outline',
    rectangle : {
        coordinates : new Cesium.Rectangle(-1.319408113323835, 0.698808399855315, -1.3194079152503557, 0.6988084250085754),
        material : Cesium.Color.GREEN.withAlpha(0.5),
        extrudedHeight : 4.9999999992399875,
        height : 4.8095555532180825,
        outline : true,
        outlineColor : Cesium.Color.BLACK
    }
});

viewer.zoomTo(rectangle);

bagnell added a commit that referenced this issue Jul 28, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants