diff --git a/notes.md b/notes.md index 2e3c6819..de8971e6 100644 --- a/notes.md +++ b/notes.md @@ -17,6 +17,7 @@ * `B` fix adaptive slicing with multi-extruder * `B` fix supports with grouped parts +* `F` speculative background preview generation * `F` control for size of purge block (with 0=disabled) * `F` add separate fill speed control * `F` manual support addition / control @@ -46,6 +47,7 @@ * `B` fails in pancaking (clone) when there are no sliced layers (like z bottom too high) * `B` contouring should extend beyond part boundaries by tool radius * `B` outside cutting direction in roughing mode inverted +* `B` widen outside cuts to prevent chatter on deep (metal) features * `F` z bounded slices (extension of z bottom offset feature) * `F` use arcs to connect hard angles * `F` lead-in milling diff --git a/src/kiri/main.js b/src/kiri/main.js index 4f45aef5..31577a9c 100644 --- a/src/kiri/main.js +++ b/src/kiri/main.js @@ -1140,16 +1140,19 @@ } else { ajax(url, function(vertices) { vertices = js2o(vertices).toFloat32(); - platform.add(newWidget().loadVertices(vertices)); - if (onload) onload(vertices); + let widget = newWidget().loadVertices(vertices); + platform.add(widget); + if (onload) onload(vertices, widget); }); } } function platformLoadSTL(url, onload) { - new MOTO.STL().load(url, function(vertices) { - platform.add(newWidget().loadVertices(vertices)); - if (onload) onload(vertices); + new MOTO.STL().load(url, function(vertices, filename) { + let widget = newWidget().loadVertices(vertices); + widget.filename = filename; + platform.add(widget); + if (onload) onload(vertices, widget); }) } diff --git a/src/kiri/widget.js b/src/kiri/widget.js index 4faeb85c..499fc42e 100644 --- a/src/kiri/widget.js +++ b/src/kiri/widget.js @@ -295,6 +295,7 @@ PRO.saveToCatalog = function(filename) { let widget = this; let time = UTIL.time(); + widget.filename = filename; KIRI.catalog.putFile(filename, this.getGeoVertices(), function(vertices) { if (vertices && vertices.length) { console.log("saving decimated mesh ["+vertices.length+"] time ["+(UTIL.time()-time)+"]"); diff --git a/src/moto/load-stl.js b/src/moto/load-stl.js index 49fe09bf..c12dfc9b 100644 --- a/src/moto/load-stl.js +++ b/src/moto/load-stl.js @@ -32,7 +32,15 @@ function onloaded (event) { if (event.target.status === 200 || event.target.status === 0) { stl.parse(event.target.response || event.target.responseText); - if (callback) callback(stl.vertices); + let cd = xhr.getResponseHeader('Content-Disposition'); + if (cd) { + cd = cd.split(';').map(v => v.trim()).filter(v => { + return v.indexOf('filename=') === 0; + }).map(v => { + return v.substring(10,v.length-1); + }); + } + if (callback) callback(stl.vertices, cd ? cd[0] : undefined); } else { if (callback) callback(null, event.target.statusText); }