extend stl loading to allow formdata
This commit is contained in:
parent
8a1118d6c1
commit
2c2f954f13
6 changed files with 24 additions and 12 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@
|
|||
};
|
||||
}
|
||||
|
||||
getLayer(layer) {
|
||||
return this.layers[layer];
|
||||
}
|
||||
|
||||
setLayer(layer, colors, off) {
|
||||
let layers = this.layers;
|
||||
if (typeof(colors) === 'number') {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@
|
|||
|
||||
}
|
||||
|
||||
function getStack(name) {
|
||||
return stacks[name];
|
||||
}
|
||||
|
||||
function create(name, view) {
|
||||
if (stacks[name]) {
|
||||
return stacks[name];
|
||||
|
|
@ -254,6 +258,7 @@
|
|||
KIRI.stacks = {
|
||||
clear,
|
||||
create,
|
||||
getStack,
|
||||
getRange,
|
||||
setRange
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue