@tscircuit/3d-viewer 0.0.174 → 0.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17411,7 +17411,7 @@ import { Canvas, useFrame as useFrame2 } from "@react-three/fiber";
|
|
|
17411
17411
|
// package.json
|
|
17412
17412
|
var package_default = {
|
|
17413
17413
|
name: "@tscircuit/3d-viewer",
|
|
17414
|
-
version: "0.0.
|
|
17414
|
+
version: "0.0.175",
|
|
17415
17415
|
main: "./dist/index.js",
|
|
17416
17416
|
module: "./dist/index.js",
|
|
17417
17417
|
type: "module",
|
|
@@ -17442,7 +17442,7 @@ var package_default = {
|
|
|
17442
17442
|
"@jscad/stl-serializer": "^2.1.20",
|
|
17443
17443
|
"@react-three/drei": "^9.121.4",
|
|
17444
17444
|
"@react-three/fiber": "^8.17.14",
|
|
17445
|
-
"@tscircuit/core": "^0.0.
|
|
17445
|
+
"@tscircuit/core": "^0.0.355",
|
|
17446
17446
|
"@tscircuit/props": "^0.0.163",
|
|
17447
17447
|
"@tscircuit/soup-util": "^0.0.41",
|
|
17448
17448
|
"jscad-electronics": "^0.0.27",
|
|
@@ -18088,7 +18088,13 @@ var CadViewer = forwardRef2(({ soup, circuitJson, children, autoRotateDisabled }
|
|
|
18088
18088
|
const board = su2(circuitJson).pcb_board.list()[0];
|
|
18089
18089
|
if (!board) return [5, 5, 5];
|
|
18090
18090
|
const { width, height } = board;
|
|
18091
|
-
|
|
18091
|
+
if (!width && !height) {
|
|
18092
|
+
return [5, 5, 5];
|
|
18093
|
+
}
|
|
18094
|
+
const minCameraDistance = 5;
|
|
18095
|
+
const adjustedBoardWidth = Math.max(width, minCameraDistance);
|
|
18096
|
+
const adjustedBoardHeight = Math.max(height, minCameraDistance);
|
|
18097
|
+
const largestDim = Math.max(adjustedBoardWidth, adjustedBoardHeight);
|
|
18092
18098
|
return [largestDim / 2, largestDim / 2, largestDim];
|
|
18093
18099
|
} catch (e) {
|
|
18094
18100
|
console.error(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/3d-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.176",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@jscad/stl-serializer": "^2.1.20",
|
|
32
32
|
"@react-three/drei": "^9.121.4",
|
|
33
33
|
"@react-three/fiber": "^8.17.14",
|
|
34
|
-
"@tscircuit/core": "^0.0.
|
|
34
|
+
"@tscircuit/core": "^0.0.355",
|
|
35
35
|
"@tscircuit/props": "^0.0.163",
|
|
36
36
|
"@tscircuit/soup-util": "^0.0.41",
|
|
37
37
|
"jscad-electronics": "^0.0.27",
|