{"ScriptPreparationCode":"\r\n\r\nfunction readAs(buf, Type, offset, count) {\r\n count = count === undefined || count === 0 ? 1 : count;\r\n const sub = buf.slice(offset, offset \u002B Type.BYTES_PER_ELEMENT * count);\r\n\r\n const r = new Type(sub);\r\n if (count === undefined || count === 1) return r[0];\r\n\r\n const ret = [];\r\n for (let i = 0; i \u003C count; i\u002B\u002B) {\r\n ret.push(r[i]);\r\n }\r\n\r\n return ret;\r\n}","TestCases":[{"Name":"blaaaa","Code":"(() =\u003E {\r\n const arraybuffer = new ArrayBuffer(1000000);\r\n const o = {};\r\n\r\n o.pointsOffset = readAs(arraybuffer, Uint32Array, 96); // offset to point data\r\n o.pointsFormatId = readAs(arraybuffer, Uint8Array, 104) \u0026 0b111111;\r\n o.pointsStructSize = readAs(arraybuffer, Uint16Array, 105); // point data record length\r\n o.pointsCount = readAs(arraybuffer, Uint32Array, 107); // number of point records\r\n\r\n let start = 32 * 3 \u002B 35;\r\n o.scale = readAs(arraybuffer, Float64Array, start, 3); // [scale X, scale Y, scale Z]\r\n start \u002B= 24;\r\n o.offset = readAs(arraybuffer, Float64Array, start, 3); // [offset X, offset Y, offset Z]\r\n start \u002B= 24;\r\n\r\n const bounds = readAs(arraybuffer, Float64Array, start, 6);\r\n o.maxs = [bounds[0], bounds[2], bounds[4]]; // max X, max Y, max Z\r\n o.mins = [bounds[1], bounds[3], bounds[5]]; // min X, min Y, min Z\r\n})()","IsDeferred":false},{"Name":"dataview","Code":"\r\n(() =\u003E {\r\n const arraybuffer = new ArrayBuffer(1000000);\r\n const o = {};\r\n const dv = new DataView(arraybuffer);\r\n\r\n o.pointsOffset = dv.getUint32(96, true); // offset to point data\r\n o.pointsFormatId = dv.getUint8(104, true) \u0026 0b111111;\r\n o.pointsStructSize = dv.getUint16(105, true); // point data record length\r\n\r\n o.extraBytes = 0;\r\n o.pointsCount = dv.getUint32(107, true);\r\n\r\n let start = 32 * 3 \u002B 35;\r\n o.scale = [dv.getFloat64(start, true), dv.getFloat64(start \u002B 8, true), dv.getFloat64(start \u002B 16, true)]; // [scale X, scale Y, scale Z]\r\n start \u002B= 24;\r\n o.offset = [dv.getFloat64(start, true), dv.getFloat64(start \u002B 8, true), dv.getFloat64(start \u002B 16, true)]; // [scale X, scale Y, scale Z]\r\n start \u002B= 24;\r\n\r\n const bounds = [\r\n dv.getFloat64(start, true),\r\n dv.getFloat64(start \u002B 8, true),\r\n dv.getFloat64(start \u002B 16, true),\r\n dv.getFloat64(start \u002B 24, true),\r\n dv.getFloat64(start \u002B 32, true),\r\n dv.getFloat64(start \u002B 40, true),\r\n ]; // [scale X, scale Y, scale Z];\r\n o.maxs = [bounds[0], bounds[2], bounds[4]]; // max X, max Y, max Z\r\n o.mins = [bounds[1], bounds[3], bounds[5]]; // min X, min Y, min Z\r\n\r\n})()","IsDeferred":false}]}