three-base 2.0.11 → 2.0.13
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/package.json +1 -4
- package/threeUtils.d.ts +1 -1
- package/threeUtils.js +2 -2
- package/threeUtils.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "three-base",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "three 3d three-base",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,10 +37,7 @@
|
|
|
37
37
|
"lodash": "^4",
|
|
38
38
|
"three": "^0.152.0",
|
|
39
39
|
"dexie": "^3",
|
|
40
|
-
"@types/three": "^0.152.0",
|
|
41
|
-
"@types/lodash": "^4",
|
|
42
40
|
"vite": "*",
|
|
43
|
-
"@types/node": "*",
|
|
44
41
|
"html2canvas": "^1.4.1"
|
|
45
42
|
}
|
|
46
43
|
}
|
package/threeUtils.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ declare class ThreeUtils extends EventDispatcher {
|
|
|
36
36
|
centerObject3D(object3d: Object3D | BufferGeometry): void;
|
|
37
37
|
center(object3d: Object3D | BufferGeometry): void;
|
|
38
38
|
scaleTo(object3d: Object3D | BufferGeometry, size?: number, key?: Array<"x" | "y" | "z">): void;
|
|
39
|
-
exportGLB(input: Object3D): void;
|
|
39
|
+
exportGLB(input: Object3D, fileName?: string): void;
|
|
40
40
|
getVolume(geometry: BufferGeometry): number;
|
|
41
41
|
signedVolumeOfTriangle(p1: Vector3, p2: Vector3, p3: Vector3): number;
|
|
42
42
|
}
|
package/threeUtils.js
CHANGED
|
@@ -174,7 +174,7 @@ class ThreeUtils extends EventDispatcher {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
// 导出 glb
|
|
177
|
-
exportGLB(input) {
|
|
177
|
+
exportGLB(input, fileName = "threeUtils.exportGLB") {
|
|
178
178
|
const gltfExporter = new GLTFExporter();
|
|
179
179
|
gltfExporter.parse(input, (result) => {
|
|
180
180
|
if (result instanceof ArrayBuffer) {
|
|
@@ -182,7 +182,7 @@ class ThreeUtils extends EventDispatcher {
|
|
|
182
182
|
link.style.display = 'none';
|
|
183
183
|
document.body.appendChild(link); // Firefox workaround, see #6594
|
|
184
184
|
link.href = URL.createObjectURL(new Blob([result], { type: 'application/octet-stream' }));
|
|
185
|
-
link.download =
|
|
185
|
+
link.download = `${fileName}.glb`;
|
|
186
186
|
link.click();
|
|
187
187
|
}
|
|
188
188
|
}, (error) => { }, {
|
package/threeUtils.ts
CHANGED
|
@@ -201,7 +201,7 @@ class ThreeUtils extends EventDispatcher {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// 导出 glb
|
|
204
|
-
exportGLB(input: Object3D) {
|
|
204
|
+
exportGLB(input: Object3D, fileName: string = "threeUtils.exportGLB") {
|
|
205
205
|
const gltfExporter = new GLTFExporter();
|
|
206
206
|
gltfExporter.parse(
|
|
207
207
|
input,
|
|
@@ -211,7 +211,7 @@ class ThreeUtils extends EventDispatcher {
|
|
|
211
211
|
link.style.display = 'none';
|
|
212
212
|
document.body.appendChild(link); // Firefox workaround, see #6594
|
|
213
213
|
link.href = URL.createObjectURL(new Blob([result], { type: 'application/octet-stream' }));
|
|
214
|
-
link.download =
|
|
214
|
+
link.download = `${fileName}.glb`;
|
|
215
215
|
link.click();
|
|
216
216
|
}
|
|
217
217
|
},
|