Repository: jupytercad/JupyterCAD (language: python)

Issue:
Reduce field of view of the camera?
@trungleduc This is more of a question, I am wondering why we've been using a field of view of 90 [since the very beginning of JupyterCAD](https://github.com/jupytercad/JupyterCAD/blame/74528e4744c3a5dfcc8ce822d550ed61c1c1d33d/src/mainview.tsx#L133)?

This is looking a bit off to me. I would have a personal preference for using the default value of 50 which looks more natural.




Discussion / hints:
I can not recall anymore, maybe it's just a random value. Please go ahead and update it

Fix patch:
diff --git a/packages/base/src/3dview/mainview.tsx b/packages/base/src/3dview/mainview.tsx
index 1f299612..5fd1cbb6 100644
--- a/packages/base/src/3dview/mainview.tsx
+++ b/packages/base/src/3dview/mainview.tsx
@@ -203,7 +203,7 @@ export class MainView extends React.Component<IProps, IStates> {
       DEFAULT_EDGE_COLOR.set(getCSSVariableColor(DEFAULT_EDGE_COLOR_CSS));
       SELECTED_MESH_COLOR.set(getCSSVariableColor(SELECTED_MESH_COLOR_CSS));
 
-      this._camera = new THREE.PerspectiveCamera(90, 2, 0.1, 1000);
+      this._camera = new THREE.PerspectiveCamera(50, 2, 0.1, 1000);
       this._camera.position.set(8, 8, 8);
       this._camera.up.set(0, 0, 1);
 
@@ -1266,7 +1266,7 @@ export class MainView extends React.Component<IProps, IStates> {
     this._scene.remove(this._camera);
 
     if (this._cameraSettings.type === 'Perspective') {
-      this._camera = new THREE.PerspectiveCamera(90, 2, 0.1, 1000);
+      this._camera = new THREE.PerspectiveCamera(50, 2, 0.1, 1000);
     } else {
       const width = this.divRef.current?.clientWidth || 0;
       const height = this.divRef.current?.clientHeight || 0;


Test patch:
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-0-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-0-linux.png
index 2010885a..749ee0ad 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-0-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-0-linux.png differ
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-2-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-2-linux.png
index 219935d1..63e8bfd3 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-2-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-2-linux.png differ
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-3-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-3-linux.png
index da193eec..d4f4a205 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-3-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/dark-Notebook-ipynb-cell-3-linux.png differ
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-0-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-0-linux.png
index 7e5dd287..e32c7193 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-0-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-0-linux.png differ
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-2-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-2-linux.png
index 621b57f8..7d93b9af 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-2-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-2-linux.png differ
diff --git a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-3-linux.png b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-3-linux.png
index 776ff5a5..24205e45 100644
Binary files a/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-3-linux.png and b/ui-tests/tests/notebook.spec.ts-snapshots/light-Notebook-ipynb-cell-3-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Console-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Console-linux.png
index 0915c59c..2ed3fdc4 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Console-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Console-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Modified-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Modified-linux.png
index 46dacdb4..8d434335 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Modified-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Modified-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-New-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-New-linux.png
index 6c2b9b72..8da2018a 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-New-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-New-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Redo-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Redo-linux.png
index c46baaf1..6b380453 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Redo-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Redo-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Undo-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Undo-linux.png
index 8cab4f30..94ed85b4 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Undo-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/JCAD-Undo-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-Cut-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-Cut-test-jcad-linux.png
index b586693d..37d98368 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-Cut-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-Cut-test-jcad-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-test-jcad-linux.png
index a58f894a..ceaa90d2 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/MultiSelect-test-jcad-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Add-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Add-test-jcad-linux.png
index b740fa0c..42d7e54c 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Add-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Add-test-jcad-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Edit-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Edit-test-jcad-linux.png
index 750ab812..f2cf96a4 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Edit-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Edit-test-jcad-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Remove-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Remove-test-jcad-linux.png
index 595b1561..306ba58f 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Operator-Remove-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Operator-Remove-test-jcad-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png
index 4f87806d..21e5712b 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Render-3M-CONNECTOR-STEP-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png
index 33d8d6e9..5503489c 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png differ
diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png
index 8fb3f57b..39e606d5 100644
Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png differ