Group of extruded polygons with dynamically highlightable sides and edges

Hello, I have a question about implementation of custom geometry.In our project, we have groups of floors (the floor is an extruded polygon defined by points and height) called blocks (all floors in a block have the same floor plan, aka points, but can differ in height). We want to be able to change the color of the sides and lateral edges dynamically (the UI highlighting feature), and we want to be able to edit the position of the highlighted edge. Here’s our custom geometry solution in sandcastle, in which we use PolylineGeometry and CoplanarPolygonGeometry instances as part of only two primitives for the entire block. We are using geometries and primitives instead of entities for better performance, so I would like to know if this is a good solution in terms of performance and architecture, or if anyone knows about any way of improving it.

(we are currently using CesiumJS v 1.89 with explicit rendering)

1 Like

Hi @miroslavprucha,

Your approach of using Primitives instead of Entities should help with performance and allow you a bit more control over the materials. :+1:

If you’re looking for further suggestions, you could try using WallGeometry and WallOutlineGeometry for outlines instead of PolylineGeometry. But if what you have now is working for you, that should be good!


Hi Gabby,

Thank you for your answear. I have looked into the WallGeometry and WallOutlineGeometry documentation, and if I understand it correctly, in order to be able to change the color of any wall (side of the floor), I would have to create one WallGeometry instead of each CoplanarPolygonGeometry, so the number of geometries would stay the same here, and then if I would create a WallOutlineGeometry for every WallGeometry, I would have two outlines for each edge, right? Another option is to use one WallOutlineGeometry for the entire floor; that would remove doubled outlines for lateral edges, but there would still be doubled outlines of the top and bottom faces of the floors. Am I not mistaken? Are there any advantages to using WallGeometry that I haven’t noticed?