Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function deserializeBinarySTL (stl, filename, version, elementFormatter, debug = false) {
// -- This makes more sense if you read http://en.wikipedia.org/wiki/STL_(file_format)#Binary_STL
let vertices = []
let triangles = []
let normals = []
let colors = []
let converted = 0
let vertexIndex = 0
let err = 0
let mcolor = null
let umask = parseInt('01000000000000000', 2)
let rmask = parseInt('00000000000011111', 2)
let gmask = parseInt('00000001111100000', 2)
let bmask = parseInt('00111110000000000', 2)
let br = new BinaryReader(stl)
let m = 0
let c = 0
let r = 0
let g = 0
let b = 0
let a = 0
for (let i = 0; i < 80; i++) {
switch (m) {
case 6:
r = br.readUInt8()
m += 1
continue
case 7:
g = br.readUInt8()
m += 1
function deserializeBinarySTL (stl, filename, version, elementFormatter, debug = false) {
// -- This makes more sense if you read http://en.wikipedia.org/wiki/STL_(file_format)#Binary_STL
let vertices = []
let triangles = []
let normals = []
let colors = []
let converted = 0
let vertexIndex = 0
let err = 0
let mcolor = null
let umask = parseInt('01000000000000000', 2)
let rmask = parseInt('00000000000011111', 2)
let gmask = parseInt('00000001111100000', 2)
let bmask = parseInt('00111110000000000', 2)
let br = new BinaryReader(stl)
let m = 0
let c = 0
let r = 0
let g = 0
let b = 0
let a = 0
for (let i = 0; i < 80; i++) {
switch (m) {
case 6:
r = br.readUInt8()
m += 1
continue
case 7:
g = br.readUInt8()
m += 1