From 415b832d8f9f549e513f8fd3411a5b58c240b32d Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Fri, 22 Feb 2019 16:06:03 -0800 Subject: [PATCH] expose to stl ascii string --- web/app/cad/exportPlugin.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/app/cad/exportPlugin.js b/web/app/cad/exportPlugin.js index e897e655..ece3e132 100644 --- a/web/app/cad/exportPlugin.js +++ b/web/app/cad/exportPlugin.js @@ -3,10 +3,13 @@ import exportTextData from 'gems/exportTextData'; export function activate(ctx) { - function stlAscii() { + function toStlAsciiString() { let meshes = ctx.services.cadRegistry.shells.map(mShell => mShell.ext.view && mShell.ext.view.mesh).filter(m => !!m); - let result = stlExporter(meshes); - exportTextData(result, ctx.services.project.id + ".stl"); + return stlExporter(meshes); + } + + function stlAscii() { + exportTextData(toStlAsciiString(), ctx.services.project.id + ".stl"); } function imagePng() { @@ -31,6 +34,6 @@ export function activate(ctx) { } ctx.services.export = { - stlAscii, imagePng + stlAscii, imagePng, toStlAsciiString }; } \ No newline at end of file