Update helpers.ts

This commit is contained in:
Davor Hrg
2021-08-02 13:39:18 +02:00
parent 5e14ad0829
commit 7178313c2e

View File

@@ -36,7 +36,7 @@ export const makeStlDownloadHandler =
}: makeStlDownloadHandlerArgs) => }: makeStlDownloadHandlerArgs) =>
() => { () => {
const makeStlBlobFromMesh = flow( const makeStlBlobFromMesh = flow(
(mesh) => new Scene().add(mesh), (...meshes) => new Scene().add(...meshes),
(scene) => new STLExporter().parse(scene), (scene) => new STLExporter().parse(scene),
(stl) => (stl) =>
new Blob([stl], { new Blob([stl], {
@@ -60,7 +60,7 @@ export const makeStlDownloadHandler =
) { ) {
saveFile(makeStlBlobFromGeo(geometry)) saveFile(makeStlBlobFromGeo(geometry))
} else if (ideType == 'jscad') { } else if (ideType == 'jscad') {
saveFile(makeStlBlobFromMesh(geometry)) saveFile(makeStlBlobFromMesh(...geometry))
} else { } else {
thunkDispatch((dispatch, getState) => { thunkDispatch((dispatch, getState) => {
const state = getState() const state = getState()