restore svg import render

This commit is contained in:
Stewart Allen 2020-11-09 23:01:41 -05:00
commit eb53f5334d
6 changed files with 40 additions and 20 deletions

View file

@ -155,7 +155,6 @@ KIRI.worker = {
parse: function(args, send) {
const { settings, code, type } = args;
const center = settings.process.outputOriginCenter;
const origin = settings.origin;
const offset = {
x: origin.x,
@ -177,6 +176,19 @@ KIRI.worker = {
}, { fdm : mode === 'FDM' });
},
parse_svg: function(parsed, send) {
parsed.forEach(layer => {
layer.forEach(out => {
const { x, y, z } = out.point;
out.point = BASE.newPoint(x,y,z || 0);
});
});
const layers = KIRI.driver.FDM.prepareRender(parsed, progress => {
send.data({ progress });
}, { thin: true });
send.done({parsed: KIRI.codec.encode(layers)});
},
clear: function(data, send) {
current.snap = null;
current.print = null;