|
@@ -51,7 +51,7 @@ THREE.STLLoader.prototype = {
|
|
|
}, onProgress, onError );
|
|
|
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
parse: function ( data ) {
|
|
|
|
|
|
var isBinary = function () {
|
|
@@ -61,11 +61,11 @@ THREE.STLLoader.prototype = {
|
|
|
face_size = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);
|
|
|
n_faces = reader.getUint32(80, true);
|
|
|
expect = 80 + (32 / 8) + (n_faces * face_size);
|
|
|
-
|
|
|
+
|
|
|
if ( expect === reader.byteLength ) {
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// some binary files will have different size from expected,
|
|
@@ -74,9 +74,9 @@ THREE.STLLoader.prototype = {
|
|
|
for ( var index = 0; index < fileLength; index ++ ) {
|
|
|
|
|
|
if ( reader.getUint8(index, false) > 127 ) {
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -255,7 +255,7 @@ THREE.STLLoader.prototype = {
|
|
|
} else {
|
|
|
return buf;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
};
|
|
@@ -337,7 +337,7 @@ if ( typeof DataView === 'undefined') {
|
|
|
|
|
|
if (!littleEndian && length > 1) {
|
|
|
|
|
|
- if (!(result instanceof Array)) {
|
|
|
+ if ( Array.isArray( result ) === false ) {
|
|
|
|
|
|
result = Array.prototype.slice.call(result);
|
|
|
|