extend stl loading to allow formdata

This commit is contained in:
Stewart Allen 2020-11-14 12:07:05 -05:00
commit 2c2f954f13
6 changed files with 24 additions and 12 deletions

View file

@ -1045,7 +1045,6 @@
wb.max.y += wp.y;
bounds.union(wb);
});
// console.log(JSON.stringify(bounds))
return settings.bounds = bounds;
}
@ -1145,13 +1144,17 @@
}
}
function platformLoadSTL(url, onload) {
function platformLoadSTL(url, onload, formdata) {
new MOTO.STL().load(url, function(vertices, filename) {
let widget = newWidget().loadVertices(vertices);
widget.filename = filename;
platform.add(widget);
if (onload) onload(vertices, widget);
})
if (vertices) {
let widget = newWidget().loadVertices(vertices);
widget.filename = filename;
platform.add(widget);
if (onload) {
onload(vertices, widget);
}
}
}, formdata);
}
function platformComputeMaxZ() {