WallGeometry and entities.add

I can create a wall wall with the base at elevation 0 and add it to the entities collection, but when I try to create a wall with a base height > 0 with WallGeometry it does not add to the entities collection with a visible entry.

Does anyone have an example how to add a WallGeometry to the enities collection? I can't find one in the documentation.

entities.add(GetWall(ar.polygon, elevation, ar.wall.wallHeight, ar.wall.matWall));

This GetWall function works, but the elevation (the base of the wall) is not used

function GetWall(polygon, elevation, height, material) {
            var cartesians = ;

            for (idx = 0; idx < polygon.length; idx++) {
                cartesians.push(new Cesium.Cartesian3.fromDegrees(polygon[idx].lng, polygon[idx].lat, height));
            }
            // Since this is a wall, need to readd the first point at the end of the wall to close it

            cartesians.push(cartesians[0]);

            return new Object( { positions: cartesians, material: material });
        
}

This get wall function doesn't work. I'm sure it is because WallGeometry is not valid to use as the positions property but I can't find any
documentation on how to use a WallGeometry for adding a wall geometry to entities.

function GetWall(polygon, elevation, height, material) {
            var cartesians = ;

            for (idx = 0; idx < polygon.length; idx++) {
                cartesians.push(new Cesium.Cartesian3.fromDegrees(polygon[idx].lng, polygon[idx].lat));
            }
            // Since this is a wall, need to read the first point at the end of the wall to close it

            cartesians.push(cartesians[0]);

            var wallg = Cesium.WallGeometry.fromConstantHeights({
                positions : cartesians,
                minimumHeight: elevation,
                maximumHeight: elevation + height
            });

            return new Object({ poistions: wallg, material: material });
        }

Hello,

With the entities layer, you shouldn’t have to use the WallGeometry object at all. Have you looked at the wall sandcastle example?:

The green wall is on the surface, the red wall is above the surface, and the blue wall has varying heights at each point of the wall. I think looking at the code for the red wall should help you. The height of the top of the wall is the height at each position, and the height of the bottom of the wall is specified with the minimumHeights option. This takes an array of numbers where each value is the height at the bottom of the wall for each position in the positions array.

Hope this helps!

Hannah