add loading of raw vertices
This commit is contained in:
parent
acc621ecb8
commit
56436fc4ed
2 changed files with 5 additions and 1 deletions
|
|
@ -1967,11 +1967,15 @@ self.kiri.license = exports.LICENSE;
|
||||||
for (var i=0; i<files.length; i++) {
|
for (var i=0; i<files.length; i++) {
|
||||||
var reader = new FileReader(),
|
var reader = new FileReader(),
|
||||||
lower = files[i].name.toLowerCase(),
|
lower = files[i].name.toLowerCase(),
|
||||||
|
israw = lower.indexOf(".raw") > 0,
|
||||||
isstl = lower.indexOf(".stl") > 0,
|
isstl = lower.indexOf(".stl") > 0,
|
||||||
issvg = lower.indexOf(".svg") > 0,
|
issvg = lower.indexOf(".svg") > 0,
|
||||||
isgcode = lower.indexOf(".gcode") > 0 || lower.indexOf(".nc") > 0;
|
isgcode = lower.indexOf(".gcode") > 0 || lower.indexOf(".nc") > 0;
|
||||||
reader.file = files[i];
|
reader.file = files[i];
|
||||||
reader.onloadend = function (e) {
|
reader.onloadend = function (e) {
|
||||||
|
if (israw) platformAdd(
|
||||||
|
newWidget().loadVertices(JSON.parse(e.target.result).toFloat32())
|
||||||
|
);
|
||||||
if (isstl) platformAdd(
|
if (isstl) platformAdd(
|
||||||
newWidget()
|
newWidget()
|
||||||
.loadVertices(new MOTO.STL().parse(e.target.result))
|
.loadVertices(new MOTO.STL().parse(e.target.result))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
var exports = {
|
var exports = {
|
||||||
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||||
LICENSE:"See the license.md file included with the source distribution",
|
LICENSE:"See the license.md file included with the source distribution",
|
||||||
VERSION:"1.5.9"
|
VERSION:"1.6.0"
|
||||||
};
|
};
|
||||||
if (!module) var module = {};
|
if (!module) var module = {};
|
||||||
module.exports = exports;
|
module.exports = exports;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue