mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-09 09:52:34 +01:00
expose to stl ascii string
This commit is contained in:
parent
462b4f5272
commit
415b832d8f
1 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue