What is the correct method to update the positions property of a CorridorGeometry or PolygonGeometry once it has been added to the scene.groundPrimitives collection? I know for Entities that we can just use the CallbackProperty. I have tried to just add additional Cartesian3 to the array but this doesn't seem to update the geometry.
At the Primitive API level (which includes primitive geometry types like CorridorGeometry and PolygonGeometry), the only way to update the geometry is to remove it from the primitive collection and add a new geometry with the new values.
We do recommend that people use the Entity API for creating geometry that needs to change because it handles the updating for you.