Is it possible to use CesiumJS to create a cube with an empty center?

Is it possible to use CesiumJS to create a cube with an empty center?

I want to use CesiumJS to make a cube with an empty center. Is there an example of this? If it’s hard to make with CesiumJS, I’d appreciate it if you could explain why!
The shape I want is as follows.

Since this cube is made of faces, you could create that using polygon entities. Polygons can also have holes.

Have a look at this sandcastle.

Also, you can always define your models with GLTF.

Oh! Thank you for your response!
This is what I wanted!!
Additionally, if there is an overlap between 3D objects, would there be an example where only that area is represented in a different color?

If your objects overlap AND use transparency AND have different colors, then overlapping those colos will produce a different color.

But transparency can look odd in certain cases.

For anything else, I think you have to calculate the overlapping manually and then build the polygon hierarchy accordingly.

Also, have a look at the sandcastle showcases, for example:

thank you so much for your reply!
Sorry to ask, but is there an example of manually calculating the overlap and then creating a polygon hierarchy accordingly?
I really need it !
Thank you

Hi @deet_dev ,

Thanks for coming to the forums as you work on your project and it is great you have gotten some useful advice from @anneg.

To your latest question in this thread regarding polygon overlap. In previous discussions on this topic including in this thread How can I determine if two polygons overlap? we have found it helpful to point to geospatial helper libraries such as booleanOverlap | Turf.js which may abstract away some of the work for a calculation like polygon overlap.

I hope that is helpful, please let us know if this is not a fit and we would be happy to try and help further.
Thanks,
Luke

1 Like