mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
Add stl export
This commit is contained in:
parent
ac98aaee5c
commit
65e4f230b0
1625
package-lock.json
generated
1625
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@
|
||||
"dependencies": {
|
||||
"@doodle3d/cal": "0.0.8",
|
||||
"@doodle3d/clipper-js": "^1.0.7",
|
||||
"@doodle3d/threejs-export-stl": "0.0.3",
|
||||
"babel-plugin-inline-import": "^2.0.6",
|
||||
"imports-loader": "^0.7.1",
|
||||
"memoizee": "^0.3.9",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Matrix } from '@doodle3d/cal';
|
||||
// import * as exportSTL from '@doodle3d/threejs-export-stl';
|
||||
import * as exportSTL from '@doodle3d/threejs-export-stl';
|
||||
// import * as exportOBJ from '@doodle3d/threejs-export-obj';
|
||||
import * as THREE from 'three';
|
||||
import ThreeBSP from 'three-js-csg';
|
||||
@ -124,18 +124,18 @@ export async function createFile(objectsById, type, options) {
|
||||
const blob = new Blob([string], { type: 'application/json' });
|
||||
return blob;
|
||||
}
|
||||
// case 'stl-string': {
|
||||
// const string = exportSTL.fromMesh(exportMesh, false);
|
||||
// return string;
|
||||
// }
|
||||
// case 'stl-base64': {
|
||||
// const buffer = exportSTL.fromMesh(exportMesh, true);
|
||||
// return bufferToBase64(buffer);
|
||||
// }
|
||||
// case 'stl-blob': {
|
||||
// const buffer = exportSTL.fromMesh(exportMesh, true);
|
||||
// return new Blob([buffer], { type: 'application/vnd.ms-pki.stl' })
|
||||
// }
|
||||
case 'stl-string': {
|
||||
const string = exportSTL.fromMesh(exportMesh, false);
|
||||
return string;
|
||||
}
|
||||
case 'stl-base64': {
|
||||
const buffer = exportSTL.fromMesh(exportMesh, true);
|
||||
return bufferToBase64(buffer);
|
||||
}
|
||||
case 'stl-blob': {
|
||||
const buffer = exportSTL.fromMesh(exportMesh, true);
|
||||
return new Blob([buffer], { type: 'application/vnd.ms-pki.stl' })
|
||||
}
|
||||
// case 'obj-blob': {
|
||||
// const buffer = await exportOBJ.fromMesh(exportMesh, true);
|
||||
// return buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user