Is there a way to represent custom geometry ?

Hello, I am trying to create and display a primitive with the Geometry class. When I run my code, I got the following errors:

TypeError: Cannot read property 'center' of undefined
TypeError: Cannot read property 'center' of undefined
    at createVertexArray (
    at Primitive.update (
    at PrimitiveCollection.update (
    at updatePrimitives (
    at executeCommandsInViewport (
    at updateAndExecuteCommands (
    at render (
    at Scene.render (
    at CesiumWidget.render (
    at render (

I found out that code tried to access to "" (line 1014:59 in Primitive.js file) but the geometry object doesn't contain boundingSphereCV.

Does anyone know why this error are occurring ? How to fix this?


I’m not sure exactly what would be causing this error. Are you trying to create a new geometry type?

Take a look at this tutorial for information about the Geometry and Appearances API:

Also look at this unfinished tutorial for creating a custom geometry type:

Some of the code samples in that tutorial may be a little out of date, but I believe the information in there is still relevant. That might help you debug.



Hello Hannah,
Thank you for tutorials but unfortunately they did not allow me to find a solution.
I'm not trying to create a new geometry type.
I would like to know if there is a way to create a primitive from a matrix data which represents a surface, without using basic geometry (boxGeometry, RectangleGeometry,...)?

I don’t believe we have a primitive type that supports that type of data. What are you trying to visualize?



I have a DTM that represent a grid of vertex with elevation (x, y, z).
Is there a way on Cesium to create a primitive (or other) with it ?

Is this terrain data? Cesium supports height maps and quantized mesh formats for terrain, but quantized mesh runs way more efficiently. Information about our supported terrain providers can be found here:
If you are interested in converting your data to a qunatized mesh format, AGI (the company that employs most of the Cesium team) offers a commercial product called STK Terrain Server. This is what the team at FodarEarth (demo) used to process their DEM photogrammetry data.