"box up" features in 3D Tiles

Hello,

I’m working on putting in some 3D models of a city as 3D Tiles in Cesium. These files are generated from some .dwg files. What I want to achieve is to convert the city model into 3D Tile and allow the user to pick a building, which provides an id and be used as a lookup key for more information about the building.

The problem I haveis when using the code example from

instead of the entire building having a color change (what I want to achieve), only the triggering (picked) triangle turns into yellow (see the image below).

I believe this is because when the meshes are created in the original file, all the building features are triangles. Is there any way I can “box up” those triangles for each building into a single box?

I’m using Cesium 1.41, on Windows 10 64-bit, through Chrome. Though I don’t think this matters much.

Thanks a lot for your suggestions!

-victor

Hey Victor,

It’s possible this is an issue with the FME conversion. For b3dm all vertices in a building should have the same batch id attribute if they want to be picked together. It looks like here that each triangle has its own batch id, so picking is on a per-triangle basis.

First see if this can be fixed from the FME side, and if that’s not possible check if all the triangles in the building have a common property (like the same name or some other metadata). If they do, you can loop over all the features in the tile and only color those that have the same property as the picked feature.