How to reload the Viewer after switching the camera frustum?

Is there a possibility to “reload” the viewer somehow or what has to be done after changing the camera setting from PerspectiveFrustum to OrthographicFrustum during runtime?
I use the following code snippet, but then the earth is displayed in stripes when changing the fov or whole frustum. Only when the browser window changes a little bit in size, the earth is shown correctly again (CesiumJS 1.71, Chrome 83.0.4103.116):

const cameraSettings = {
  ortographicCameraActive: false,
  fov: 60,
  ofOptions: {
    width: 1000000,
    aspectRatio: 2.356589147286822,
    near: 0.1,
    far: 10000000000
  },
  pfOptions: {
    aspectRatio: 1905,
    near: 0.1,
    far: 10000000000,
    xOffset: 0.0,
    yOffset: 0.0
  }
};    

const {
  ortographicCameraActive,
  fov,
  ofOptions,
  pfOptions
} = cameraSettings;

if(viewer.scene) {
  if (ortographicCameraActive) {
    viewer.scene.camera.frustum = new OrthographicFrustum(ofOptions);
  } else {
    let fovRadians = fov * Math.PI / 180;
    pfOptions['fov'] = fovRadians;
    viewer.scene.camera.frustum = new PerspectiveFrustum(pfOptions);
  }
}

I have added a Sandcastle here, if you click the button the first time, it changes into OrthographicFrustum another click shows the false display of the earth as displayed above. Reesizing the broswer window corrects the display of the earth.

What’s happening there is the same thing that would happen if you set the canvas height to 1 (you’re basically seeing just 1 row of pixels, stretched out). It’s happening because the aspect ratio on line 13 is set to a very high number.

I suspect what happens when you re-size the window is that CesiumJS recomputes the camera’s FOV, which fixes it. There may be a way to trigger this, but it sounds like the right fix may be to pass in the correct aspect ratio when switching the cameras? Does that work for you?

Yes, if I enter the values width and aspectRatio, which are re-calculated in viewer.scene.camera.frustum after adjusting the browser window, the display of the earth will fit again.
But does this mean that I cannot fill the settings for the two camera frustums with default values? Because if I do, they might not match the actual width and aspectRatio when applied?