@tscircuit/3d-viewer 0.0.588 → 0.0.590
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 +6 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -31613,8 +31613,7 @@ var JscadModel = ({
|
|
|
31613
31613
|
};
|
|
31614
31614
|
|
|
31615
31615
|
// src/hooks/use-global-obj-loader.ts
|
|
31616
|
-
import {
|
|
31617
|
-
import { MTLLoader, OBJLoader } from "three-stdlib";
|
|
31616
|
+
import { useEffect as useEffect9, useState as useState5 } from "react";
|
|
31618
31617
|
|
|
31619
31618
|
// src/utils/vrml.ts
|
|
31620
31619
|
import { VRMLLoader } from "three-stdlib";
|
|
@@ -31636,6 +31635,7 @@ async function loadVrml(url) {
|
|
|
31636
31635
|
}
|
|
31637
31636
|
|
|
31638
31637
|
// src/hooks/use-global-obj-loader.ts
|
|
31638
|
+
import { MTLLoader, OBJLoader } from "three-stdlib";
|
|
31639
31639
|
if (typeof window !== "undefined" && !window.TSCIRCUIT_OBJ_LOADER_CACHE) {
|
|
31640
31640
|
window.TSCIRCUIT_OBJ_LOADER_CACHE = /* @__PURE__ */ new Map();
|
|
31641
31641
|
}
|
|
@@ -31661,19 +31661,13 @@ function useGlobalObjLoader(url) {
|
|
|
31661
31661
|
const mtlContentArr = text.match(/newmtl[\s\S]*?endmtl/g);
|
|
31662
31662
|
const objLoader = new OBJLoader();
|
|
31663
31663
|
if (mtlContentArr?.length) {
|
|
31664
|
-
const mtlContent = mtlContentArr.join("\n").replace(
|
|
31664
|
+
const mtlContent = mtlContentArr.join("\n").replace(/^d\s+0\./gm, "d 1.");
|
|
31665
31665
|
const objContent = text.replace(/newmtl[\s\S]*?endmtl/g, "").replace(/^mtllib.*/gm, "");
|
|
31666
31666
|
const mtlLoader = new MTLLoader();
|
|
31667
31667
|
mtlLoader.setMaterialOptions({
|
|
31668
31668
|
invertTrProperty: true
|
|
31669
31669
|
});
|
|
31670
|
-
const materials = mtlLoader.parse(
|
|
31671
|
-
mtlContent.replace(
|
|
31672
|
-
/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,
|
|
31673
|
-
"Kd $2 $2 $2"
|
|
31674
|
-
),
|
|
31675
|
-
"embedded.mtl"
|
|
31676
|
-
);
|
|
31670
|
+
const materials = mtlLoader.parse(mtlContent, "embedded.mtl");
|
|
31677
31671
|
objLoader.setMaterials(materials);
|
|
31678
31672
|
return objLoader.parse(objContent);
|
|
31679
31673
|
}
|
|
@@ -32710,7 +32704,7 @@ import * as THREE23 from "three";
|
|
|
32710
32704
|
// package.json
|
|
32711
32705
|
var package_default = {
|
|
32712
32706
|
name: "@tscircuit/3d-viewer",
|
|
32713
|
-
version: "0.0.
|
|
32707
|
+
version: "0.0.589",
|
|
32714
32708
|
main: "./dist/index.js",
|
|
32715
32709
|
module: "./dist/index.js",
|
|
32716
32710
|
type: "module",
|
|
@@ -32740,7 +32734,7 @@ var package_default = {
|
|
|
32740
32734
|
"@jscad/regl-renderer": "^2.6.12",
|
|
32741
32735
|
"@jscad/stl-serializer": "^2.1.20",
|
|
32742
32736
|
"circuit-json": "^0.0.465",
|
|
32743
|
-
"circuit-to-canvas": "^0.0.
|
|
32737
|
+
"circuit-to-canvas": "^0.0.123",
|
|
32744
32738
|
"react-hot-toast": "^2.6.0",
|
|
32745
32739
|
three: "^0.165.0",
|
|
32746
32740
|
"three-stdlib": "^2.36.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/3d-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.590",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@jscad/regl-renderer": "^2.6.12",
|
|
31
31
|
"@jscad/stl-serializer": "^2.1.20",
|
|
32
32
|
"circuit-json": "^0.0.465",
|
|
33
|
-
"circuit-to-canvas": "^0.0.
|
|
33
|
+
"circuit-to-canvas": "^0.0.123",
|
|
34
34
|
"react-hot-toast": "^2.6.0",
|
|
35
35
|
"three": "^0.165.0",
|
|
36
36
|
"three-stdlib": "^2.36.0",
|