From d051b8ec047a2cce9599644f3becc15909109664 Mon Sep 17 00:00:00 2001 From: xeolabs Date: Thu, 18 Apr 2024 07:35:31 +0200 Subject: [PATCH] Fix source file extension detection --- convert2xkt.js | 10 +- dist/convert2xkt.cjs.js | 13 +- dist/xeokit-convert.cjs.js | 2 +- dist/xeokit-convert.cjs.js.map | 2 +- docs/ast/source/convert2xkt.js.json | 31299 ++++++++++++++------------ docs/file/src/convert2xkt.js.html | 13 +- docs/index.json | 108 +- docs/source.html | 104 +- package.json | 2 +- src/convert2xkt.js | 13 +- 10 files changed, 17086 insertions(+), 14480 deletions(-) diff --git a/convert2xkt.js b/convert2xkt.js index c368508..73bba28 100755 --- a/convert2xkt.js +++ b/convert2xkt.js @@ -68,6 +68,14 @@ function log(msg) { } } +function getFileExtension(fileName) { + let ext = path.extname(source); + if (ext.charAt(0) === ".") { + ext = ext.substring(1); + } + return ext; +} + async function main() { log(`[convert2xkt] Running convert2xkt v${npmPackage.version}...`); @@ -148,7 +156,7 @@ async function main() { const metaModelSource = (i < manifest.metadataOutFiles.length) ? manifest.metadataOutFiles[i] : null; const outputFileName = getFileNameWithoutExtension(source); const outputFileNameXKT = `${outputFileName}.xkt`; - const ext = path.extname(source); + const ext = getFileExtension(source); let modelAABB; // if (manifest.modelBoundsMin && manifest.modelBoundsMax) { diff --git a/dist/convert2xkt.cjs.js b/dist/convert2xkt.cjs.js index f3a931c..70a746d 100644 --- a/dist/convert2xkt.cjs.js +++ b/dist/convert2xkt.cjs.js @@ -26767,6 +26767,14 @@ function convert2xkt({ stats.conversionTime = 0; stats.aabb = null; + function getFileExtension(fileName) { + let ext = path.extname(source); + if (ext.charAt(0) === ".") { + ext = ext.substring(1); + } + return ext; + } + return new Promise(function (resolve, reject) { const _log = log; log = (msg) => { @@ -26795,7 +26803,10 @@ function convert2xkt({ const startTime = new Date(); const sourceConfigs = configs.sourceConfigs || {}; - const ext = sourceFormat || path.extname(source); + const ext = sourceFormat || getFileExtension(); + + log(`Input file extension: "${ext}"`); + let fileTypeConfigs = sourceConfigs[ext]; if (!fileTypeConfigs) { diff --git a/dist/xeokit-convert.cjs.js b/dist/xeokit-convert.cjs.js index 8ff7e8f..1d9de8c 100644 --- a/dist/xeokit-convert.cjs.js +++ b/dist/xeokit-convert.cjs.js @@ -1,3 +1,3 @@ /*! For license information please see xeokit-convert.cjs.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.convert2xkt=t():e.convert2xkt=t()}(global,(()=>(()=>{"use strict";var e={231:e=>{e.exports=require("fs")},423:e=>{e.exports=require("path")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{ClampToEdgeWrapping:()=>p,GIFMediaType:()=>O,JPEGMediaType:()=>P,LinearFilter:()=>M,LinearMipMapLinearFilter:()=>A,LinearMipMapNearestFilter:()=>I,LinearMipmapLinearFilter:()=>S,LinearMipmapNearestFilter:()=>T,MirroredRepeatWrapping:()=>m,NearestFilter:()=>y,NearestMipMapLinearFilter:()=>w,NearestMipMapNearestFilter:()=>g,NearestMipmapLinearFilter:()=>b,NearestMipmapNearestFilter:()=>x,PNGMediaType:()=>L,RepeatWrapping:()=>d,XKTModel:()=>He,XKT_INFO:()=>f,buildBoxGeometry:()=>zr,buildBoxLinesGeometry:()=>Ur,buildCylinderGeometry:()=>Xr,buildGridGeometry:()=>Rr,buildPlaneGeometry:()=>Kr,buildSphereGeometry:()=>qr,buildTorusGeometry:()=>Zr,buildVectorTextGeometry:()=>Wr,convert2xkt:()=>$r,parseCityJSONIntoXKTModel:()=>Nt,parseGLTFIntoXKTModel:()=>Wt,parseGLTFJSONIntoXKTModel:()=>ar,parseIFCIntoXKTModel:()=>mr,parseLASIntoXKTModel:()=>wr,parseMetaModelIntoXKTModel:()=>Mr,parsePCDIntoXKTModel:()=>Tr,parsePLYIntoXKTModel:()=>Pr,parseSTLIntoXKTModel:()=>Gr,writeXKTModelToArrayBuffer:()=>nt});const e=require("@loaders.gl/polyfills");var t,i,o,a,s,u,c,l,h,f={xktVersion:10},d=1e3,p=1001,m=1002,y=1003,g=1004,x=1004,b=1005,w=1005,M=1006,T=1007,I=1007,S=1008,A=1008,O=1e4,P=10001,L=10002,j=Float64Array,E=new j(16),D=new j(16),G=new j(4),k={MIN_DOUBLE:-Number.MAX_SAFE_INTEGER,MAX_DOUBLE:Number.MAX_SAFE_INTEGER,DEGTORAD:.0174532925,RADTODEG:57.295779513,vec2:function(e){return new j(e||2)},vec3:function(e){return new j(e||3)},vec4:function(e){return new j(e||4)},mat3:function(e){return new j(e||9)},mat3ToMat4:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4:function(e){return new j(e||16)},mat4ToMat3:function(e,t){},createUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return"".concat(e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255],"-").concat(e[255&r]).concat(e[r>>8&255],"-").concat(e[r>>16&15|64]).concat(e[r>>24&255],"-").concat(e[63&n|128]).concat(e[n>>8&255],"-").concat(e[n>>16&255]).concat(e[n>>24&255]).concat(e[255&i]).concat(e[i>>8&255]).concat(e[i>>16&255]).concat(e[i>>24&255])}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},fmod:function(e,t){if(e1?1:r,Math.acos(r)},vec3FromMat4Scale:(u=new j(3),function(e,t){return u[0]=e[0],u[1]=e[1],u[2]=e[2],t[0]=k.lenVec3(u),u[0]=e[4],u[1]=e[5],u[2]=e[6],t[1]=k.lenVec3(u),u[0]=e[8],u[1]=e[9],u[2]=e[10],t[2]=k.lenVec3(u),t}),vecToArray:function(){function e(e){return Math.round(1e5*e)/1e5}return function(t){for(var r=0,n=(t=Array.prototype.slice.call(t)).length;r0&&void 0!==arguments[0]?arguments[0]:new j(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},identityMat3:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},isIdentityMat4:function(e){return 1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]},negateMat4:function(e,t){return t||(t=e),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},addMat4:function(e,t,r){return r||(r=e),r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},addMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]+t,r[1]=e[1]+t,r[2]=e[2]+t,r[3]=e[3]+t,r[4]=e[4]+t,r[5]=e[5]+t,r[6]=e[6]+t,r[7]=e[7]+t,r[8]=e[8]+t,r[9]=e[9]+t,r[10]=e[10]+t,r[11]=e[11]+t,r[12]=e[12]+t,r[13]=e[13]+t,r[14]=e[14]+t,r[15]=e[15]+t,r},addScalarMat4:function(e,t,r){return k.addMat4Scalar(t,e,r)},subMat4:function(e,t,r){return r||(r=e),r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},subMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]-t,r[1]=e[1]-t,r[2]=e[2]-t,r[3]=e[3]-t,r[4]=e[4]-t,r[5]=e[5]-t,r[6]=e[6]-t,r[7]=e[7]-t,r[8]=e[8]-t,r[9]=e[9]-t,r[10]=e[10]-t,r[11]=e[11]-t,r[12]=e[12]-t,r[13]=e[13]-t,r[14]=e[14]-t,r[15]=e[15]-t,r},subScalarMat4:function(e,t,r){return r||(r=t),r[0]=e-t[0],r[1]=e-t[1],r[2]=e-t[2],r[3]=e-t[3],r[4]=e-t[4],r[5]=e-t[5],r[6]=e-t[6],r[7]=e-t[7],r[8]=e-t[8],r[9]=e-t[9],r[10]=e-t[10],r[11]=e-t[11],r[12]=e-t[12],r[13]=e-t[13],r[14]=e-t[14],r[15]=e-t[15],r},mulMat4:function(e,t,r){r||(r=e);var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],v=e[13],y=e[14],g=e[15],x=t[0],b=t[1],w=t[2],M=t[3],T=t[4],I=t[5],S=t[6],A=t[7],O=t[8],P=t[9],L=t[10],j=t[11],E=t[12],D=t[13],G=t[14],k=t[15];return r[0]=x*n+b*s+w*h+M*m,r[1]=x*i+b*u+w*f+M*v,r[2]=x*o+b*c+w*d+M*y,r[3]=x*a+b*l+w*p+M*g,r[4]=T*n+I*s+S*h+A*m,r[5]=T*i+I*u+S*f+A*v,r[6]=T*o+I*c+S*d+A*y,r[7]=T*a+I*l+S*p+A*g,r[8]=O*n+P*s+L*h+j*m,r[9]=O*i+P*u+L*f+j*v,r[10]=O*o+P*c+L*d+j*y,r[11]=O*a+P*l+L*p+j*g,r[12]=E*n+D*s+G*h+k*m,r[13]=E*i+D*u+G*f+k*v,r[14]=E*o+D*c+G*d+k*y,r[15]=E*a+D*l+G*p+k*g,r},mulMat3:function(e,t,r){r||(r=new j(9));var n=e[0],i=e[3],o=e[6],a=e[1],s=e[4],u=e[7],c=e[2],l=e[5],h=e[8],f=t[0],d=t[3],p=t[6],m=t[1],v=t[4],y=t[7],g=t[2],x=t[5],b=t[8];return r[0]=n*f+i*m+o*g,r[3]=n*d+i*v+o*x,r[6]=n*p+i*y+o*b,r[1]=a*f+s*m+u*g,r[4]=a*d+s*v+u*x,r[7]=a*p+s*y+u*b,r[2]=c*f+l*m+h*g,r[5]=c*d+l*v+h*x,r[8]=c*p+l*y+h*b,r},mulMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},mulMat4v4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=t[0],i=t[1],o=t[2],a=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*o+e[12]*a,r[1]=e[1]*n+e[5]*i+e[9]*o+e[13]*a,r[2]=e[2]*n+e[6]*i+e[10]*o+e[14]*a,r[3]=e[3]*n+e[7]*i+e[11]*o+e[15]*a,r},transposeMat4:function(e,t){var r=e[4],n=e[14],i=e[8],o=e[13],a=e[12],s=e[9];if(!t||e===t){var u=e[1],c=e[2],l=e[3],h=e[6],f=e[7],d=e[11];return e[1]=r,e[2]=i,e[3]=a,e[4]=u,e[6]=s,e[7]=o,e[8]=c,e[9]=h,e[11]=n,e[12]=l,e[13]=f,e[14]=d,e}return t[0]=e[0],t[1]=r,t[2]=i,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=o,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=n,t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},transposeMat3:function(e,t){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},determinantMat4:function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],m=e[14],v=e[15];return d*l*s*i-c*p*s*i-d*a*h*i+o*p*h*i+c*a*m*i-o*l*m*i-d*l*n*u+c*p*n*u+d*r*h*u-t*p*h*u-c*r*m*u+t*l*m*u+d*a*n*f-o*p*n*f-d*r*s*f+t*p*s*f+o*r*m*f-t*a*m*f-c*a*n*v+o*l*n*v+c*r*s*v-t*l*s*v-o*r*h*v+t*a*h*v},inverseMat4:function(e,t){t||(t=e);var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],y=e[15],g=r*s-n*a,x=r*u-i*a,b=r*c-o*a,w=n*u-i*s,M=n*c-o*s,T=i*c-o*u,I=l*m-h*p,S=l*v-f*p,A=l*y-d*p,O=h*v-f*m,P=h*y-d*m,L=f*y-d*v,j=1/(g*L-x*P+b*O+w*A-M*S+T*I);return t[0]=(s*L-u*P+c*O)*j,t[1]=(-n*L+i*P-o*O)*j,t[2]=(m*T-v*M+y*w)*j,t[3]=(-h*T+f*M-d*w)*j,t[4]=(-a*L+u*A-c*S)*j,t[5]=(r*L-i*A+o*S)*j,t[6]=(-p*T+v*b-y*x)*j,t[7]=(l*T-f*b+d*x)*j,t[8]=(a*P-s*A+c*I)*j,t[9]=(-r*P+n*A-o*I)*j,t[10]=(p*M-m*b+y*g)*j,t[11]=(-l*M+h*b-d*g)*j,t[12]=(-a*O+s*S-u*I)*j,t[13]=(r*O-n*S+i*I)*j,t[14]=(-p*w+m*x-v*g)*j,t[15]=(l*w-h*x+f*g)*j,t},traceMat4:function(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v:function(e,t){var r=t||k.identityMat4();return r[12]=e[0],r[13]=e[1],r[14]=e[2],r},translationMat3v:function(e,t){var r=t||k.identityMat3();return r[6]=e[0],r[7]=e[1],r},translationMat4c:(s=new j(3),function(e,t,r,n){return s[0]=e,s[1]=t,s[2]=r,k.translationMat4v(s,n)}),translationMat4s:function(e,t){return k.translationMat4c(e,e,e,t)},translateMat4v:function(e,t){return k.translateMat4c(e[0],e[1],e[2],t)},OLDtranslateMat4c:function(e,t,r,n){var i=n[12];n[0]+=i*e,n[4]+=i*t,n[8]+=i*r;var o=n[13];n[1]+=o*e,n[5]+=o*t,n[9]+=o*r;var a=n[14];n[2]+=a*e,n[6]+=a*t,n[10]+=a*r;var s=n[15];return n[3]+=s*e,n[7]+=s*t,n[11]+=s*r,n},translateMat4c:function(e,t,r,n){var i=n[3];n[0]+=i*e,n[1]+=i*t,n[2]+=i*r;var o=n[7];n[4]+=o*e,n[5]+=o*t,n[6]+=o*r;var a=n[11];n[8]+=a*e,n[9]+=a*t,n[10]+=a*r;var s=n[15];return n[12]+=s*e,n[13]+=s*t,n[14]+=s*r,n},rotationMat4v:function(e,t,r){var n,i,o,a,s,u,c=k.normalizeVec4([t[0],t[1],t[2],0],[]),l=Math.sin(e),h=Math.cos(e),f=1-h,d=c[0],p=c[1],m=c[2];return n=d*p,i=p*m,o=m*d,a=d*l,s=p*l,u=m*l,(r=r||k.mat4())[0]=f*d*d+h,r[1]=f*n+u,r[2]=f*o-s,r[3]=0,r[4]=f*n-u,r[5]=f*p*p+h,r[6]=f*i+a,r[7]=0,r[8]=f*o+s,r[9]=f*i-a,r[10]=f*m*m+h,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},rotationMat4c:function(e,t,r,n,i){return k.rotationMat4v(e,[t,r,n],i)},scalingMat4v:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.identityMat4();return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.identityMat3();return t[0]=e[0],t[4]=e[1],t},scalingMat4c:function(){var e=new j(3);return function(t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,k.scalingMat4v(e,i)}}(),scaleMat4c:function(e,t,r,n){return n[0]*=e,n[4]*=t,n[8]*=r,n[1]*=e,n[5]*=t,n[9]*=r,n[2]*=e,n[6]*=t,n[10]*=r,n[3]*=e,n[7]*=t,n[11]*=r,n},scaleMat4v:function(e,t){var r=e[0],n=e[1],i=e[2];return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,t},scalingMat4s:function(e){return k.scalingMat4c(e,e,e)},rotationTranslationMat4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.mat4(),n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,u=i+i,c=o+o,l=n*s,h=n*u,f=n*c,d=i*u,p=i*c,m=o*c,v=a*s,y=a*u,g=a*c;return r[0]=1-(d+m),r[1]=h+g,r[2]=f-y,r[3]=0,r[4]=h-g,r[5]=1-(l+m),r[6]=p+v,r[7]=0,r[8]=f+y,r[9]=p-v,r[10]=1-(l+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},mat4ToEuler:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=k.clamp,i=e[0],o=e[4],a=e[8],s=e[1],u=e[5],c=e[9],l=e[2],h=e[6],f=e[10];return"XYZ"===t?(r[1]=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(r[0]=Math.atan2(-c,f),r[2]=Math.atan2(-o,i)):(r[0]=Math.atan2(h,u),r[2]=0)):"YXZ"===t?(r[0]=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(r[1]=Math.atan2(a,f),r[2]=Math.atan2(s,u)):(r[1]=Math.atan2(-l,i),r[2]=0)):"ZXY"===t?(r[0]=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(r[1]=Math.atan2(-l,f),r[2]=Math.atan2(-o,u)):(r[1]=0,r[2]=Math.atan2(s,i))):"ZYX"===t?(r[1]=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(r[0]=Math.atan2(h,f),r[2]=Math.atan2(s,i)):(r[0]=0,r[2]=Math.atan2(-o,u))):"YZX"===t?(r[2]=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(r[0]=Math.atan2(-c,u),r[1]=Math.atan2(-l,i)):(r[0]=0,r[1]=Math.atan2(a,f))):"XZY"===t&&(r[2]=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(r[0]=Math.atan2(h,u),r[1]=Math.atan2(a,i)):(r[0]=Math.atan2(-c,f),r[1]=0)),r},composeMat4:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k.mat4();return k.quaternionToRotationMat4(t,n),k.scaleMat4v(r,n),k.translateMat4v(e,n),n},decomposeMat4:function(){var e=new j(3),t=new j(16);return function(r,n,i,o){e[0]=r[0],e[1]=r[1],e[2]=r[2];var a=k.lenVec3(e);e[0]=r[4],e[1]=r[5],e[2]=r[6];var s=k.lenVec3(e);e[8]=r[8],e[9]=r[9],e[10]=r[10];var u=k.lenVec3(e);k.determinantMat4(r)<0&&(a=-a),n[0]=r[12],n[1]=r[13],n[2]=r[14],t.set(r);var c=1/a,l=1/s,h=1/u;return t[0]*=c,t[1]*=c,t[2]*=c,t[4]*=l,t[5]*=l,t[6]*=l,t[8]*=h,t[9]*=h,t[10]*=h,k.mat4ToQuaternion(t,i),o[0]=a,o[1]=s,o[2]=u,this}}(),lookAtMat4v:function(e,t,r,n){n||(n=k.mat4());var i,o,a,s,u,c,l,h,f,d,p=e[0],m=e[1],v=e[2],y=r[0],g=r[1],x=r[2],b=t[0],w=t[1],M=t[2];return p===b&&m===w&&v===M?k.identityMat4():(i=p-b,o=m-w,a=v-M,s=g*(a*=d=1/Math.sqrt(i*i+o*o+a*a))-x*(o*=d),u=x*(i*=d)-y*a,c=y*o-g*i,(d=Math.sqrt(s*s+u*u+c*c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),l=o*c-a*u,h=a*s-i*c,f=i*u-o*s,(d=Math.sqrt(l*l+h*h+f*f))?(l*=d=1/d,h*=d,f*=d):(l=0,h=0,f=0),n[0]=s,n[1]=l,n[2]=i,n[3]=0,n[4]=u,n[5]=h,n[6]=o,n[7]=0,n[8]=c,n[9]=f,n[10]=a,n[11]=0,n[12]=-(s*p+u*m+c*v),n[13]=-(l*p+h*m+f*v),n[14]=-(i*p+o*m+a*v),n[15]=1,n)},lookAtMat4c:function(e,t,r,n,i,o,a,s,u){return k.lookAtMat4v([e,t,r],[n,i,o],[a,s,u],[])},orthoMat4c:function(e,t,r,n,i,o,a){a||(a=k.mat4());var s=t-e,u=n-r,c=o-i;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(n+r)/u,a[14]=-(o+i)/c,a[15]=1,a},frustumMat4v:function(e,t,r){r||(r=k.mat4());var n=[e[0],e[1],e[2],0],i=[t[0],t[1],t[2],0];k.addVec4(i,n,E),k.subVec4(i,n,D);var o=2*n[2],a=D[0],s=D[1],u=D[2];return r[0]=o/a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o/s,r[6]=0,r[7]=0,r[8]=E[0]/a,r[9]=E[1]/s,r[10]=-E[2]/u,r[11]=-1,r[12]=0,r[13]=0,r[14]=-o*i[2]/u,r[15]=0,r},frustumMat4:function(e,t,r,n,i,o,a){a||(a=k.mat4());var s=t-e,u=n-r,c=o-i;return a[0]=2*i/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*i/u,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(n+r)/u,a[10]=-(o+i)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-o*i*2/c,a[15]=0,a},perspectiveMat4:function(e,t,r,n,i){var o=[],a=[];return o[2]=r,a[2]=n,a[1]=o[2]*Math.tan(e/2),o[1]=-a[1],a[0]=a[1]*t,o[0]=-a[0],k.frustumMat4v(o,a,i)},transformPoint3:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec3(),n=t[0],i=t[1],o=t[2];return r[0]=e[0]*n+e[4]*i+e[8]*o+e[12],r[1]=e[1]*n+e[5]*i+e[9]*o+e[13],r[2]=e[2]*n+e[6]*i+e[10]*o+e[14],r},transformPoint4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4();return r[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],r[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],r[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],r[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],r},transformPoints3:function(e,t,r){for(var n,i,o,a,s,u=r||[],c=t.length,l=e[0],h=e[1],f=e[2],d=e[3],p=e[4],m=e[5],v=e[6],y=e[7],g=e[8],x=e[9],b=e[10],w=e[11],M=e[12],T=e[13],I=e[14],S=e[15],A=0;A2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;r2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;r0&&void 0!==arguments[0]?arguments[0]:k.vec4();return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=e[0]*k.DEGTORAD/2,i=e[1]*k.DEGTORAD/2,o=e[2]*k.DEGTORAD/2,a=Math.cos(n),s=Math.cos(i),u=Math.cos(o),c=Math.sin(n),l=Math.sin(i),h=Math.sin(o);return"XYZ"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u-c*l*h):"YXZ"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u+c*l*h):"ZXY"===t?(r[0]=c*s*u-a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u-c*l*h):"ZYX"===t?(r[0]=c*s*u-a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u+c*l*h):"YZX"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u-c*l*h):"XZY"===t&&(r[0]=c*s*u-a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u+c*l*h),r},mat4ToQuaternion:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),n=e[0],i=e[4],o=e[8],a=e[1],s=e[5],u=e[9],c=e[2],l=e[6],h=e[10],f=n+s+h;return f>0?(t=.5/Math.sqrt(f+1),r[3]=.25/t,r[0]=(l-u)*t,r[1]=(o-c)*t,r[2]=(a-i)*t):n>s&&n>h?(t=2*Math.sqrt(1+n-s-h),r[3]=(l-u)/t,r[0]=.25*t,r[1]=(i+a)/t,r[2]=(o+c)/t):s>h?(t=2*Math.sqrt(1+s-n-h),r[3]=(o-c)/t,r[0]=(i+a)/t,r[1]=.25*t,r[2]=(u+l)/t):(t=2*Math.sqrt(1+h-n-s),r[3]=(a-i)/t,r[0]=(o+c)/t,r[1]=(u+l)/t,r[2]=.25*t),r},vec3PairToQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=Math.sqrt(k.dotVec3(e,e)*k.dotVec3(t,t)),i=n+k.dotVec3(e,t);return i<1e-8*n?(i=0,Math.abs(e[0])>Math.abs(e[2])?(r[0]=-e[1],r[1]=e[0],r[2]=0):(r[0]=0,r[1]=-e[2],r[2]=e[1])):k.cross3Vec3(e,t,r),r[3]=i,k.normalizeQuaternion(r)},angleAxisToQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),r=e[3]/2,n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},quaternionToEuler:function(){var e=new j(16);return function(t,r,n){return n=n||k.vec3(),k.quaternionToRotationMat4(t,e),k.mat4ToEuler(e,r,n),n}}(),mulQuaternions:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=e[0],i=e[1],o=e[2],a=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return r[0]=a*s+n*l+i*c-o*u,r[1]=a*u+i*l+o*s-n*c,r[2]=a*c+o*l+n*u-i*s,r[3]=a*l-n*s-i*u-o*c,r},vec3ApplyQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec3(),n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2],c=e[3],l=c*n+s*o-u*i,h=c*i+u*n-a*o,f=c*o+a*i-s*n,d=-a*n-s*i-u*o;return r[0]=l*c+d*-a+h*-u-f*-s,r[1]=h*c+d*-s+f*-a-l*-u,r[2]=f*c+d*-u+l*-s-h*-a,r},quaternionToMat4:function(e,t){t=k.identityMat4(t);var r=e[0],n=e[1],i=e[2],o=e[3],a=2*r,s=2*n,u=2*i,c=a*o,l=s*o,h=u*o,f=a*r,d=s*r,p=u*r,m=s*n,v=u*n,y=u*i;return t[0]=1-(m+y),t[1]=d+h,t[2]=p-l,t[4]=d-h,t[5]=1-(f+y),t[6]=v+c,t[8]=p+l,t[9]=v-c,t[10]=1-(f+m),t},quaternionToRotationMat4:function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=r*s,h=r*u,f=n*s,d=n*u,p=i*u,m=o*a,v=o*s,y=o*u;return t[0]=1-(f+p),t[4]=l-y,t[8]=h+v,t[1]=l+y,t[5]=1-(c+p),t[9]=d-m,t[2]=h-v,t[6]=d+m,t[10]=1-(c+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},normalizeQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=k.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r,t[3]=e[3]/r,t},conjugateQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},inverseQuaternion:function(e,t){return k.normalizeQuaternion(k.conjugateQuaternion(e,t))},quaternionToAngleAxis:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),r=(e=k.normalizeQuaternion(e,G))[3],n=2*Math.acos(r),i=Math.sqrt(1-r*r);return i<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i),t[3]=n,t},AABB3:function(e){return new j(e||6)},AABB2:function(e){return new j(e||4)},OBB3:function(e){return new j(e||32)},OBB2:function(e){return new j(e||16)},Sphere3:function(e,t,r,n){return new j([e,t,r,n])},transformOBB3:function(e,t){var r,n,i,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;rs?a:s,o[1]+=u>c?u:c,o[2]+=l>h?l:h,Math.abs(k.lenVec3(o))}}(),getAABB3Center:function(e,t){var r=t||k.vec3();return r[0]=(e[0]+e[3])/2,r[1]=(e[1]+e[4])/2,r[2]=(e[2]+e[5])/2,r},getAABB2Center:function(e,t){var r=t||k.vec2();return r[0]=(e[2]+e[0])/2,r[1]=(e[3]+e[1])/2,r},collapseAABB3:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.AABB3();return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MAX_DOUBLE,e[3]=-k.MAX_DOUBLE,e[4]=-k.MAX_DOUBLE,e[5]=-k.MAX_DOUBLE,e},AABB3ToOBB3:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.OBB3();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t[4]=e[3],t[5]=e[1],t[6]=e[2],t[7]=1,t[8]=e[3],t[9]=e[4],t[10]=e[2],t[11]=1,t[12]=e[0],t[13]=e[4],t[14]=e[2],t[15]=1,t[16]=e[0],t[17]=e[1],t[18]=e[5],t[19]=1,t[20]=e[3],t[21]=e[1],t[22]=e[5],t[23]=1,t[24]=e[3],t[25]=e[4],t[26]=e[5],t[27]=1,t[28]=e[0],t[29]=e[4],t[30]=e[5],t[31]=1,t},positions3ToAABB3:(t=new j(3),function(e,r,n){r=r||k.AABB3();for(var i,o,a,s=k.MAX_DOUBLE,u=k.MAX_DOUBLE,c=k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=-k.MAX_DOUBLE,f=-k.MAX_DOUBLE,d=0,p=e.length;dl&&(l=i),o>h&&(h=o),a>f&&(f=a);return r[0]=s,r[1]=u,r[2]=c,r[3]=l,r[4]=h,r[5]=f,r}),OBB3ToAABB3:function(e){for(var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.AABB3(),o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MAX_DOUBLE,u=-k.MAX_DOUBLE,c=-k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=0,f=e.length;hu&&(u=t),r>c&&(c=r),n>l&&(l=n);return i[0]=o,i[1]=a,i[2]=s,i[3]=u,i[4]=c,i[5]=l,i},points3ToAABB3:function(e){for(var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.AABB3(),o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MAX_DOUBLE,u=-k.MAX_DOUBLE,c=-k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=0,f=e.length;hu&&(u=t),r>c&&(c=r),n>l&&(l=n);return i[0]=o,i[1]=a,i[2]=s,i[3]=u,i[4]=c,i[5]=l,i},points3ToSphere3:function(){var e=new j(3);return function(t,r){r=r||k.vec4();var n,i=0,o=0,a=0,s=t.length;for(n=0;nc&&(c=u);return r[3]=c,r}}(),positions3ToSphere3:function(){var e=new j(3),t=new j(3);return function(r,n){n=n||k.vec4();var i,o=0,a=0,s=0,u=r.length,c=0;for(i=0;ic&&(c=l);return n[3]=c,n}}(),OBB3ToSphere3:function(){var e=new j(3),t=new j(3);return function(r,n){n=n||k.vec4();var i,o=0,a=0,s=0,u=r.length,c=u/4;for(i=0;ih&&(h=l);return n[3]=h,n}}(),getSphere3Center:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec3();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},expandAABB3:function(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]3&&void 0!==arguments[3]?arguments[3]:k.vec3(),i=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],s=r[0]-e[0],u=r[1]-e[1],c=r[2]-e[2],l=o*c-a*u,h=a*s-i*c,f=i*u-o*s,d=Math.sqrt(l*l+h*h+f*f);return 0===d?(n[0]=0,n[1]=0,n[2]=0):(n[0]=l/d,n[1]=h/d,n[2]=f/d),n}};function _(e,t,r,n){var i=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),o=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){var a=(1-Math.abs(o))*(i>=0?1:-1),s=(1-Math.abs(i))*(o>=0?1:-1);i=a,o=s}return new Int8Array([Math[r](127.5*i+(i<0?-1:0)),Math[n](127.5*o+(o<0?-1:0))])}function F(e){var t=e[0],r=e[1];t/=t<0?127:128,r/=r<0?127:128;var n=1-Math.abs(t)-Math.abs(r);n<0&&(t=(1-Math.abs(r))*(t>=0?1:-1),r=(1-Math.abs(t))*(r>=0?1:-1));var i=Math.sqrt(t*t+r*r+n*n);return[t/i,r/i,n/i]}function N(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]}var V,C,B,z,U,X,R,K,q,Z,Y,W,Q,J,H,$,ee,te={quantizePositions:function(e,t,r,n){for(var i=r[0],o=r[1],a=r[2],s=65535,u=s/(r[3]-i),c=s/(r[4]-o),l=s/(r[5]-a),h=function(e){return e>=0?e:0},f=0;fu&&(a=o,u=s),(s=N(h,0,F(o=_(h,0,"floor","ceil"))))>u&&(a=o,u=s),(s=N(h,0,F(o=_(h,0,"ceil","ceil"))))>u&&(a=o,u=s),n[i+c+0]=a[0],n[i+c+1]=a[1],n[i+c+2]=0;return i+r},octEncodeNormals:function(e,t,r,n){for(var i,o,a,s,u=0;us&&(o=i,s=a),(a=N(e,u,F(i=_(e,u,"floor","ceil"))))>s&&(o=i,s=a),(a=N(e,u,F(i=_(e,u,"ceil","ceil"))))>s&&(o=i,s=a),r[n+u+0]=o[0],r[n+u+1]=o[1],r[n+u+2]=0;return n+t}},re=(V=[],C=[],B=[],z=[],U=[],X=0,R=new Uint16Array(3),K=new Uint16Array(3),q=new Uint16Array(3),Z=k.vec3(),Y=k.vec3(),W=k.vec3(),Q=k.vec3(),J=k.vec3(),H=k.vec3(),$=k.vec3(),ee=k.vec3(),function(e,t,r,n){!function(e,t){var r,n,i,o,a,s,u={},c=Math.pow(10,4),l=0;for(a=0,s=e.length;av&&T>v)continue}d=B[c.index1],p=B[c.index2],(!g&&d>65535||p>65535)&&(g=!0),m.push(d),m.push(p)}return g?new Uint32Array(m):new Uint16Array(m)}),ne=function(e,t,r,n){function i(e,r){for(var n,i,o=0;o<3;o++)if((n=t[3*e+o])!==(i=t[3*r+o]))return i-n;return 0}for(var o=e.slice().sort(i),a=null,s=0,u=o.length;sf&&h>d?f>d?(p=h,m=f,v=d):(p=h,m=d,v=f):f>h&&f>d?h>d?(p=f,m=h,v=d):(p=f,m=d,v=h):d>h&&d>f&&(h>f?(p=d,m=h,v=f):(p=d,m=f,v=h)),n[c+0]=[p,m],n[c+1]=[m,v],p>v){var y=v;v=p,p=y}n[c+2]=[v,p]}function g(e,t){for(var r,n,i=0;i<2;i++)if(r=e[i],(n=t[i])!==r)return n-r;return 0}(n=n.slice(0,e.length)).sort(g);for(var x=0,b=0;b0&&2!==x)};function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function oe(e,t){for(var r=0;r1}}])&&ce(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function fe(e,t){for(var r=0;r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Re(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Ke(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modelId=t.modelId||"default",this.projectId=t.projectId||"",this.revisionId=t.revisionId||"",this.author=t.author||"",this.createdAt=t.createdAt||"",this.creatingApplication=t.creatingApplication||"",this.schema=t.schema||"",this.xktVersion=f.xktVersion,this.edgeThreshold=t.edgeThreshold||10,this.minTileSize=t.minTileSize||500,this.modelAABB=t.modelAABB,this.propertySets={},this.propertySetsList=[],this.metaObjects={},this.metaObjectsList=[],this.reusedGeometriesDecodeMatrix=new Float32Array(16),this.geometries={},this.geometriesList=[],this.textures={},this.texturesList=[],this.textureSets={},this.textureSetsList=[],this.meshes={},this.meshesList=[],this.entities={},this.entitiesList=[],this.tilesList=[],this.aabb=k.AABB3(),this.finalized=!1}var t,r,n,i;return t=e,r=[{key:"createPropertySet",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.propertySetId||void 0===e.propertySetId)throw"Parameter expected: params.propertySetId";if(null===e.properties||void 0===e.properties)throw"Parameter expected: params.properties";if(this.finalized)console.error("XKTModel has been finalized, can't add more property sets");else if(!this.propertySets[e.propertySetId]){var t=e.propertySetId,r=e.propertySetType||"Default",n=e.propertySetName||e.propertySetId,i=e.properties||[],o=new je(t,r,n,i);return this.propertySets[t]=o,this.propertySetsList.push(o),o}}},{key:"createMetaObject",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.metaObjectId||void 0===e.metaObjectId)throw"Parameter expected: params.metaObjectId";if(this.finalized)console.error("XKTModel has been finalized, can't add more meta objects");else if(!this.metaObjects[e.metaObjectId]){var t=e.metaObjectId,r=e.propertySetIds,n=e.metaObjectType||"Default",i=e.metaObjectName||e.metaObjectId,o=e.parentMetaObjectId,a=new Ae(t,r,n,i,o);return this.metaObjects[t]=a,this.metaObjectsList.push(a),o||this._rootMetaObject||(this._rootMetaObject=a),a}}},{key:"createTexture",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.textureId||void 0===e.textureId)throw"Parameter expected: params.textureId";if(!e.imageData&&!e.src)throw"Parameter expected: params.imageData or params.src";if(this.finalized)console.error("XKTModel has been finalized, can't add more textures");else{if(!this.textures[e.textureId]){if(e.src){var t=e.src.split(".").pop();if("jpg"!==t&&"jpeg"!==t&&"png"!==t)return void console.error("XKTModel does not support image files with extension '".concat(t,"' - won't create texture '").concat(e.textureId))}var r=e.textureId,n=new ke({textureId:r,imageData:e.imageData,mediaType:e.mediaType,minFilter:e.minFilter,magFilter:e.magFilter,wrapS:e.wrapS,wrapT:e.wrapT,wrapR:e.wrapR,width:e.width,height:e.height,compressed:!1!==e.compressed,src:e.src});return this.textures[r]=n,this.texturesList.push(n),n}console.error("XKTTexture already exists with this ID: "+e.textureId)}}},{key:"createTextureSet",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.textureSetId||void 0===e.textureSetId)throw"Parameter expected: params.textureSetId";if(this.finalized)console.error("XKTModel has been finalized, can't add more textureSets");else{if(!this.textureSets[e.textureSetId]){var t,r,n,i,o;if(void 0!==e.colorTextureId&&null!==e.colorTextureId){if(!(t=this.textures[e.colorTextureId]))return void console.error("Texture not found: ".concat(e.colorTextureId," - ensure that you create it first with createTexture()"));t.channel=0}if(void 0!==e.metallicRoughnessTextureId&&null!==e.metallicRoughnessTextureId){if(!(r=this.textures[e.metallicRoughnessTextureId]))return void console.error("Texture not found: ".concat(e.metallicRoughnessTextureId," - ensure that you create it first with createTexture()"));r.channel=1}if(void 0!==e.normalsTextureId&&null!==e.normalsTextureId){if(!(n=this.textures[e.normalsTextureId]))return void console.error("Texture not found: ".concat(e.normalsTextureId," - ensure that you create it first with createTexture()"));n.channel=2}if(void 0!==e.emissiveTextureId&&null!==e.emissiveTextureId){if(!(i=this.textures[e.emissiveTextureId]))return void console.error("Texture not found: ".concat(e.emissiveTextureId," - ensure that you create it first with createTexture()"));i.channel=3}if(void 0!==e.occlusionTextureId&&null!==e.occlusionTextureId){if(!(o=this.textures[e.occlusionTextureId]))return void console.error("Texture not found: ".concat(e.occlusionTextureId," - ensure that you create it first with createTexture()"));o.channel=4}var a=new Ve({textureSetId:e.textureSetId,textureSetIndex:this.textureSetsList.length,colorTexture:t,metallicRoughnessTexture:r,normalsTexture:n,emissiveTexture:i,occlusionTexture:o});return this.textureSets[e.textureSetId]=a,this.textureSetsList.push(a),a}console.error("XKTTextureSet already exists with this ID: "+e.textureSetId)}}},{key:"createGeometry",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.geometryId||void 0===e.geometryId)throw"Parameter expected: params.geometryId";if(!e.primitiveType)throw"Parameter expected: params.primitiveType";if(!e.positions)throw"Parameter expected: params.positions";var t="triangles"===e.primitiveType,r="points"===e.primitiveType,n="lines"===e.primitiveType,i="line-strip"===e.primitiveType;if(e.primitiveType,e.primitiveType,!(t||r||n||i))throw"Unsupported value for params.primitiveType: "+e.primitiveType+"' - supported values are 'triangles', 'points', 'lines', 'line-strip', 'triangle-strip' and 'triangle-fan";if(t&&!e.indices)throw e.indices=this._createDefaultIndices(),"Parameter expected for 'triangles' primitive: params.indices";if(r&&!e.colors&&!e.colorsCompressed)throw"Parameter expected for 'points' primitive: params.colors or params.colorsCompressed";if(n&&!e.indices)throw"Parameter expected for 'lines' primitive: params.indices";if(this.finalized)console.error("XKTModel has been finalized, can't add more geometries");else{if(!this.geometries[e.geometryId]){var o=e.geometryId,a=e.primitiveType,s=new Float64Array(e.positions),u={geometryId:o,geometryIndex:this.geometriesList.length,primitiveType:a,positions:s,uvs:e.uvs||e.uv};if(t&&(e.normals&&(u.normals=new Float32Array(e.normals)),e.indices?u.indices=e.indices:u.indices=this._createDefaultIndices(s.length/3)),r)if(e.colorsCompressed)u.colorsCompressed=new Uint8Array(e.colorsCompressed);else{for(var c=e.colors,l=new Uint8Array(c.length),h=0,f=c.length;h1)te.octEncodeNormals(n.normals,n.normals.length,n.normalsOctEncoded,0);else{var i=k.inverseMat4(k.transposeMat4(r.matrix,Ye),We);te.transformAndOctEncodeNormals(i,n.normals,n.normals.length,n.normalsOctEncoded,0)}}}},{key:"_createEntityAABBs",value:function(){for(var e=0,t=this.entitiesList.length;e1)for(var l=u.positions,h=0,f=l.length;hQe[i]&&(i=1),Qe[2]>Qe[i]&&(i=2),!e.left){var o=r.slice();if(o[i+3]=(r[i]+r[i+3])/2,e.left=new Me(o),k.containsAABB3(o,n))return void this._insertEntityIntoKDTree(e.left,t)}if(!e.right){var a=r.slice();if(a[i]=(r[i]+r[i+3])/2,e.right=new Me(a),k.containsAABB3(a,n))return void this._insertEntityIntoKDTree(e.right,t)}e.entities=e.entities||[],e.entities.push(t),k.expandAABB3(r,n)}}},{key:"_createTilesFromKDTree",value:function(e){this._createTilesFromKDNode(e)}},{key:"_createTilesFromKDNode",value:function(e){e.entities&&e.entities.length>0&&this._createTileFromEntities(e),e.left&&this._createTilesFromKDNode(e.left),e.right&&this._createTilesFromKDNode(e.right)}},{key:"_createTileFromEntities",value:function(e){var t=e.aabb,r=e.entities,n=k.getAABB3Center(t),i=k.mulVec3Scalar(n,-1,k.vec3()),o=k.AABB3();o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o[3]=t[3]-n[0],o[4]=t[4]-n[1],o[5]=t[5]-n[2];for(var a=0;a0){te.createPositionsDecodeMatrix(t,this.reusedGeometriesDecodeMatrix);for(var c=0,l=this.geometriesList.length;ce&&(e=i.positionsQuantized.length),i.indices.length>t&&(t=i.indices.length))}for(var o=new Array(e/3),a=new Array(t),s=0,u=this.geometriesList.length;s1&&(S+=16);var D={metadata:{},textureData:new Uint8Array(A),eachTextureDataPortion:new Uint32Array(p),eachTextureAttributes:new Uint16Array(p*tt),positions:new Uint16Array(x),normals:new Int8Array(b),colors:new Uint8Array(w),uvs:new Float32Array(M),indices:new Uint32Array(T),edgeIndices:new Uint32Array(I),eachTextureSetTextures:new Int32Array(5*m),matrices:new Float32Array(S),reusedGeometriesDecodeMatrix:new Float32Array(e.reusedGeometriesDecodeMatrix),eachGeometryPrimitiveType:new Uint8Array(d),eachGeometryPositionsPortion:new Uint32Array(d),eachGeometryNormalsPortion:new Uint32Array(d),eachGeometryColorsPortion:new Uint32Array(d),eachGeometryUVsPortion:new Uint32Array(d),eachGeometryIndicesPortion:new Uint32Array(d),eachGeometryEdgeIndicesPortion:new Uint32Array(d),eachMeshGeometriesPortion:new Uint32Array(v),eachMeshMatricesPortion:new Uint32Array(v),eachMeshTextureSet:new Int32Array(v),eachMeshMaterialAttributes:new Uint8Array(v*rt),eachEntityId:[],eachEntityMeshesPortion:new Uint32Array(y),eachTileAABB:new Float64Array(6*g),eachTileEntitiesPortion:new Uint32Array(g)},G=0,k=0,_=0,F=0,N=0,V=0;D.metadata={id:e.modelId,projectId:e.projectId,revisionId:e.revisionId,author:e.author,createdAt:e.createdAt,creatingApplication:e.creatingApplication,schema:e.schema,propertySets:[],metaObjects:[]};for(var C=0;C0&&(R.propertySetIds=X.propertySetIds),X.external&&(R.external=X.external),D.metadata.metaObjects.push(R)}for(var K=0;K1&&(D.matrices.set(xe.matrix,se),D.eachMeshMatricesPortion[ue]=se,se+=16),D.eachMeshTextureSet[ue]=xe.textureSet?xe.textureSet.textureSetIndex:-1,D.eachMeshMaterialAttributes[ae++]=255*xe.color[0],D.eachMeshMaterialAttributes[ae++]=255*xe.color[1],D.eachMeshMaterialAttributes[ae++]=255*xe.color[2],D.eachMeshMaterialAttributes[ae++]=255*xe.opacity,D.eachMeshMaterialAttributes[ae++]=255*xe.metallic,D.eachMeshMaterialAttributes[ae++]=255*xe.roughness,ue++}D.eachEntityId[ie]=me.entityId,D.eachEntityMeshesPortion[ie]=oe,ie++,oe+=ye}var we=6*ce;D.eachTileAABB.set(de,we)}}return D}(e,t,r),o=function(e,t,r){function n(e){return!1!==r.zip?$e.deflate(e):e}return{metadata:n(it(t||e.metadata)),textureData:n(e.textureData.buffer),eachTextureDataPortion:n(e.eachTextureDataPortion.buffer),eachTextureAttributes:n(e.eachTextureAttributes.buffer),positions:n(e.positions.buffer),normals:n(e.normals.buffer),colors:n(e.colors.buffer),uvs:n(e.uvs.buffer),indices:n(e.indices.buffer),edgeIndices:n(e.edgeIndices.buffer),eachTextureSetTextures:n(e.eachTextureSetTextures.buffer),matrices:n(e.matrices.buffer),reusedGeometriesDecodeMatrix:n(e.reusedGeometriesDecodeMatrix.buffer),eachGeometryPrimitiveType:n(e.eachGeometryPrimitiveType.buffer),eachGeometryPositionsPortion:n(e.eachGeometryPositionsPortion.buffer),eachGeometryNormalsPortion:n(e.eachGeometryNormalsPortion.buffer),eachGeometryColorsPortion:n(e.eachGeometryColorsPortion.buffer),eachGeometryUVsPortion:n(e.eachGeometryUVsPortion.buffer),eachGeometryIndicesPortion:n(e.eachGeometryIndicesPortion.buffer),eachGeometryEdgeIndicesPortion:n(e.eachGeometryEdgeIndicesPortion.buffer),eachMeshGeometriesPortion:n(e.eachMeshGeometriesPortion.buffer),eachMeshMatricesPortion:n(e.eachMeshMatricesPortion.buffer),eachMeshTextureSet:n(e.eachMeshTextureSet.buffer),eachMeshMaterialAttributes:n(e.eachMeshMaterialAttributes.buffer),eachEntityId:n(JSON.stringify(e.eachEntityId).replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)}))),eachEntityMeshesPortion:n(e.eachEntityMeshesPortion.buffer),eachTileAABB:n(e.eachTileAABB.buffer),eachTileEntitiesPortion:n(e.eachTileEntitiesPortion.buffer)}}(i,t,n);r.texturesSize+=o.textureData.byteLength;var a=function(e){return function(e){var t=new Uint32Array(e.length+2);t[0]=et,t[1]=e.length;for(var r=0,n=0,i=e.length;n80*r){n=o=e[0],i=a=e[1];for(var p=r;po&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return ut(f,d,r,n,i,c),d}function at(e,t,r,n,i){var o,a;if(i===jt(e,t,r,n)>0)for(o=t;o=t;o-=n)a=Ot(o,e[o],e[o+1],a);return a&&wt(a,a.next)&&(Pt(a),a=a.next),a}function st(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!wt(n,n.next)&&0!==bt(n.prev,n,n.next))n=n.next;else{if(Pt(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ut(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=vt(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(e,n,i,o);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?lt(e,n,i,o):ct(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),Pt(e),e=u.next,c=u.next;else if((e=u)===c){a?1===a?ut(e=ht(st(e),t,r),t,r,n,i,o,2):2===a&&ft(e,t,r,n,i,o):ut(st(e),t,r,n,i,o,1);break}}}function ct(e){var t=e.prev,r=e,n=e.next;if(bt(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(gt(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&bt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function lt(e,t,r,n){var i=e.prev,o=e,a=e.next;if(bt(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=vt(s,u,t,r,n),f=vt(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=h&&p&&p.z<=f;){if(d!==e.prev&&d!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&bt(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&bt(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==e.prev&&p!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ht(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!wt(i,o)&&Mt(i,n,n.next,o)&&St(i,o)&&St(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),Pt(n),Pt(n.next),n=e=o),n=n.next}while(n!==e);return st(n)}function ft(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&xt(a,s)){var u=At(a,s);return a=st(a,a.next),u=st(u,u.next),ut(a,t,r,n,i,o),void ut(u,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function dt(e,t){return e.x-t.x}function pt(e,t){if(t=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&>(or.x||n.x===r.x&&mt(r,n)))&&(r=n,f=u)),n=n.next}while(n!==c);return r}(e,t),t){var r=At(t,e);st(t,t.next),st(r,r.next)}}function mt(e,t){return bt(e.prev,e,t.prev)<0&&bt(t.next,e,e.next)<0}function vt(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function yt(e){var t=e,r=e;do{(t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function xt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Mt(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(St(e,t)&&St(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(bt(e.prev,e,t.prev)||bt(e,t.prev,t))||wt(e,t)&&bt(e.prev,e,e.next)>0&&bt(t.prev,t,t.next)>0)}function bt(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function wt(e,t){return e.x===t.x&&e.y===t.y}function Mt(e,t,r,n){var i=It(bt(e,t,r)),o=It(bt(e,t,n)),a=It(bt(r,n,e)),s=It(bt(r,n,t));return i!==o&&a!==s||!(0!==i||!Tt(e,r,t))||!(0!==o||!Tt(e,n,t))||!(0!==a||!Tt(r,e,n))||!(0!==s||!Tt(r,t,n))}function Tt(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function It(e){return e>0?1:e<0?-1:0}function St(e,t){return bt(e.prev,e,e.next)<0?bt(e,t,e.next)>=0&&bt(e,e.prev,t)>=0:bt(e,t,e.prev)<0||bt(e,e.next,t)<0}function At(e,t){var r=new Lt(e.i,e.x,e.y),n=new Lt(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ot(e,t,r,n){var i=new Lt(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Pt(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Lt(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jt(e,t,r,n){for(var i=0,o=t,a=r-n;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(n+=e[i-1].length,r.holes.push(n))}return r};var Gt=k.vec2(),kt=k.vec3(),_t=k.vec3(),Ft=k.vec3();function Nt(e){var t=e.data,r=e.xktModel,n=e.center,i=void 0!==n&&n,o=e.transform,a=void 0===o?null:o,s=e.stats,u=void 0===s?{}:s,c=e.log;return new Promise((function(e,n){if(t)if("CityJSON"===t.type)if(r){var o;c("Using parser: parseCityJSONIntoXKTModel"),c("center: ".concat(i)),a&&c("transform: [".concat(a,"]")),t.transform||i||a?(o=function(e){for(var t=[],r=0,n=0;r0){for(var c=[],l=0,h=t.geometry.length;l0){var x=y[g[0]];if(void 0!==x.value)d=v[x.value];else{var b=x.values;if(b){p=[];for(var w=0,M=b.length;w0&&(n.createEntity({entityId:r,meshIds:c}),e.stats.numObjects++)}}function Bt(e,t,r,n){switch(t.type){case"MultiPoint":case"MultiLineString":case"GeometryInstance":break;case"MultiSurface":case"CompositeSurface":zt(e,r,t.boundaries,n);break;case"Solid":for(var i=t.boundaries,o=0;o0&&l.push(c.length);var p=Rt(e,s[d],h,f);c.push.apply(c,Et(p))}if(3===c.length)f.indices.push(c[0]),f.indices.push(c[1]),f.indices.push(c[2]);else if(c.length>3){for(var m=[],v=0;v0&&s.push(a.length);var c=Rt(e,t[o][u],r,n);a.push.apply(a,Et(c))}if(3===a.length)n.indices.push(a[0]),n.indices.push(a[1]),n.indices.push(a[2]);else if(a.length>3){for(var l=[],h=0;h0)for(var u=0;u0){null==g&&e.log("Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT");var x=g;for(x&&o.entities[x]&&e.log("Warning: Two or more glTF nodes found with same 'name' attribute: '".concat(g," - will randomly-generating an object ID in XKT"));!x||o.entities[x];)x="entity-"+e.nextId++;if(e.metaModelCorrections){var b=e.metaModelCorrections.eachChildRoot[x];if(b){var w=e.metaModelCorrections.eachRootStats[b.id];w.countChildren++,w.countChildren>=w.numChildren&&(o.createEntity({entityId:b.id,meshIds:tr}),e.stats.numObjects++,tr.length=0)}else e.metaModelCorrections.metaObjectsMap[x]&&(o.createEntity({entityId:x,meshIds:tr}),e.stats.numObjects++,tr.length=0)}else o.createEntity({entityId:x,meshIds:tr}),e.stats.numObjects++,tr.length=0}}var nr="undefined"!=typeof atob?atob:function(e){return Buffer.from(e,"base64").toString("binary")},ir={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},or={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function ar(e){var t=e.data,r=e.xktModel,n=e.metaModelData,i=e.includeNormals,o=e.reuseGeometries,a=e.getAttachment,s=e.stats,u=void 0===s?{}:s,c=e.log;return c&&c("Using parser: parseGLTFJSONIntoXKTModel"),new Promise((function(e,s){if(t)if(r){u.sourceFormat="glTF",u.schemaVersion="2.0",u.title="",u.author="",u.created="",u.numTriangles=0,u.numVertices=0,u.numNormals=0,u.numObjects=0,u.numGeometries=0;var l={gltf:t,metaModelCorrections:n?sr(n):null,getAttachment:a||function(){throw new Error("You must define getAttachment() method to convert glTF with external resources")},log:c||function(e){},xktModel:r,includeNormals:i,createXKTGeometryIds:{},nextMeshId:0,reuseGeometries:!1!==o,stats:u};l.log("Parsing normals: ".concat(l.includeNormals?"enabled":"disabled")),function(e){var t=e.gltf.buffers;return t?Promise.all(t.map((function(t){return function(e,t){return new Promise((function(r,n){if(t._arrayBuffer)return t._buffer=t._arrayBuffer,void r(t);var i=t.uri;i?function(e,t){return new Promise((function(r,n){var i=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){var o=!!i[2],a=i[3];a=decodeURIComponent(a),o&&(a=nr(a));for(var s=new ArrayBuffer(a.length),u=new Uint8Array(s),c=0;c0)for(var l=0;l0){null==E&&e.log("[parseGLTFJSONIntoXKTModel] Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT");var D=E;if(null==D)for(a.entities[D]&&e.error("Two or more glTF nodes found with same 'name' attribute: '"+E+"'");!D||a.entities[D];)D="entity-"+e.nextId++;if(e.metaModelCorrections){var G=e.metaModelCorrections.eachChildRoot[D];if(G){var _=e.metaModelCorrections.eachRootStats[G.id];_.countChildren++,_.countChildren>=_.numChildren&&(a.createEntity({entityId:G.id,meshIds:lr}),e.stats.numObjects++,lr=[])}else e.metaModelCorrections.metaObjectsMap[D]&&(a.createEntity({entityId:D,meshIds:lr}),e.stats.numObjects++,lr=[])}else a.createEntity({entityId:D,meshIds:lr}),e.stats.numObjects++,lr=[]}}function fr(e){if(!e.attributes)return"empty";var t=e.mode,r=(e.material,e.indices),n=e.attributes.POSITION,i=e.attributes.NORMAL,o=e.attributes.COLOR_0,a=e.attributes.TEXCOORD_0;return[t,null!=r?r:"-",null!=n?n:"-",null!=i?i:"-",null!=o?o:"-",null!=a?a:"-"].join(";")}function dr(e,t,r){var n=t.attributes;if(n){switch(t.mode){case 0:r.primitive="points";break;case 1:case 2:case 3:r.primitive="lines";break;case 4:default:r.primitive="triangles";break;case 5:console.log("TRIANGLE_STRIP"),r.primitive="triangles";break;case 6:console.log("TRIANGLE_FAN"),r.primitive="triangles"}var i=e.gltf.accessors,o=t.indices;if(null!=o){var a=i[o];r.indices=pr(e,a)}var s=n.POSITION;if(null!=s){var u=i[s];r.positions=pr(e,u)}var c=n.NORMAL;if(null!=c){var l=i[c];r.normals=pr(e,l)}var h=n.COLOR_0;if(null!=h){var f=i[h];r.colors=pr(e,f)}}}function pr(e,t){var r=e.gltf.bufferViews[t.bufferView],n=or[t.type],i=ir[t.componentType],o=i.BYTES_PER_ELEMENT*n;if(t.byteStride&&t.byteStride!==o)throw new Error("interleaved buffer!");return new i(r._buffer,t.byteOffset||0,t.count*n)}function mr(e){var t=e.WebIFC,r=e.data,n=e.xktModel,i=e.autoNormals,o=void 0===i||i,a=e.includeTypes,s=e.excludeTypes,u=e.wasmPath,c=e.stats,l=void 0===c?{}:c,h=e.log;return h&&h("Using parser: parseIFCIntoXKTModel"),new Promise((function(e,i){if(r)if(n)if(u){var c=new t.IfcAPI;u&&c.SetWasmPath(u),c.Init().then((function(){var i=new Uint8Array(r),u=c.OpenModel(i);l.sourceFormat="IFC",l.schemaVersion="",l.title="",l.author="",l.created="",l.numMetaObjects=0,l.numPropertySets=0,l.numObjects=0,l.numGeometries=0,l.numTriangles=0,l.numVertices=0;var f={WebIFC:t,modelID:u,ifcAPI:c,xktModel:n,autoNormals:o,log:h||function(e){},nextId:0,stats:l};if(a){f.includeTypes={};for(var d=0,p=a.length;d0){for(var d=o.Name.value,p=[],m=0,v=f.length;m0&&(e.xktModel.createEntity({entityId:o,meshIds:i}),e.stats.numObjects++)}else console.log("excluding: "+a)}const xr=require("@loaders.gl/las");var br=5e5;function wr(e){var t=e.data,r=e.xktModel,n=e.center,i=void 0!==n&&n,o=e.transform,a=void 0===o?null:o,s=e.colorDepth,u=void 0===s?"auto":s,c=e.fp64,l=void 0!==c&&c,h=e.skip,f=void 0===h?1:h,d=e.stats,p=e.log,m=void 0===p?function(){}:p;return m&&m("Using parser: parseLASIntoXKTModel"),new Promise((function(e,n){t?r?(m("Converting LAZ/LAS"),m("center: ".concat(i)),a&&m("transform: [".concat(a,"]")),m("colorDepth: ".concat(u)),m("fp64: ".concat(l)),m("skip: ".concat(f)),(0,Ce.parse)(t,xr.LASLoader,{las:{colorDepth:u,fp64:l}}).then((function(t){var n=t.attributes,o=t.loaderData,s=void 0!==o.pointsFormatId?o.pointsFormatId:-1;if(n.POSITION){var u={};switch(s){case 0:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 0)");u=y(n.POSITION,n.intensity);break;case 1:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 1)");u=y(n.POSITION,n.intensity);break;case 2:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 2)");u=v(n.POSITION,n.COLOR_0,n.intensity);break;case 3:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 3)");u=v(n.POSITION,n.COLOR_0,n.intensity)}for(var c=g(function(e){if(e){if(i){for(var t=k.vec3(),r=e.length,n=0,o=e.length;n=e.length)return[e];for(var r=[],n=0;n0?P:null}),M++}}o&&o("Converted meta objects: "+M),e()}))}function Tr(e){var t=e.data,r=e.xktModel,n=e.littleEndian,i=void 0===n||n,o=e.stats,a=e.log;return a&&a("Using parser: parsePCDIntoXKTModel"),new Promise((function(e,n){var s=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r>16&255,g=v>>8&255,x=v>>0&255;l.push(y,g,x,255)}else l.push(255),l.push(255),l.push(255)}if("binary_compressed"===u.data)for(var b=new Uint32Array(t.slice(u.headerLen,u.headerLen+8)),w=b[0],M=b[1],T=function(e,t){var r,n,i,o=e.length,a=new Uint8Array(t),s=0,u=0;do{if((r=e[s++])<32){if(u+ ++r>t)throw new Error("Output buffer is not large enough");if(s+r>o)throw new Error("Invalid compressed data");do{a[u++]=e[s++]}while(--r)}else{if(n=r>>5,i=u-((31&r)<<8)-1,s>=o)throw new Error("Invalid compressed data");if(7===n&&(n+=e[s++],s>=o))throw new Error("Invalid compressed data");if(i-=e[s++],u+n+2>t)throw new Error("Output buffer is not large enough");if(i<0)throw new Error("Invalid compressed data");if(i>=u)throw new Error("Invalid compressed data");do{a[u++]=a[i++]}while(2+--n)}}while(s0?l:null}),r.createMesh({meshId:"pointsMesh",geometryId:"pointsGeometry"}),r.createEntity({entityId:"geometries",meshIds:["pointsMesh"]}),a&&(a("Converted drawable objects: 1"),a("Converted geometries: 1"),a("Converted vertices: "+c.length/3)),o&&(o.sourceFormat="PCD",o.schemaVersion="",o.title="",o.author="",o.created="",o.numObjects=1,o.numGeometries=1,o.numVertices=c.length/3),e()}))}const Ir=require("@loaders.gl/ply");function Sr(e){return Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sr(e)}function Ar(){Ar=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new S(i||[]);return n(a,"_invoke",{value:w(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function f(){}function d(){}function p(){}var m={};u(m,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(A([])));y&&y!==t&&r.call(y,o)&&(m=y);var g=p.prototype=f.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(n,o,a,s){var u=l(e[n],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==Sr(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=M(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function M(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Or(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Pr(e){return Lr.apply(this,arguments)}function Lr(){var e;return e=Ar().mark((function e(t){var r,n,i,o,a,s,u,c,l,h,f;return Ar().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.data,n=t.xktModel,i=t.stats,(o=t.log)&&o("Using parser: parsePLYIntoXKTModel"),r){e.next=4;break}throw"Argument expected: data";case 4:if(n){e.next=6;break}throw"Argument expected: xktModel";case 6:return e.prev=6,e.next=9,(0,Ce.parse)(r,Ir.PLYLoader);case 9:a=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(6),o&&o("Error: "+e.t0),e.abrupt("return");case 16:if(s=a.attributes,u=!!s.COLOR_0){for(c=u?s.COLOR_0.value:null,l=[],h=0,f=c.length;h=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Dr(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Gr(e){return kr.apply(this,arguments)}function kr(){var e;return e=Er().mark((function e(t){var r,n,i,o,a,s,u,c;return Er().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=t.splitMeshes,i=t.autoNormals,o=t.smoothNormals,a=t.smoothNormalsAngleThreshold,s=t.xktModel,u=t.stats,(c=t.log)&&c("Using parser: parseSTLIntoXKTModel"),e.abrupt("return",new Promise((function(e,t){if(r)if(s){var l=k.createUUID(),h=s.createMetaObject({metaObjectId:l,metaObjectType:"Model",metaObjectName:"Model"}),f={data:r,splitMeshes:n,autoNormals:i,smoothNormals:o,smoothNormalsAngleThreshold:a,xktModel:s,rootMetaObject:h,nextId:0,log:c||function(e){},stats:{numObjects:0,numGeometries:0,numTriangles:0,numVertices:0}},d=Br(r);_r(d)?Fr(f,d):Nr(f,"string"!=typeof(p=r)?function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r>5&31)/31,i=(S>>10&31)/31):(r=a,n=s,i=u),(x&&r!==f||n!==d||i!==p)&&(null!==f&&(m=!0),f=r,d=n,p=i)}for(var A=1;A<=3;A++){var O=w+12*A;y.push(c.getFloat32(O,!0)),y.push(c.getFloat32(O+4,!0)),y.push(c.getFloat32(O+8,!0)),e.autoNormals||g.push(M,T,I),h&&o.push(r,n,i,1)}x&&m&&(Cr(e,y,g,o),y=[],g=[],o=o?[]:null,m=!1)}y.length>0&&Cr(e,y,g,o)}function Nr(e,t){for(var r,n,i,o,a,s,u,c=/facet([\s\S]*?)endfacet/g,l=0,h=/[\s]+([+-]?(?:\d+.\d+|\d+.|\d+|.\d+)(?:[eE][+-]?\d+)?)/.source,f=new RegExp("vertex"+h+h+h,"g"),d=new RegExp("normal"+h+h+h,"g"),p=[],m=[];null!==(o=c.exec(t));){for(a=0,s=0,u=o[0];null!==(o=d.exec(u));)r=parseFloat(o[1]),n=parseFloat(o[2]),i=parseFloat(o[3]),s++;for(;null!==(o=f.exec(u));)p.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3])),m.push(r,n,i),a++;if(1!==s)return e.log("Error in normal of face "+l),-1;if(3!==a)return e.log("Error in positions of face "+l),-1;l++}Cr(e,p,m,null)}var Vr=0;function Cr(e,t,r,n){for(var i=new Int32Array(t.length/3),o=0,a=i.length;o0?r:null,n=n&&n.length>0?n:null,!e.autoNormals&&e.smoothNormals&&function(e,t){var r,n,i,o,a,s,u,c,l,h,f,d=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).smoothNormalsAngleThreshold||20,p={},m=[],v={},y=Math.pow(10,4);for(u=0,l=e.length;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.ySize||1;r<0&&(console.error("negative ySize not allowed - will invert"),r*=-1);var n=e.zSize||1;n<0&&(console.error("negative zSize not allowed - will invert"),n*=-1);var i=e.center,o=i?i[0]:0,a=i?i[1]:0,s=i?i[2]:0,u=-t+o,c=-r+a,l=-n+s,h=t+o,f=r+a,d=n+s;return{primitiveType:"triangles",positions:[h,f,d,u,f,d,u,c,d,h,c,d,h,f,d,h,c,d,h,c,l,h,f,l,h,f,d,h,f,l,u,f,l,u,f,d,u,f,d,u,f,l,u,c,l,u,c,d,u,c,l,h,c,l,h,c,d,u,c,d,h,c,l,u,c,l,u,f,l,h,f,l],normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],uv:[1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}}function Ur(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.ySize||1;r<0&&(console.error("negative ySize not allowed - will invert"),r*=-1);var n=e.zSize||1;n<0&&(console.error("negative zSize not allowed - will invert"),n*=-1);var i=e.center,o=i?i[0]:0,a=i?i[1]:0,s=i?i[2]:0,u=-t+o,c=-r+a,l=-n+s,h=t+o,f=r+a,d=n+s;return{primitiveType:"lines",positions:[u,c,l,u,c,d,u,f,l,u,f,d,h,c,l,h,c,d,h,f,l,h,f,d],indices:[0,1,1,3,3,2,2,0,4,5,5,7,7,6,6,4,0,4,1,5,2,6,3,7]}}function Xr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.radiusTop||1;t<0&&(console.error("negative radiusTop not allowed - will invert"),t*=-1);var r=e.radiusBottom||1;r<0&&(console.error("negative radiusBottom not allowed - will invert"),r*=-1);var n=e.height||1;n<0&&(console.error("negative height not allowed - will invert"),n*=-1);var i=e.radialSegments||32;i<0&&(console.error("negative radialSegments not allowed - will invert"),i*=-1),i<3&&(i=3);var o=e.heightSegments||1;o<0&&(console.error("negative heightSegments not allowed - will invert"),o*=-1),o<1&&(o=1);var a,s,u,c,l,h,f,d,p,m,v,y=!!e.openEnded,g=e.center,x=g?g[0]:0,b=g?g[1]:0,w=g?g[2]:0,M=n/2,T=n/o,I=2*Math.PI/i,S=1/i,A=(t-r)/o,O=[],P=[],L=[],j=[],E=(90-180*Math.atan(n/(r-t))/Math.PI)/90;for(a=0;a<=o;a++)for(l=t-a*A,h=M-a*T,s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),P.push(l*u),P.push(E),P.push(l*c),L.push(s*S),L.push(1*a/o),O.push(l*u+x),O.push(h+b),O.push(l*c+w);for(a=0;a0){for(p=O.length/3,P.push(0),P.push(1),P.push(0),L.push(.5),L.push(.5),O.push(0+x),O.push(M+b),O.push(0+w),s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),m=.5*Math.sin(s*I)+.5,v=.5*Math.cos(s*I)+.5,P.push(t*u),P.push(1),P.push(t*c),L.push(m),L.push(v),O.push(t*u+x),O.push(M+b),O.push(t*c+w);for(s=0;s0){for(p=O.length/3,P.push(0),P.push(-1),P.push(0),L.push(.5),L.push(.5),O.push(0+x),O.push(0-M+b),O.push(0+w),s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),m=.5*Math.sin(s*I)+.5,v=.5*Math.cos(s*I)+.5,P.push(r*u),P.push(-1),P.push(r*c),L.push(m),L.push(v),O.push(r*u+x),O.push(0-M+b),O.push(r*c+w);for(s=0;s0&&void 0!==arguments[0]?arguments[0]:{},t=e.size||1;t<0&&(console.error("negative size not allowed - will invert"),t*=-1);var r=e.divisions||1;r<0&&(console.error("negative divisions not allowed - will invert"),r*=-1),r<1&&(r=1);for(var n=(t=t||10)/(r=r||10),i=t/2,o=[],a=[],s=0,u=0,c=-i;u<=r;u++,c+=n)o.push(-i),o.push(0),o.push(c),o.push(i),o.push(0),o.push(c),o.push(c),o.push(0),o.push(-i),o.push(c),o.push(0),o.push(i),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return{primitiveType:"lines",positions:o,indices:a}}function Kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);var n=e.xSegments||1;n<0&&(console.error("negative xSegments not allowed - will invert"),n*=-1),n<1&&(n=1);var i=e.xSegments||1;i<0&&(console.error("negative zSegments not allowed - will invert"),i*=-1),i<1&&(i=1);var o,a,s,u,c,l,h,f=e.center,d=f?f[0]:0,p=f?f[1]:0,m=f?f[2]:0,v=t/2,y=r/2,g=Math.floor(n)||1,x=Math.floor(i)||1,b=g+1,w=x+1,M=t/g,T=r/x,I=new Float32Array(b*w*3),S=new Float32Array(b*w*3),A=new Float32Array(b*w*2),O=0,P=0;for(o=0;o65535?Uint32Array:Uint16Array)(g*x*6);for(o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=e.lod||1,r=e.center?e.center[0]:0,n=e.center?e.center[1]:0,i=e.center?e.center[2]:0,o=e.radius||1;o<0&&(console.error("negative radius not allowed - will invert"),o*=-1);var a=e.heightSegments||18;a<0&&(console.error("negative heightSegments not allowed - will invert"),a*=-1),(a=Math.floor(t*a))<18&&(a=18);var s=e.widthSegments||18;s<0&&(console.error("negative widthSegments not allowed - will invert"),s*=-1),(s=Math.floor(t*s))<18&&(s=18);var u,c,l,h,f,d,p,m,v,y,g,x,b,w,M=[],T=[],I=[],S=[];for(u=0;u<=a;u++)for(l=u*Math.PI/a,h=Math.sin(l),f=Math.cos(l),c=0;c<=s;c++)d=2*c*Math.PI/s,p=Math.sin(d),m=Math.cos(d)*h,v=f,y=p*h,g=1-c/s,x=u/a,T.push(m),T.push(v),T.push(y),I.push(g),I.push(x),M.push(r+o*m),M.push(n+o*v),M.push(i+o*y);for(u=0;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.radius||1;t<0&&(console.error("negative radius not allowed - will invert"),t*=-1),t*=.5;var r=e.tube||.3;r<0&&(console.error("negative tube not allowed - will invert"),r*=-1);var n=e.radialSegments||32;n<0&&(console.error("negative radialSegments not allowed - will invert"),n*=-1),n<4&&(n=4);var i=e.tubeSegments||24;i<0&&(console.error("negative tubeSegments not allowed - will invert"),i*=-1),i<4&&(i=4);var o=e.arc||2*Math.PI;o<0&&(console.warn("negative arc not allowed - will invert"),o*=-1),o>360&&(o=360);var a,s,u,c,l,h,f,d,p,m,v,y,g=e.center,x=g?g[0]:0,b=g?g[1]:0,w=g?g[2]:0,M=[],T=[],I=[],S=[];for(d=0;d<=i;d++)for(f=0;f<=n;f++)a=f/n*o,s=.785398+d/i*Math.PI*2,x=t*Math.cos(a),b=t*Math.sin(a),u=(t+r*Math.cos(s))*Math.cos(a),c=(t+r*Math.cos(s))*Math.sin(a),l=r*Math.sin(s),M.push(u+x),M.push(c+b),M.push(l+w),I.push(1-f/n),I.push(d/i),h=k.normalizeVec3(k.subVec3([u,c,l],[x,b,w],[]),[]),T.push(h[0]),T.push(h[1]),T.push(h[2]);for(d=1;d<=i;d++)for(f=1;f<=n;f++)p=(n+1)*d+f-1,m=(n+1)*(d-1)+f-1,v=(n+1)*(d-1)+f,y=(n+1)*d+f,S.push(p),S.push(m),S.push(v),S.push(v),S.push(y),S.push(p);return{primitiveType:"triangles",positions:M,normals:T,uv:I,uvs:I,indices:S}}var Yr={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};function Wr(){for(var e,t,r,n,i,o,a,s,u,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=c.origin||[0,0,0],h=l[0],f=l[1],d=l[2],p=c.size||1,m=[],v=[],y=((""+c.text).trim()||"").split("\n"),g=0,x=0,b=.04,w=0;w(()=>{"use strict";var e={231:e=>{e.exports=require("fs")},423:e=>{e.exports=require("path")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{ClampToEdgeWrapping:()=>p,GIFMediaType:()=>O,JPEGMediaType:()=>P,LinearFilter:()=>M,LinearMipMapLinearFilter:()=>A,LinearMipMapNearestFilter:()=>I,LinearMipmapLinearFilter:()=>S,LinearMipmapNearestFilter:()=>T,MirroredRepeatWrapping:()=>m,NearestFilter:()=>y,NearestMipMapLinearFilter:()=>w,NearestMipMapNearestFilter:()=>g,NearestMipmapLinearFilter:()=>b,NearestMipmapNearestFilter:()=>x,PNGMediaType:()=>L,RepeatWrapping:()=>d,XKTModel:()=>He,XKT_INFO:()=>f,buildBoxGeometry:()=>zr,buildBoxLinesGeometry:()=>Ur,buildCylinderGeometry:()=>Xr,buildGridGeometry:()=>Rr,buildPlaneGeometry:()=>Kr,buildSphereGeometry:()=>qr,buildTorusGeometry:()=>Zr,buildVectorTextGeometry:()=>Wr,convert2xkt:()=>$r,parseCityJSONIntoXKTModel:()=>Nt,parseGLTFIntoXKTModel:()=>Wt,parseGLTFJSONIntoXKTModel:()=>ar,parseIFCIntoXKTModel:()=>mr,parseLASIntoXKTModel:()=>wr,parseMetaModelIntoXKTModel:()=>Mr,parsePCDIntoXKTModel:()=>Tr,parsePLYIntoXKTModel:()=>Pr,parseSTLIntoXKTModel:()=>Gr,writeXKTModelToArrayBuffer:()=>nt});const e=require("@loaders.gl/polyfills");var t,i,o,a,s,u,c,l,h,f={xktVersion:10},d=1e3,p=1001,m=1002,y=1003,g=1004,x=1004,b=1005,w=1005,M=1006,T=1007,I=1007,S=1008,A=1008,O=1e4,P=10001,L=10002,j=Float64Array,E=new j(16),D=new j(16),G=new j(4),k={MIN_DOUBLE:-Number.MAX_SAFE_INTEGER,MAX_DOUBLE:Number.MAX_SAFE_INTEGER,DEGTORAD:.0174532925,RADTODEG:57.295779513,vec2:function(e){return new j(e||2)},vec3:function(e){return new j(e||3)},vec4:function(e){return new j(e||4)},mat3:function(e){return new j(e||9)},mat3ToMat4:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4:function(e){return new j(e||16)},mat4ToMat3:function(e,t){},createUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return"".concat(e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255],"-").concat(e[255&r]).concat(e[r>>8&255],"-").concat(e[r>>16&15|64]).concat(e[r>>24&255],"-").concat(e[63&n|128]).concat(e[n>>8&255],"-").concat(e[n>>16&255]).concat(e[n>>24&255]).concat(e[255&i]).concat(e[i>>8&255]).concat(e[i>>16&255]).concat(e[i>>24&255])}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},fmod:function(e,t){if(e1?1:r,Math.acos(r)},vec3FromMat4Scale:(u=new j(3),function(e,t){return u[0]=e[0],u[1]=e[1],u[2]=e[2],t[0]=k.lenVec3(u),u[0]=e[4],u[1]=e[5],u[2]=e[6],t[1]=k.lenVec3(u),u[0]=e[8],u[1]=e[9],u[2]=e[10],t[2]=k.lenVec3(u),t}),vecToArray:function(){function e(e){return Math.round(1e5*e)/1e5}return function(t){for(var r=0,n=(t=Array.prototype.slice.call(t)).length;r0&&void 0!==arguments[0]?arguments[0]:new j(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},identityMat3:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},isIdentityMat4:function(e){return 1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]},negateMat4:function(e,t){return t||(t=e),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},addMat4:function(e,t,r){return r||(r=e),r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},addMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]+t,r[1]=e[1]+t,r[2]=e[2]+t,r[3]=e[3]+t,r[4]=e[4]+t,r[5]=e[5]+t,r[6]=e[6]+t,r[7]=e[7]+t,r[8]=e[8]+t,r[9]=e[9]+t,r[10]=e[10]+t,r[11]=e[11]+t,r[12]=e[12]+t,r[13]=e[13]+t,r[14]=e[14]+t,r[15]=e[15]+t,r},addScalarMat4:function(e,t,r){return k.addMat4Scalar(t,e,r)},subMat4:function(e,t,r){return r||(r=e),r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},subMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]-t,r[1]=e[1]-t,r[2]=e[2]-t,r[3]=e[3]-t,r[4]=e[4]-t,r[5]=e[5]-t,r[6]=e[6]-t,r[7]=e[7]-t,r[8]=e[8]-t,r[9]=e[9]-t,r[10]=e[10]-t,r[11]=e[11]-t,r[12]=e[12]-t,r[13]=e[13]-t,r[14]=e[14]-t,r[15]=e[15]-t,r},subScalarMat4:function(e,t,r){return r||(r=t),r[0]=e-t[0],r[1]=e-t[1],r[2]=e-t[2],r[3]=e-t[3],r[4]=e-t[4],r[5]=e-t[5],r[6]=e-t[6],r[7]=e-t[7],r[8]=e-t[8],r[9]=e-t[9],r[10]=e-t[10],r[11]=e-t[11],r[12]=e-t[12],r[13]=e-t[13],r[14]=e-t[14],r[15]=e-t[15],r},mulMat4:function(e,t,r){r||(r=e);var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],v=e[13],y=e[14],g=e[15],x=t[0],b=t[1],w=t[2],M=t[3],T=t[4],I=t[5],S=t[6],A=t[7],O=t[8],P=t[9],L=t[10],j=t[11],E=t[12],D=t[13],G=t[14],k=t[15];return r[0]=x*n+b*s+w*h+M*m,r[1]=x*i+b*u+w*f+M*v,r[2]=x*o+b*c+w*d+M*y,r[3]=x*a+b*l+w*p+M*g,r[4]=T*n+I*s+S*h+A*m,r[5]=T*i+I*u+S*f+A*v,r[6]=T*o+I*c+S*d+A*y,r[7]=T*a+I*l+S*p+A*g,r[8]=O*n+P*s+L*h+j*m,r[9]=O*i+P*u+L*f+j*v,r[10]=O*o+P*c+L*d+j*y,r[11]=O*a+P*l+L*p+j*g,r[12]=E*n+D*s+G*h+k*m,r[13]=E*i+D*u+G*f+k*v,r[14]=E*o+D*c+G*d+k*y,r[15]=E*a+D*l+G*p+k*g,r},mulMat3:function(e,t,r){r||(r=new j(9));var n=e[0],i=e[3],o=e[6],a=e[1],s=e[4],u=e[7],c=e[2],l=e[5],h=e[8],f=t[0],d=t[3],p=t[6],m=t[1],v=t[4],y=t[7],g=t[2],x=t[5],b=t[8];return r[0]=n*f+i*m+o*g,r[3]=n*d+i*v+o*x,r[6]=n*p+i*y+o*b,r[1]=a*f+s*m+u*g,r[4]=a*d+s*v+u*x,r[7]=a*p+s*y+u*b,r[2]=c*f+l*m+h*g,r[5]=c*d+l*v+h*x,r[8]=c*p+l*y+h*b,r},mulMat4Scalar:function(e,t,r){return r||(r=e),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},mulMat4v4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=t[0],i=t[1],o=t[2],a=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*o+e[12]*a,r[1]=e[1]*n+e[5]*i+e[9]*o+e[13]*a,r[2]=e[2]*n+e[6]*i+e[10]*o+e[14]*a,r[3]=e[3]*n+e[7]*i+e[11]*o+e[15]*a,r},transposeMat4:function(e,t){var r=e[4],n=e[14],i=e[8],o=e[13],a=e[12],s=e[9];if(!t||e===t){var u=e[1],c=e[2],l=e[3],h=e[6],f=e[7],d=e[11];return e[1]=r,e[2]=i,e[3]=a,e[4]=u,e[6]=s,e[7]=o,e[8]=c,e[9]=h,e[11]=n,e[12]=l,e[13]=f,e[14]=d,e}return t[0]=e[0],t[1]=r,t[2]=i,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=o,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=n,t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},transposeMat3:function(e,t){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},determinantMat4:function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],m=e[14],v=e[15];return d*l*s*i-c*p*s*i-d*a*h*i+o*p*h*i+c*a*m*i-o*l*m*i-d*l*n*u+c*p*n*u+d*r*h*u-t*p*h*u-c*r*m*u+t*l*m*u+d*a*n*f-o*p*n*f-d*r*s*f+t*p*s*f+o*r*m*f-t*a*m*f-c*a*n*v+o*l*n*v+c*r*s*v-t*l*s*v-o*r*h*v+t*a*h*v},inverseMat4:function(e,t){t||(t=e);var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],y=e[15],g=r*s-n*a,x=r*u-i*a,b=r*c-o*a,w=n*u-i*s,M=n*c-o*s,T=i*c-o*u,I=l*m-h*p,S=l*v-f*p,A=l*y-d*p,O=h*v-f*m,P=h*y-d*m,L=f*y-d*v,j=1/(g*L-x*P+b*O+w*A-M*S+T*I);return t[0]=(s*L-u*P+c*O)*j,t[1]=(-n*L+i*P-o*O)*j,t[2]=(m*T-v*M+y*w)*j,t[3]=(-h*T+f*M-d*w)*j,t[4]=(-a*L+u*A-c*S)*j,t[5]=(r*L-i*A+o*S)*j,t[6]=(-p*T+v*b-y*x)*j,t[7]=(l*T-f*b+d*x)*j,t[8]=(a*P-s*A+c*I)*j,t[9]=(-r*P+n*A-o*I)*j,t[10]=(p*M-m*b+y*g)*j,t[11]=(-l*M+h*b-d*g)*j,t[12]=(-a*O+s*S-u*I)*j,t[13]=(r*O-n*S+i*I)*j,t[14]=(-p*w+m*x-v*g)*j,t[15]=(l*w-h*x+f*g)*j,t},traceMat4:function(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v:function(e,t){var r=t||k.identityMat4();return r[12]=e[0],r[13]=e[1],r[14]=e[2],r},translationMat3v:function(e,t){var r=t||k.identityMat3();return r[6]=e[0],r[7]=e[1],r},translationMat4c:(s=new j(3),function(e,t,r,n){return s[0]=e,s[1]=t,s[2]=r,k.translationMat4v(s,n)}),translationMat4s:function(e,t){return k.translationMat4c(e,e,e,t)},translateMat4v:function(e,t){return k.translateMat4c(e[0],e[1],e[2],t)},OLDtranslateMat4c:function(e,t,r,n){var i=n[12];n[0]+=i*e,n[4]+=i*t,n[8]+=i*r;var o=n[13];n[1]+=o*e,n[5]+=o*t,n[9]+=o*r;var a=n[14];n[2]+=a*e,n[6]+=a*t,n[10]+=a*r;var s=n[15];return n[3]+=s*e,n[7]+=s*t,n[11]+=s*r,n},translateMat4c:function(e,t,r,n){var i=n[3];n[0]+=i*e,n[1]+=i*t,n[2]+=i*r;var o=n[7];n[4]+=o*e,n[5]+=o*t,n[6]+=o*r;var a=n[11];n[8]+=a*e,n[9]+=a*t,n[10]+=a*r;var s=n[15];return n[12]+=s*e,n[13]+=s*t,n[14]+=s*r,n},rotationMat4v:function(e,t,r){var n,i,o,a,s,u,c=k.normalizeVec4([t[0],t[1],t[2],0],[]),l=Math.sin(e),h=Math.cos(e),f=1-h,d=c[0],p=c[1],m=c[2];return n=d*p,i=p*m,o=m*d,a=d*l,s=p*l,u=m*l,(r=r||k.mat4())[0]=f*d*d+h,r[1]=f*n+u,r[2]=f*o-s,r[3]=0,r[4]=f*n-u,r[5]=f*p*p+h,r[6]=f*i+a,r[7]=0,r[8]=f*o+s,r[9]=f*i-a,r[10]=f*m*m+h,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},rotationMat4c:function(e,t,r,n,i){return k.rotationMat4v(e,[t,r,n],i)},scalingMat4v:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.identityMat4();return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.identityMat3();return t[0]=e[0],t[4]=e[1],t},scalingMat4c:function(){var e=new j(3);return function(t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,k.scalingMat4v(e,i)}}(),scaleMat4c:function(e,t,r,n){return n[0]*=e,n[4]*=t,n[8]*=r,n[1]*=e,n[5]*=t,n[9]*=r,n[2]*=e,n[6]*=t,n[10]*=r,n[3]*=e,n[7]*=t,n[11]*=r,n},scaleMat4v:function(e,t){var r=e[0],n=e[1],i=e[2];return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,t},scalingMat4s:function(e){return k.scalingMat4c(e,e,e)},rotationTranslationMat4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.mat4(),n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,u=i+i,c=o+o,l=n*s,h=n*u,f=n*c,d=i*u,p=i*c,m=o*c,v=a*s,y=a*u,g=a*c;return r[0]=1-(d+m),r[1]=h+g,r[2]=f-y,r[3]=0,r[4]=h-g,r[5]=1-(l+m),r[6]=p+v,r[7]=0,r[8]=f+y,r[9]=p-v,r[10]=1-(l+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},mat4ToEuler:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=k.clamp,i=e[0],o=e[4],a=e[8],s=e[1],u=e[5],c=e[9],l=e[2],h=e[6],f=e[10];return"XYZ"===t?(r[1]=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(r[0]=Math.atan2(-c,f),r[2]=Math.atan2(-o,i)):(r[0]=Math.atan2(h,u),r[2]=0)):"YXZ"===t?(r[0]=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(r[1]=Math.atan2(a,f),r[2]=Math.atan2(s,u)):(r[1]=Math.atan2(-l,i),r[2]=0)):"ZXY"===t?(r[0]=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(r[1]=Math.atan2(-l,f),r[2]=Math.atan2(-o,u)):(r[1]=0,r[2]=Math.atan2(s,i))):"ZYX"===t?(r[1]=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(r[0]=Math.atan2(h,f),r[2]=Math.atan2(s,i)):(r[0]=0,r[2]=Math.atan2(-o,u))):"YZX"===t?(r[2]=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(r[0]=Math.atan2(-c,u),r[1]=Math.atan2(-l,i)):(r[0]=0,r[1]=Math.atan2(a,f))):"XZY"===t&&(r[2]=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(r[0]=Math.atan2(h,u),r[1]=Math.atan2(a,i)):(r[0]=Math.atan2(-c,f),r[1]=0)),r},composeMat4:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k.mat4();return k.quaternionToRotationMat4(t,n),k.scaleMat4v(r,n),k.translateMat4v(e,n),n},decomposeMat4:function(){var e=new j(3),t=new j(16);return function(r,n,i,o){e[0]=r[0],e[1]=r[1],e[2]=r[2];var a=k.lenVec3(e);e[0]=r[4],e[1]=r[5],e[2]=r[6];var s=k.lenVec3(e);e[8]=r[8],e[9]=r[9],e[10]=r[10];var u=k.lenVec3(e);k.determinantMat4(r)<0&&(a=-a),n[0]=r[12],n[1]=r[13],n[2]=r[14],t.set(r);var c=1/a,l=1/s,h=1/u;return t[0]*=c,t[1]*=c,t[2]*=c,t[4]*=l,t[5]*=l,t[6]*=l,t[8]*=h,t[9]*=h,t[10]*=h,k.mat4ToQuaternion(t,i),o[0]=a,o[1]=s,o[2]=u,this}}(),lookAtMat4v:function(e,t,r,n){n||(n=k.mat4());var i,o,a,s,u,c,l,h,f,d,p=e[0],m=e[1],v=e[2],y=r[0],g=r[1],x=r[2],b=t[0],w=t[1],M=t[2];return p===b&&m===w&&v===M?k.identityMat4():(i=p-b,o=m-w,a=v-M,s=g*(a*=d=1/Math.sqrt(i*i+o*o+a*a))-x*(o*=d),u=x*(i*=d)-y*a,c=y*o-g*i,(d=Math.sqrt(s*s+u*u+c*c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),l=o*c-a*u,h=a*s-i*c,f=i*u-o*s,(d=Math.sqrt(l*l+h*h+f*f))?(l*=d=1/d,h*=d,f*=d):(l=0,h=0,f=0),n[0]=s,n[1]=l,n[2]=i,n[3]=0,n[4]=u,n[5]=h,n[6]=o,n[7]=0,n[8]=c,n[9]=f,n[10]=a,n[11]=0,n[12]=-(s*p+u*m+c*v),n[13]=-(l*p+h*m+f*v),n[14]=-(i*p+o*m+a*v),n[15]=1,n)},lookAtMat4c:function(e,t,r,n,i,o,a,s,u){return k.lookAtMat4v([e,t,r],[n,i,o],[a,s,u],[])},orthoMat4c:function(e,t,r,n,i,o,a){a||(a=k.mat4());var s=t-e,u=n-r,c=o-i;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(n+r)/u,a[14]=-(o+i)/c,a[15]=1,a},frustumMat4v:function(e,t,r){r||(r=k.mat4());var n=[e[0],e[1],e[2],0],i=[t[0],t[1],t[2],0];k.addVec4(i,n,E),k.subVec4(i,n,D);var o=2*n[2],a=D[0],s=D[1],u=D[2];return r[0]=o/a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o/s,r[6]=0,r[7]=0,r[8]=E[0]/a,r[9]=E[1]/s,r[10]=-E[2]/u,r[11]=-1,r[12]=0,r[13]=0,r[14]=-o*i[2]/u,r[15]=0,r},frustumMat4:function(e,t,r,n,i,o,a){a||(a=k.mat4());var s=t-e,u=n-r,c=o-i;return a[0]=2*i/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*i/u,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(n+r)/u,a[10]=-(o+i)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-o*i*2/c,a[15]=0,a},perspectiveMat4:function(e,t,r,n,i){var o=[],a=[];return o[2]=r,a[2]=n,a[1]=o[2]*Math.tan(e/2),o[1]=-a[1],a[0]=a[1]*t,o[0]=-a[0],k.frustumMat4v(o,a,i)},transformPoint3:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec3(),n=t[0],i=t[1],o=t[2];return r[0]=e[0]*n+e[4]*i+e[8]*o+e[12],r[1]=e[1]*n+e[5]*i+e[9]*o+e[13],r[2]=e[2]*n+e[6]*i+e[10]*o+e[14],r},transformPoint4:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4();return r[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],r[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],r[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],r[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],r},transformPoints3:function(e,t,r){for(var n,i,o,a,s,u=r||[],c=t.length,l=e[0],h=e[1],f=e[2],d=e[3],p=e[4],m=e[5],v=e[6],y=e[7],g=e[8],x=e[9],b=e[10],w=e[11],M=e[12],T=e[13],I=e[14],S=e[15],A=0;A2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;r2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;r0&&void 0!==arguments[0]?arguments[0]:k.vec4();return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=e[0]*k.DEGTORAD/2,i=e[1]*k.DEGTORAD/2,o=e[2]*k.DEGTORAD/2,a=Math.cos(n),s=Math.cos(i),u=Math.cos(o),c=Math.sin(n),l=Math.sin(i),h=Math.sin(o);return"XYZ"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u-c*l*h):"YXZ"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u+c*l*h):"ZXY"===t?(r[0]=c*s*u-a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u-c*l*h):"ZYX"===t?(r[0]=c*s*u-a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u+c*l*h):"YZX"===t?(r[0]=c*s*u+a*l*h,r[1]=a*l*u+c*s*h,r[2]=a*s*h-c*l*u,r[3]=a*s*u-c*l*h):"XZY"===t&&(r[0]=c*s*u-a*l*h,r[1]=a*l*u-c*s*h,r[2]=a*s*h+c*l*u,r[3]=a*s*u+c*l*h),r},mat4ToQuaternion:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),n=e[0],i=e[4],o=e[8],a=e[1],s=e[5],u=e[9],c=e[2],l=e[6],h=e[10],f=n+s+h;return f>0?(t=.5/Math.sqrt(f+1),r[3]=.25/t,r[0]=(l-u)*t,r[1]=(o-c)*t,r[2]=(a-i)*t):n>s&&n>h?(t=2*Math.sqrt(1+n-s-h),r[3]=(l-u)/t,r[0]=.25*t,r[1]=(i+a)/t,r[2]=(o+c)/t):s>h?(t=2*Math.sqrt(1+s-n-h),r[3]=(o-c)/t,r[0]=(i+a)/t,r[1]=.25*t,r[2]=(u+l)/t):(t=2*Math.sqrt(1+h-n-s),r[3]=(a-i)/t,r[0]=(o+c)/t,r[1]=(u+l)/t,r[2]=.25*t),r},vec3PairToQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=Math.sqrt(k.dotVec3(e,e)*k.dotVec3(t,t)),i=n+k.dotVec3(e,t);return i<1e-8*n?(i=0,Math.abs(e[0])>Math.abs(e[2])?(r[0]=-e[1],r[1]=e[0],r[2]=0):(r[0]=0,r[1]=-e[2],r[2]=e[1])):k.cross3Vec3(e,t,r),r[3]=i,k.normalizeQuaternion(r)},angleAxisToQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),r=e[3]/2,n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},quaternionToEuler:function(){var e=new j(16);return function(t,r,n){return n=n||k.vec3(),k.quaternionToRotationMat4(t,e),k.mat4ToEuler(e,r,n),n}}(),mulQuaternions:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec4(),n=e[0],i=e[1],o=e[2],a=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return r[0]=a*s+n*l+i*c-o*u,r[1]=a*u+i*l+o*s-n*c,r[2]=a*c+o*l+n*u-i*s,r[3]=a*l-n*s-i*u-o*c,r},vec3ApplyQuaternion:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.vec3(),n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2],c=e[3],l=c*n+s*o-u*i,h=c*i+u*n-a*o,f=c*o+a*i-s*n,d=-a*n-s*i-u*o;return r[0]=l*c+d*-a+h*-u-f*-s,r[1]=h*c+d*-s+f*-a-l*-u,r[2]=f*c+d*-u+l*-s-h*-a,r},quaternionToMat4:function(e,t){t=k.identityMat4(t);var r=e[0],n=e[1],i=e[2],o=e[3],a=2*r,s=2*n,u=2*i,c=a*o,l=s*o,h=u*o,f=a*r,d=s*r,p=u*r,m=s*n,v=u*n,y=u*i;return t[0]=1-(m+y),t[1]=d+h,t[2]=p-l,t[4]=d-h,t[5]=1-(f+y),t[6]=v+c,t[8]=p+l,t[9]=v-c,t[10]=1-(f+m),t},quaternionToRotationMat4:function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=r*s,h=r*u,f=n*s,d=n*u,p=i*u,m=o*a,v=o*s,y=o*u;return t[0]=1-(f+p),t[4]=l-y,t[8]=h+v,t[1]=l+y,t[5]=1-(c+p),t[9]=d-m,t[2]=h-v,t[6]=d+m,t[10]=1-(c+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},normalizeQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=k.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r,t[3]=e[3]/r,t},conjugateQuaternion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},inverseQuaternion:function(e,t){return k.normalizeQuaternion(k.conjugateQuaternion(e,t))},quaternionToAngleAxis:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec4(),r=(e=k.normalizeQuaternion(e,G))[3],n=2*Math.acos(r),i=Math.sqrt(1-r*r);return i<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i),t[3]=n,t},AABB3:function(e){return new j(e||6)},AABB2:function(e){return new j(e||4)},OBB3:function(e){return new j(e||32)},OBB2:function(e){return new j(e||16)},Sphere3:function(e,t,r,n){return new j([e,t,r,n])},transformOBB3:function(e,t){var r,n,i,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=t.length,u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],y=e[9],g=e[10],x=e[11],b=e[12],w=e[13],M=e[14],T=e[15];for(r=0;rs?a:s,o[1]+=u>c?u:c,o[2]+=l>h?l:h,Math.abs(k.lenVec3(o))}}(),getAABB3Center:function(e,t){var r=t||k.vec3();return r[0]=(e[0]+e[3])/2,r[1]=(e[1]+e[4])/2,r[2]=(e[2]+e[5])/2,r},getAABB2Center:function(e,t){var r=t||k.vec2();return r[0]=(e[2]+e[0])/2,r[1]=(e[3]+e[1])/2,r},collapseAABB3:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.AABB3();return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MAX_DOUBLE,e[3]=-k.MAX_DOUBLE,e[4]=-k.MAX_DOUBLE,e[5]=-k.MAX_DOUBLE,e},AABB3ToOBB3:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.OBB3();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t[4]=e[3],t[5]=e[1],t[6]=e[2],t[7]=1,t[8]=e[3],t[9]=e[4],t[10]=e[2],t[11]=1,t[12]=e[0],t[13]=e[4],t[14]=e[2],t[15]=1,t[16]=e[0],t[17]=e[1],t[18]=e[5],t[19]=1,t[20]=e[3],t[21]=e[1],t[22]=e[5],t[23]=1,t[24]=e[3],t[25]=e[4],t[26]=e[5],t[27]=1,t[28]=e[0],t[29]=e[4],t[30]=e[5],t[31]=1,t},positions3ToAABB3:(t=new j(3),function(e,r,n){r=r||k.AABB3();for(var i,o,a,s=k.MAX_DOUBLE,u=k.MAX_DOUBLE,c=k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=-k.MAX_DOUBLE,f=-k.MAX_DOUBLE,d=0,p=e.length;dl&&(l=i),o>h&&(h=o),a>f&&(f=a);return r[0]=s,r[1]=u,r[2]=c,r[3]=l,r[4]=h,r[5]=f,r}),OBB3ToAABB3:function(e){for(var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.AABB3(),o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MAX_DOUBLE,u=-k.MAX_DOUBLE,c=-k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=0,f=e.length;hu&&(u=t),r>c&&(c=r),n>l&&(l=n);return i[0]=o,i[1]=a,i[2]=s,i[3]=u,i[4]=c,i[5]=l,i},points3ToAABB3:function(e){for(var t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.AABB3(),o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MAX_DOUBLE,u=-k.MAX_DOUBLE,c=-k.MAX_DOUBLE,l=-k.MAX_DOUBLE,h=0,f=e.length;hu&&(u=t),r>c&&(c=r),n>l&&(l=n);return i[0]=o,i[1]=a,i[2]=s,i[3]=u,i[4]=c,i[5]=l,i},points3ToSphere3:function(){var e=new j(3);return function(t,r){r=r||k.vec4();var n,i=0,o=0,a=0,s=t.length;for(n=0;nc&&(c=u);return r[3]=c,r}}(),positions3ToSphere3:function(){var e=new j(3),t=new j(3);return function(r,n){n=n||k.vec4();var i,o=0,a=0,s=0,u=r.length,c=0;for(i=0;ic&&(c=l);return n[3]=c,n}}(),OBB3ToSphere3:function(){var e=new j(3),t=new j(3);return function(r,n){n=n||k.vec4();var i,o=0,a=0,s=0,u=r.length,c=u/4;for(i=0;ih&&(h=l);return n[3]=h,n}}(),getSphere3Center:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.vec3();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},expandAABB3:function(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]3&&void 0!==arguments[3]?arguments[3]:k.vec3(),i=t[0]-e[0],o=t[1]-e[1],a=t[2]-e[2],s=r[0]-e[0],u=r[1]-e[1],c=r[2]-e[2],l=o*c-a*u,h=a*s-i*c,f=i*u-o*s,d=Math.sqrt(l*l+h*h+f*f);return 0===d?(n[0]=0,n[1]=0,n[2]=0):(n[0]=l/d,n[1]=h/d,n[2]=f/d),n}};function _(e,t,r,n){var i=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),o=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){var a=(1-Math.abs(o))*(i>=0?1:-1),s=(1-Math.abs(i))*(o>=0?1:-1);i=a,o=s}return new Int8Array([Math[r](127.5*i+(i<0?-1:0)),Math[n](127.5*o+(o<0?-1:0))])}function F(e){var t=e[0],r=e[1];t/=t<0?127:128,r/=r<0?127:128;var n=1-Math.abs(t)-Math.abs(r);n<0&&(t=(1-Math.abs(r))*(t>=0?1:-1),r=(1-Math.abs(t))*(r>=0?1:-1));var i=Math.sqrt(t*t+r*r+n*n);return[t/i,r/i,n/i]}function N(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]}var V,C,B,z,U,X,R,K,q,Z,Y,W,Q,J,H,$,ee,te={quantizePositions:function(e,t,r,n){for(var i=r[0],o=r[1],a=r[2],s=65535,u=s/(r[3]-i),c=s/(r[4]-o),l=s/(r[5]-a),h=function(e){return e>=0?e:0},f=0;fu&&(a=o,u=s),(s=N(h,0,F(o=_(h,0,"floor","ceil"))))>u&&(a=o,u=s),(s=N(h,0,F(o=_(h,0,"ceil","ceil"))))>u&&(a=o,u=s),n[i+c+0]=a[0],n[i+c+1]=a[1],n[i+c+2]=0;return i+r},octEncodeNormals:function(e,t,r,n){for(var i,o,a,s,u=0;us&&(o=i,s=a),(a=N(e,u,F(i=_(e,u,"floor","ceil"))))>s&&(o=i,s=a),(a=N(e,u,F(i=_(e,u,"ceil","ceil"))))>s&&(o=i,s=a),r[n+u+0]=o[0],r[n+u+1]=o[1],r[n+u+2]=0;return n+t}},re=(V=[],C=[],B=[],z=[],U=[],X=0,R=new Uint16Array(3),K=new Uint16Array(3),q=new Uint16Array(3),Z=k.vec3(),Y=k.vec3(),W=k.vec3(),Q=k.vec3(),J=k.vec3(),H=k.vec3(),$=k.vec3(),ee=k.vec3(),function(e,t,r,n){!function(e,t){var r,n,i,o,a,s,u={},c=Math.pow(10,4),l=0;for(a=0,s=e.length;av&&T>v)continue}d=B[c.index1],p=B[c.index2],(!g&&d>65535||p>65535)&&(g=!0),m.push(d),m.push(p)}return g?new Uint32Array(m):new Uint16Array(m)}),ne=function(e,t,r,n){function i(e,r){for(var n,i,o=0;o<3;o++)if((n=t[3*e+o])!==(i=t[3*r+o]))return i-n;return 0}for(var o=e.slice().sort(i),a=null,s=0,u=o.length;sf&&h>d?f>d?(p=h,m=f,v=d):(p=h,m=d,v=f):f>h&&f>d?h>d?(p=f,m=h,v=d):(p=f,m=d,v=h):d>h&&d>f&&(h>f?(p=d,m=h,v=f):(p=d,m=f,v=h)),n[c+0]=[p,m],n[c+1]=[m,v],p>v){var y=v;v=p,p=y}n[c+2]=[v,p]}function g(e,t){for(var r,n,i=0;i<2;i++)if(r=e[i],(n=t[i])!==r)return n-r;return 0}(n=n.slice(0,e.length)).sort(g);for(var x=0,b=0;b0&&2!==x)};function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function oe(e,t){for(var r=0;r1}}])&&ce(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function fe(e,t){for(var r=0;r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Re(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Ke(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modelId=t.modelId||"default",this.projectId=t.projectId||"",this.revisionId=t.revisionId||"",this.author=t.author||"",this.createdAt=t.createdAt||"",this.creatingApplication=t.creatingApplication||"",this.schema=t.schema||"",this.xktVersion=f.xktVersion,this.edgeThreshold=t.edgeThreshold||10,this.minTileSize=t.minTileSize||500,this.modelAABB=t.modelAABB,this.propertySets={},this.propertySetsList=[],this.metaObjects={},this.metaObjectsList=[],this.reusedGeometriesDecodeMatrix=new Float32Array(16),this.geometries={},this.geometriesList=[],this.textures={},this.texturesList=[],this.textureSets={},this.textureSetsList=[],this.meshes={},this.meshesList=[],this.entities={},this.entitiesList=[],this.tilesList=[],this.aabb=k.AABB3(),this.finalized=!1}var t,r,n,i;return t=e,r=[{key:"createPropertySet",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.propertySetId||void 0===e.propertySetId)throw"Parameter expected: params.propertySetId";if(null===e.properties||void 0===e.properties)throw"Parameter expected: params.properties";if(this.finalized)console.error("XKTModel has been finalized, can't add more property sets");else if(!this.propertySets[e.propertySetId]){var t=e.propertySetId,r=e.propertySetType||"Default",n=e.propertySetName||e.propertySetId,i=e.properties||[],o=new je(t,r,n,i);return this.propertySets[t]=o,this.propertySetsList.push(o),o}}},{key:"createMetaObject",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.metaObjectId||void 0===e.metaObjectId)throw"Parameter expected: params.metaObjectId";if(this.finalized)console.error("XKTModel has been finalized, can't add more meta objects");else if(!this.metaObjects[e.metaObjectId]){var t=e.metaObjectId,r=e.propertySetIds,n=e.metaObjectType||"Default",i=e.metaObjectName||e.metaObjectId,o=e.parentMetaObjectId,a=new Ae(t,r,n,i,o);return this.metaObjects[t]=a,this.metaObjectsList.push(a),o||this._rootMetaObject||(this._rootMetaObject=a),a}}},{key:"createTexture",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.textureId||void 0===e.textureId)throw"Parameter expected: params.textureId";if(!e.imageData&&!e.src)throw"Parameter expected: params.imageData or params.src";if(this.finalized)console.error("XKTModel has been finalized, can't add more textures");else{if(!this.textures[e.textureId]){if(e.src){var t=e.src.split(".").pop();if("jpg"!==t&&"jpeg"!==t&&"png"!==t)return void console.error("XKTModel does not support image files with extension '".concat(t,"' - won't create texture '").concat(e.textureId))}var r=e.textureId,n=new ke({textureId:r,imageData:e.imageData,mediaType:e.mediaType,minFilter:e.minFilter,magFilter:e.magFilter,wrapS:e.wrapS,wrapT:e.wrapT,wrapR:e.wrapR,width:e.width,height:e.height,compressed:!1!==e.compressed,src:e.src});return this.textures[r]=n,this.texturesList.push(n),n}console.error("XKTTexture already exists with this ID: "+e.textureId)}}},{key:"createTextureSet",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.textureSetId||void 0===e.textureSetId)throw"Parameter expected: params.textureSetId";if(this.finalized)console.error("XKTModel has been finalized, can't add more textureSets");else{if(!this.textureSets[e.textureSetId]){var t,r,n,i,o;if(void 0!==e.colorTextureId&&null!==e.colorTextureId){if(!(t=this.textures[e.colorTextureId]))return void console.error("Texture not found: ".concat(e.colorTextureId," - ensure that you create it first with createTexture()"));t.channel=0}if(void 0!==e.metallicRoughnessTextureId&&null!==e.metallicRoughnessTextureId){if(!(r=this.textures[e.metallicRoughnessTextureId]))return void console.error("Texture not found: ".concat(e.metallicRoughnessTextureId," - ensure that you create it first with createTexture()"));r.channel=1}if(void 0!==e.normalsTextureId&&null!==e.normalsTextureId){if(!(n=this.textures[e.normalsTextureId]))return void console.error("Texture not found: ".concat(e.normalsTextureId," - ensure that you create it first with createTexture()"));n.channel=2}if(void 0!==e.emissiveTextureId&&null!==e.emissiveTextureId){if(!(i=this.textures[e.emissiveTextureId]))return void console.error("Texture not found: ".concat(e.emissiveTextureId," - ensure that you create it first with createTexture()"));i.channel=3}if(void 0!==e.occlusionTextureId&&null!==e.occlusionTextureId){if(!(o=this.textures[e.occlusionTextureId]))return void console.error("Texture not found: ".concat(e.occlusionTextureId," - ensure that you create it first with createTexture()"));o.channel=4}var a=new Ve({textureSetId:e.textureSetId,textureSetIndex:this.textureSetsList.length,colorTexture:t,metallicRoughnessTexture:r,normalsTexture:n,emissiveTexture:i,occlusionTexture:o});return this.textureSets[e.textureSetId]=a,this.textureSetsList.push(a),a}console.error("XKTTextureSet already exists with this ID: "+e.textureSetId)}}},{key:"createGeometry",value:function(e){if(!e)throw"Parameters expected: params";if(null===e.geometryId||void 0===e.geometryId)throw"Parameter expected: params.geometryId";if(!e.primitiveType)throw"Parameter expected: params.primitiveType";if(!e.positions)throw"Parameter expected: params.positions";var t="triangles"===e.primitiveType,r="points"===e.primitiveType,n="lines"===e.primitiveType,i="line-strip"===e.primitiveType;if(e.primitiveType,e.primitiveType,!(t||r||n||i))throw"Unsupported value for params.primitiveType: "+e.primitiveType+"' - supported values are 'triangles', 'points', 'lines', 'line-strip', 'triangle-strip' and 'triangle-fan";if(t&&!e.indices)throw e.indices=this._createDefaultIndices(),"Parameter expected for 'triangles' primitive: params.indices";if(r&&!e.colors&&!e.colorsCompressed)throw"Parameter expected for 'points' primitive: params.colors or params.colorsCompressed";if(n&&!e.indices)throw"Parameter expected for 'lines' primitive: params.indices";if(this.finalized)console.error("XKTModel has been finalized, can't add more geometries");else{if(!this.geometries[e.geometryId]){var o=e.geometryId,a=e.primitiveType,s=new Float64Array(e.positions),u={geometryId:o,geometryIndex:this.geometriesList.length,primitiveType:a,positions:s,uvs:e.uvs||e.uv};if(t&&(e.normals&&(u.normals=new Float32Array(e.normals)),e.indices?u.indices=e.indices:u.indices=this._createDefaultIndices(s.length/3)),r)if(e.colorsCompressed)u.colorsCompressed=new Uint8Array(e.colorsCompressed);else{for(var c=e.colors,l=new Uint8Array(c.length),h=0,f=c.length;h1)te.octEncodeNormals(n.normals,n.normals.length,n.normalsOctEncoded,0);else{var i=k.inverseMat4(k.transposeMat4(r.matrix,Ye),We);te.transformAndOctEncodeNormals(i,n.normals,n.normals.length,n.normalsOctEncoded,0)}}}},{key:"_createEntityAABBs",value:function(){for(var e=0,t=this.entitiesList.length;e1)for(var l=u.positions,h=0,f=l.length;hQe[i]&&(i=1),Qe[2]>Qe[i]&&(i=2),!e.left){var o=r.slice();if(o[i+3]=(r[i]+r[i+3])/2,e.left=new Me(o),k.containsAABB3(o,n))return void this._insertEntityIntoKDTree(e.left,t)}if(!e.right){var a=r.slice();if(a[i]=(r[i]+r[i+3])/2,e.right=new Me(a),k.containsAABB3(a,n))return void this._insertEntityIntoKDTree(e.right,t)}e.entities=e.entities||[],e.entities.push(t),k.expandAABB3(r,n)}}},{key:"_createTilesFromKDTree",value:function(e){this._createTilesFromKDNode(e)}},{key:"_createTilesFromKDNode",value:function(e){e.entities&&e.entities.length>0&&this._createTileFromEntities(e),e.left&&this._createTilesFromKDNode(e.left),e.right&&this._createTilesFromKDNode(e.right)}},{key:"_createTileFromEntities",value:function(e){var t=e.aabb,r=e.entities,n=k.getAABB3Center(t),i=k.mulVec3Scalar(n,-1,k.vec3()),o=k.AABB3();o[0]=t[0]-n[0],o[1]=t[1]-n[1],o[2]=t[2]-n[2],o[3]=t[3]-n[0],o[4]=t[4]-n[1],o[5]=t[5]-n[2];for(var a=0;a0){te.createPositionsDecodeMatrix(t,this.reusedGeometriesDecodeMatrix);for(var c=0,l=this.geometriesList.length;ce&&(e=i.positionsQuantized.length),i.indices.length>t&&(t=i.indices.length))}for(var o=new Array(e/3),a=new Array(t),s=0,u=this.geometriesList.length;s1&&(S+=16);var D={metadata:{},textureData:new Uint8Array(A),eachTextureDataPortion:new Uint32Array(p),eachTextureAttributes:new Uint16Array(p*tt),positions:new Uint16Array(x),normals:new Int8Array(b),colors:new Uint8Array(w),uvs:new Float32Array(M),indices:new Uint32Array(T),edgeIndices:new Uint32Array(I),eachTextureSetTextures:new Int32Array(5*m),matrices:new Float32Array(S),reusedGeometriesDecodeMatrix:new Float32Array(e.reusedGeometriesDecodeMatrix),eachGeometryPrimitiveType:new Uint8Array(d),eachGeometryPositionsPortion:new Uint32Array(d),eachGeometryNormalsPortion:new Uint32Array(d),eachGeometryColorsPortion:new Uint32Array(d),eachGeometryUVsPortion:new Uint32Array(d),eachGeometryIndicesPortion:new Uint32Array(d),eachGeometryEdgeIndicesPortion:new Uint32Array(d),eachMeshGeometriesPortion:new Uint32Array(v),eachMeshMatricesPortion:new Uint32Array(v),eachMeshTextureSet:new Int32Array(v),eachMeshMaterialAttributes:new Uint8Array(v*rt),eachEntityId:[],eachEntityMeshesPortion:new Uint32Array(y),eachTileAABB:new Float64Array(6*g),eachTileEntitiesPortion:new Uint32Array(g)},G=0,k=0,_=0,F=0,N=0,V=0;D.metadata={id:e.modelId,projectId:e.projectId,revisionId:e.revisionId,author:e.author,createdAt:e.createdAt,creatingApplication:e.creatingApplication,schema:e.schema,propertySets:[],metaObjects:[]};for(var C=0;C0&&(R.propertySetIds=X.propertySetIds),X.external&&(R.external=X.external),D.metadata.metaObjects.push(R)}for(var K=0;K1&&(D.matrices.set(xe.matrix,se),D.eachMeshMatricesPortion[ue]=se,se+=16),D.eachMeshTextureSet[ue]=xe.textureSet?xe.textureSet.textureSetIndex:-1,D.eachMeshMaterialAttributes[ae++]=255*xe.color[0],D.eachMeshMaterialAttributes[ae++]=255*xe.color[1],D.eachMeshMaterialAttributes[ae++]=255*xe.color[2],D.eachMeshMaterialAttributes[ae++]=255*xe.opacity,D.eachMeshMaterialAttributes[ae++]=255*xe.metallic,D.eachMeshMaterialAttributes[ae++]=255*xe.roughness,ue++}D.eachEntityId[ie]=me.entityId,D.eachEntityMeshesPortion[ie]=oe,ie++,oe+=ye}var we=6*ce;D.eachTileAABB.set(de,we)}}return D}(e,t,r),o=function(e,t,r){function n(e){return!1!==r.zip?$e.deflate(e):e}return{metadata:n(it(t||e.metadata)),textureData:n(e.textureData.buffer),eachTextureDataPortion:n(e.eachTextureDataPortion.buffer),eachTextureAttributes:n(e.eachTextureAttributes.buffer),positions:n(e.positions.buffer),normals:n(e.normals.buffer),colors:n(e.colors.buffer),uvs:n(e.uvs.buffer),indices:n(e.indices.buffer),edgeIndices:n(e.edgeIndices.buffer),eachTextureSetTextures:n(e.eachTextureSetTextures.buffer),matrices:n(e.matrices.buffer),reusedGeometriesDecodeMatrix:n(e.reusedGeometriesDecodeMatrix.buffer),eachGeometryPrimitiveType:n(e.eachGeometryPrimitiveType.buffer),eachGeometryPositionsPortion:n(e.eachGeometryPositionsPortion.buffer),eachGeometryNormalsPortion:n(e.eachGeometryNormalsPortion.buffer),eachGeometryColorsPortion:n(e.eachGeometryColorsPortion.buffer),eachGeometryUVsPortion:n(e.eachGeometryUVsPortion.buffer),eachGeometryIndicesPortion:n(e.eachGeometryIndicesPortion.buffer),eachGeometryEdgeIndicesPortion:n(e.eachGeometryEdgeIndicesPortion.buffer),eachMeshGeometriesPortion:n(e.eachMeshGeometriesPortion.buffer),eachMeshMatricesPortion:n(e.eachMeshMatricesPortion.buffer),eachMeshTextureSet:n(e.eachMeshTextureSet.buffer),eachMeshMaterialAttributes:n(e.eachMeshMaterialAttributes.buffer),eachEntityId:n(JSON.stringify(e.eachEntityId).replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)}))),eachEntityMeshesPortion:n(e.eachEntityMeshesPortion.buffer),eachTileAABB:n(e.eachTileAABB.buffer),eachTileEntitiesPortion:n(e.eachTileEntitiesPortion.buffer)}}(i,t,n);r.texturesSize+=o.textureData.byteLength;var a=function(e){return function(e){var t=new Uint32Array(e.length+2);t[0]=et,t[1]=e.length;for(var r=0,n=0,i=e.length;n80*r){n=o=e[0],i=a=e[1];for(var p=r;po&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return ut(f,d,r,n,i,c),d}function at(e,t,r,n,i){var o,a;if(i===jt(e,t,r,n)>0)for(o=t;o=t;o-=n)a=Ot(o,e[o],e[o+1],a);return a&&wt(a,a.next)&&(Pt(a),a=a.next),a}function st(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!wt(n,n.next)&&0!==bt(n.prev,n,n.next))n=n.next;else{if(Pt(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ut(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=vt(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,u,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(e,n,i,o);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?lt(e,n,i,o):ct(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),Pt(e),e=u.next,c=u.next;else if((e=u)===c){a?1===a?ut(e=ht(st(e),t,r),t,r,n,i,o,2):2===a&&ft(e,t,r,n,i,o):ut(st(e),t,r,n,i,o,1);break}}}function ct(e){var t=e.prev,r=e,n=e.next;if(bt(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(gt(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&bt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function lt(e,t,r,n){var i=e.prev,o=e,a=e.next;if(bt(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=vt(s,u,t,r,n),f=vt(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=h&&p&&p.z<=f;){if(d!==e.prev&&d!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&bt(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&bt(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==e.prev&&p!==e.next&>(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ht(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!wt(i,o)&&Mt(i,n,n.next,o)&&St(i,o)&&St(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),Pt(n),Pt(n.next),n=e=o),n=n.next}while(n!==e);return st(n)}function ft(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&xt(a,s)){var u=At(a,s);return a=st(a,a.next),u=st(u,u.next),ut(a,t,r,n,i,o),void ut(u,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function dt(e,t){return e.x-t.x}function pt(e,t){if(t=function(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&>(or.x||n.x===r.x&&mt(r,n)))&&(r=n,f=u)),n=n.next}while(n!==c);return r}(e,t),t){var r=At(t,e);st(t,t.next),st(r,r.next)}}function mt(e,t){return bt(e.prev,e,t.prev)<0&&bt(t.next,e,e.next)<0}function vt(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function yt(e){var t=e,r=e;do{(t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function xt(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Mt(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(St(e,t)&&St(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(bt(e.prev,e,t.prev)||bt(e,t.prev,t))||wt(e,t)&&bt(e.prev,e,e.next)>0&&bt(t.prev,t,t.next)>0)}function bt(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function wt(e,t){return e.x===t.x&&e.y===t.y}function Mt(e,t,r,n){var i=It(bt(e,t,r)),o=It(bt(e,t,n)),a=It(bt(r,n,e)),s=It(bt(r,n,t));return i!==o&&a!==s||!(0!==i||!Tt(e,r,t))||!(0!==o||!Tt(e,n,t))||!(0!==a||!Tt(r,e,n))||!(0!==s||!Tt(r,t,n))}function Tt(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function It(e){return e>0?1:e<0?-1:0}function St(e,t){return bt(e.prev,e,e.next)<0?bt(e,t,e.next)>=0&&bt(e,e.prev,t)>=0:bt(e,t,e.prev)<0||bt(e,e.next,t)<0}function At(e,t){var r=new Lt(e.i,e.x,e.y),n=new Lt(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ot(e,t,r,n){var i=new Lt(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Pt(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Lt(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jt(e,t,r,n){for(var i=0,o=t,a=r-n;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(n+=e[i-1].length,r.holes.push(n))}return r};var Gt=k.vec2(),kt=k.vec3(),_t=k.vec3(),Ft=k.vec3();function Nt(e){var t=e.data,r=e.xktModel,n=e.center,i=void 0!==n&&n,o=e.transform,a=void 0===o?null:o,s=e.stats,u=void 0===s?{}:s,c=e.log;return new Promise((function(e,n){if(t)if("CityJSON"===t.type)if(r){var o;c("Using parser: parseCityJSONIntoXKTModel"),c("center: ".concat(i)),a&&c("transform: [".concat(a,"]")),t.transform||i||a?(o=function(e){for(var t=[],r=0,n=0;r0){for(var c=[],l=0,h=t.geometry.length;l0){var x=y[g[0]];if(void 0!==x.value)d=v[x.value];else{var b=x.values;if(b){p=[];for(var w=0,M=b.length;w0&&(n.createEntity({entityId:r,meshIds:c}),e.stats.numObjects++)}}function Bt(e,t,r,n){switch(t.type){case"MultiPoint":case"MultiLineString":case"GeometryInstance":break;case"MultiSurface":case"CompositeSurface":zt(e,r,t.boundaries,n);break;case"Solid":for(var i=t.boundaries,o=0;o0&&l.push(c.length);var p=Rt(e,s[d],h,f);c.push.apply(c,Et(p))}if(3===c.length)f.indices.push(c[0]),f.indices.push(c[1]),f.indices.push(c[2]);else if(c.length>3){for(var m=[],v=0;v0&&s.push(a.length);var c=Rt(e,t[o][u],r,n);a.push.apply(a,Et(c))}if(3===a.length)n.indices.push(a[0]),n.indices.push(a[1]),n.indices.push(a[2]);else if(a.length>3){for(var l=[],h=0;h0)for(var u=0;u0){null==g&&e.log("Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT");var x=g;for(x&&o.entities[x]&&e.log("Warning: Two or more glTF nodes found with same 'name' attribute: '".concat(g," - will randomly-generating an object ID in XKT"));!x||o.entities[x];)x="entity-"+e.nextId++;if(e.metaModelCorrections){var b=e.metaModelCorrections.eachChildRoot[x];if(b){var w=e.metaModelCorrections.eachRootStats[b.id];w.countChildren++,w.countChildren>=w.numChildren&&(o.createEntity({entityId:b.id,meshIds:tr}),e.stats.numObjects++,tr.length=0)}else e.metaModelCorrections.metaObjectsMap[x]&&(o.createEntity({entityId:x,meshIds:tr}),e.stats.numObjects++,tr.length=0)}else o.createEntity({entityId:x,meshIds:tr}),e.stats.numObjects++,tr.length=0}}var nr="undefined"!=typeof atob?atob:function(e){return Buffer.from(e,"base64").toString("binary")},ir={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},or={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function ar(e){var t=e.data,r=e.xktModel,n=e.metaModelData,i=e.includeNormals,o=e.reuseGeometries,a=e.getAttachment,s=e.stats,u=void 0===s?{}:s,c=e.log;return c&&c("Using parser: parseGLTFJSONIntoXKTModel"),new Promise((function(e,s){if(t)if(r){u.sourceFormat="glTF",u.schemaVersion="2.0",u.title="",u.author="",u.created="",u.numTriangles=0,u.numVertices=0,u.numNormals=0,u.numObjects=0,u.numGeometries=0;var l={gltf:t,metaModelCorrections:n?sr(n):null,getAttachment:a||function(){throw new Error("You must define getAttachment() method to convert glTF with external resources")},log:c||function(e){},xktModel:r,includeNormals:i,createXKTGeometryIds:{},nextMeshId:0,reuseGeometries:!1!==o,stats:u};l.log("Parsing normals: ".concat(l.includeNormals?"enabled":"disabled")),function(e){var t=e.gltf.buffers;return t?Promise.all(t.map((function(t){return function(e,t){return new Promise((function(r,n){if(t._arrayBuffer)return t._buffer=t._arrayBuffer,void r(t);var i=t.uri;i?function(e,t){return new Promise((function(r,n){var i=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){var o=!!i[2],a=i[3];a=decodeURIComponent(a),o&&(a=nr(a));for(var s=new ArrayBuffer(a.length),u=new Uint8Array(s),c=0;c0)for(var l=0;l0){null==E&&e.log("[parseGLTFJSONIntoXKTModel] Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT");var D=E;if(null==D)for(a.entities[D]&&e.error("Two or more glTF nodes found with same 'name' attribute: '"+E+"'");!D||a.entities[D];)D="entity-"+e.nextId++;if(e.metaModelCorrections){var G=e.metaModelCorrections.eachChildRoot[D];if(G){var _=e.metaModelCorrections.eachRootStats[G.id];_.countChildren++,_.countChildren>=_.numChildren&&(a.createEntity({entityId:G.id,meshIds:lr}),e.stats.numObjects++,lr=[])}else e.metaModelCorrections.metaObjectsMap[D]&&(a.createEntity({entityId:D,meshIds:lr}),e.stats.numObjects++,lr=[])}else a.createEntity({entityId:D,meshIds:lr}),e.stats.numObjects++,lr=[]}}function fr(e){if(!e.attributes)return"empty";var t=e.mode,r=(e.material,e.indices),n=e.attributes.POSITION,i=e.attributes.NORMAL,o=e.attributes.COLOR_0,a=e.attributes.TEXCOORD_0;return[t,null!=r?r:"-",null!=n?n:"-",null!=i?i:"-",null!=o?o:"-",null!=a?a:"-"].join(";")}function dr(e,t,r){var n=t.attributes;if(n){switch(t.mode){case 0:r.primitive="points";break;case 1:case 2:case 3:r.primitive="lines";break;case 4:default:r.primitive="triangles";break;case 5:console.log("TRIANGLE_STRIP"),r.primitive="triangles";break;case 6:console.log("TRIANGLE_FAN"),r.primitive="triangles"}var i=e.gltf.accessors,o=t.indices;if(null!=o){var a=i[o];r.indices=pr(e,a)}var s=n.POSITION;if(null!=s){var u=i[s];r.positions=pr(e,u)}var c=n.NORMAL;if(null!=c){var l=i[c];r.normals=pr(e,l)}var h=n.COLOR_0;if(null!=h){var f=i[h];r.colors=pr(e,f)}}}function pr(e,t){var r=e.gltf.bufferViews[t.bufferView],n=or[t.type],i=ir[t.componentType],o=i.BYTES_PER_ELEMENT*n;if(t.byteStride&&t.byteStride!==o)throw new Error("interleaved buffer!");return new i(r._buffer,t.byteOffset||0,t.count*n)}function mr(e){var t=e.WebIFC,r=e.data,n=e.xktModel,i=e.autoNormals,o=void 0===i||i,a=e.includeTypes,s=e.excludeTypes,u=e.wasmPath,c=e.stats,l=void 0===c?{}:c,h=e.log;return h&&h("Using parser: parseIFCIntoXKTModel"),new Promise((function(e,i){if(r)if(n)if(u){var c=new t.IfcAPI;u&&c.SetWasmPath(u),c.Init().then((function(){var i=new Uint8Array(r),u=c.OpenModel(i);l.sourceFormat="IFC",l.schemaVersion="",l.title="",l.author="",l.created="",l.numMetaObjects=0,l.numPropertySets=0,l.numObjects=0,l.numGeometries=0,l.numTriangles=0,l.numVertices=0;var f={WebIFC:t,modelID:u,ifcAPI:c,xktModel:n,autoNormals:o,log:h||function(e){},nextId:0,stats:l};if(a){f.includeTypes={};for(var d=0,p=a.length;d0){for(var d=o.Name.value,p=[],m=0,v=f.length;m0&&(e.xktModel.createEntity({entityId:o,meshIds:i}),e.stats.numObjects++)}else console.log("excluding: "+a)}const xr=require("@loaders.gl/las");var br=5e5;function wr(e){var t=e.data,r=e.xktModel,n=e.center,i=void 0!==n&&n,o=e.transform,a=void 0===o?null:o,s=e.colorDepth,u=void 0===s?"auto":s,c=e.fp64,l=void 0!==c&&c,h=e.skip,f=void 0===h?1:h,d=e.stats,p=e.log,m=void 0===p?function(){}:p;return m&&m("Using parser: parseLASIntoXKTModel"),new Promise((function(e,n){t?r?(m("Converting LAZ/LAS"),m("center: ".concat(i)),a&&m("transform: [".concat(a,"]")),m("colorDepth: ".concat(u)),m("fp64: ".concat(l)),m("skip: ".concat(f)),(0,Ce.parse)(t,xr.LASLoader,{las:{colorDepth:u,fp64:l}}).then((function(t){var n=t.attributes,o=t.loaderData,s=void 0!==o.pointsFormatId?o.pointsFormatId:-1;if(n.POSITION){var u={};switch(s){case 0:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 0)");u=y(n.POSITION,n.intensity);break;case 1:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 1)");u=y(n.POSITION,n.intensity);break;case 2:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 2)");u=v(n.POSITION,n.COLOR_0,n.intensity);break;case 3:if(!n.intensity)return void m("No intensities found in file (expected for LAS point format 3)");u=v(n.POSITION,n.COLOR_0,n.intensity)}for(var c=g(function(e){if(e){if(i){for(var t=k.vec3(),r=e.length,n=0,o=e.length;n=e.length)return[e];for(var r=[],n=0;n0?P:null}),M++}}o&&o("Converted meta objects: "+M),e()}))}function Tr(e){var t=e.data,r=e.xktModel,n=e.littleEndian,i=void 0===n||n,o=e.stats,a=e.log;return a&&a("Using parser: parsePCDIntoXKTModel"),new Promise((function(e,n){var s=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r>16&255,g=v>>8&255,x=v>>0&255;l.push(y,g,x,255)}else l.push(255),l.push(255),l.push(255)}if("binary_compressed"===u.data)for(var b=new Uint32Array(t.slice(u.headerLen,u.headerLen+8)),w=b[0],M=b[1],T=function(e,t){var r,n,i,o=e.length,a=new Uint8Array(t),s=0,u=0;do{if((r=e[s++])<32){if(u+ ++r>t)throw new Error("Output buffer is not large enough");if(s+r>o)throw new Error("Invalid compressed data");do{a[u++]=e[s++]}while(--r)}else{if(n=r>>5,i=u-((31&r)<<8)-1,s>=o)throw new Error("Invalid compressed data");if(7===n&&(n+=e[s++],s>=o))throw new Error("Invalid compressed data");if(i-=e[s++],u+n+2>t)throw new Error("Output buffer is not large enough");if(i<0)throw new Error("Invalid compressed data");if(i>=u)throw new Error("Invalid compressed data");do{a[u++]=a[i++]}while(2+--n)}}while(s0?l:null}),r.createMesh({meshId:"pointsMesh",geometryId:"pointsGeometry"}),r.createEntity({entityId:"geometries",meshIds:["pointsMesh"]}),a&&(a("Converted drawable objects: 1"),a("Converted geometries: 1"),a("Converted vertices: "+c.length/3)),o&&(o.sourceFormat="PCD",o.schemaVersion="",o.title="",o.author="",o.created="",o.numObjects=1,o.numGeometries=1,o.numVertices=c.length/3),e()}))}const Ir=require("@loaders.gl/ply");function Sr(e){return Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sr(e)}function Ar(){Ar=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new S(i||[]);return n(a,"_invoke",{value:w(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function f(){}function d(){}function p(){}var m={};u(m,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(A([])));y&&y!==t&&r.call(y,o)&&(m=y);var g=p.prototype=f.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(n,o,a,s){var u=l(e[n],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==Sr(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=M(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function M(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Or(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Pr(e){return Lr.apply(this,arguments)}function Lr(){var e;return e=Ar().mark((function e(t){var r,n,i,o,a,s,u,c,l,h,f;return Ar().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.data,n=t.xktModel,i=t.stats,(o=t.log)&&o("Using parser: parsePLYIntoXKTModel"),r){e.next=4;break}throw"Argument expected: data";case 4:if(n){e.next=6;break}throw"Argument expected: xktModel";case 6:return e.prev=6,e.next=9,(0,Ce.parse)(r,Ir.PLYLoader);case 9:a=e.sent,e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(6),o&&o("Error: "+e.t0),e.abrupt("return");case 16:if(s=a.attributes,u=!!s.COLOR_0){for(c=u?s.COLOR_0.value:null,l=[],h=0,f=c.length;h=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Dr(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function Gr(e){return kr.apply(this,arguments)}function kr(){var e;return e=Er().mark((function e(t){var r,n,i,o,a,s,u,c;return Er().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=t.splitMeshes,i=t.autoNormals,o=t.smoothNormals,a=t.smoothNormalsAngleThreshold,s=t.xktModel,u=t.stats,(c=t.log)&&c("Using parser: parseSTLIntoXKTModel"),e.abrupt("return",new Promise((function(e,t){if(r)if(s){var l=k.createUUID(),h=s.createMetaObject({metaObjectId:l,metaObjectType:"Model",metaObjectName:"Model"}),f={data:r,splitMeshes:n,autoNormals:i,smoothNormals:o,smoothNormalsAngleThreshold:a,xktModel:s,rootMetaObject:h,nextId:0,log:c||function(e){},stats:{numObjects:0,numGeometries:0,numTriangles:0,numVertices:0}},d=Br(r);_r(d)?Fr(f,d):Nr(f,"string"!=typeof(p=r)?function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r>5&31)/31,i=(S>>10&31)/31):(r=a,n=s,i=u),(x&&r!==f||n!==d||i!==p)&&(null!==f&&(m=!0),f=r,d=n,p=i)}for(var A=1;A<=3;A++){var O=w+12*A;y.push(c.getFloat32(O,!0)),y.push(c.getFloat32(O+4,!0)),y.push(c.getFloat32(O+8,!0)),e.autoNormals||g.push(M,T,I),h&&o.push(r,n,i,1)}x&&m&&(Cr(e,y,g,o),y=[],g=[],o=o?[]:null,m=!1)}y.length>0&&Cr(e,y,g,o)}function Nr(e,t){for(var r,n,i,o,a,s,u,c=/facet([\s\S]*?)endfacet/g,l=0,h=/[\s]+([+-]?(?:\d+.\d+|\d+.|\d+|.\d+)(?:[eE][+-]?\d+)?)/.source,f=new RegExp("vertex"+h+h+h,"g"),d=new RegExp("normal"+h+h+h,"g"),p=[],m=[];null!==(o=c.exec(t));){for(a=0,s=0,u=o[0];null!==(o=d.exec(u));)r=parseFloat(o[1]),n=parseFloat(o[2]),i=parseFloat(o[3]),s++;for(;null!==(o=f.exec(u));)p.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3])),m.push(r,n,i),a++;if(1!==s)return e.log("Error in normal of face "+l),-1;if(3!==a)return e.log("Error in positions of face "+l),-1;l++}Cr(e,p,m,null)}var Vr=0;function Cr(e,t,r,n){for(var i=new Int32Array(t.length/3),o=0,a=i.length;o0?r:null,n=n&&n.length>0?n:null,!e.autoNormals&&e.smoothNormals&&function(e,t){var r,n,i,o,a,s,u,c,l,h,f,d=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).smoothNormalsAngleThreshold||20,p={},m=[],v={},y=Math.pow(10,4);for(u=0,l=e.length;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.ySize||1;r<0&&(console.error("negative ySize not allowed - will invert"),r*=-1);var n=e.zSize||1;n<0&&(console.error("negative zSize not allowed - will invert"),n*=-1);var i=e.center,o=i?i[0]:0,a=i?i[1]:0,s=i?i[2]:0,u=-t+o,c=-r+a,l=-n+s,h=t+o,f=r+a,d=n+s;return{primitiveType:"triangles",positions:[h,f,d,u,f,d,u,c,d,h,c,d,h,f,d,h,c,d,h,c,l,h,f,l,h,f,d,h,f,l,u,f,l,u,f,d,u,f,d,u,f,l,u,c,l,u,c,d,u,c,l,h,c,l,h,c,d,u,c,d,h,c,l,u,c,l,u,f,l,h,f,l],normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],uv:[1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}}function Ur(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.ySize||1;r<0&&(console.error("negative ySize not allowed - will invert"),r*=-1);var n=e.zSize||1;n<0&&(console.error("negative zSize not allowed - will invert"),n*=-1);var i=e.center,o=i?i[0]:0,a=i?i[1]:0,s=i?i[2]:0,u=-t+o,c=-r+a,l=-n+s,h=t+o,f=r+a,d=n+s;return{primitiveType:"lines",positions:[u,c,l,u,c,d,u,f,l,u,f,d,h,c,l,h,c,d,h,f,l,h,f,d],indices:[0,1,1,3,3,2,2,0,4,5,5,7,7,6,6,4,0,4,1,5,2,6,3,7]}}function Xr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.radiusTop||1;t<0&&(console.error("negative radiusTop not allowed - will invert"),t*=-1);var r=e.radiusBottom||1;r<0&&(console.error("negative radiusBottom not allowed - will invert"),r*=-1);var n=e.height||1;n<0&&(console.error("negative height not allowed - will invert"),n*=-1);var i=e.radialSegments||32;i<0&&(console.error("negative radialSegments not allowed - will invert"),i*=-1),i<3&&(i=3);var o=e.heightSegments||1;o<0&&(console.error("negative heightSegments not allowed - will invert"),o*=-1),o<1&&(o=1);var a,s,u,c,l,h,f,d,p,m,v,y=!!e.openEnded,g=e.center,x=g?g[0]:0,b=g?g[1]:0,w=g?g[2]:0,M=n/2,T=n/o,I=2*Math.PI/i,S=1/i,A=(t-r)/o,O=[],P=[],L=[],j=[],E=(90-180*Math.atan(n/(r-t))/Math.PI)/90;for(a=0;a<=o;a++)for(l=t-a*A,h=M-a*T,s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),P.push(l*u),P.push(E),P.push(l*c),L.push(s*S),L.push(1*a/o),O.push(l*u+x),O.push(h+b),O.push(l*c+w);for(a=0;a0){for(p=O.length/3,P.push(0),P.push(1),P.push(0),L.push(.5),L.push(.5),O.push(0+x),O.push(M+b),O.push(0+w),s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),m=.5*Math.sin(s*I)+.5,v=.5*Math.cos(s*I)+.5,P.push(t*u),P.push(1),P.push(t*c),L.push(m),L.push(v),O.push(t*u+x),O.push(M+b),O.push(t*c+w);for(s=0;s0){for(p=O.length/3,P.push(0),P.push(-1),P.push(0),L.push(.5),L.push(.5),O.push(0+x),O.push(0-M+b),O.push(0+w),s=0;s<=i;s++)u=Math.sin(s*I),c=Math.cos(s*I),m=.5*Math.sin(s*I)+.5,v=.5*Math.cos(s*I)+.5,P.push(r*u),P.push(-1),P.push(r*c),L.push(m),L.push(v),O.push(r*u+x),O.push(0-M+b),O.push(r*c+w);for(s=0;s0&&void 0!==arguments[0]?arguments[0]:{},t=e.size||1;t<0&&(console.error("negative size not allowed - will invert"),t*=-1);var r=e.divisions||1;r<0&&(console.error("negative divisions not allowed - will invert"),r*=-1),r<1&&(r=1);for(var n=(t=t||10)/(r=r||10),i=t/2,o=[],a=[],s=0,u=0,c=-i;u<=r;u++,c+=n)o.push(-i),o.push(0),o.push(c),o.push(i),o.push(0),o.push(c),o.push(c),o.push(0),o.push(-i),o.push(c),o.push(0),o.push(i),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return{primitiveType:"lines",positions:o,indices:a}}function Kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);var r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);var n=e.xSegments||1;n<0&&(console.error("negative xSegments not allowed - will invert"),n*=-1),n<1&&(n=1);var i=e.xSegments||1;i<0&&(console.error("negative zSegments not allowed - will invert"),i*=-1),i<1&&(i=1);var o,a,s,u,c,l,h,f=e.center,d=f?f[0]:0,p=f?f[1]:0,m=f?f[2]:0,v=t/2,y=r/2,g=Math.floor(n)||1,x=Math.floor(i)||1,b=g+1,w=x+1,M=t/g,T=r/x,I=new Float32Array(b*w*3),S=new Float32Array(b*w*3),A=new Float32Array(b*w*2),O=0,P=0;for(o=0;o65535?Uint32Array:Uint16Array)(g*x*6);for(o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=e.lod||1,r=e.center?e.center[0]:0,n=e.center?e.center[1]:0,i=e.center?e.center[2]:0,o=e.radius||1;o<0&&(console.error("negative radius not allowed - will invert"),o*=-1);var a=e.heightSegments||18;a<0&&(console.error("negative heightSegments not allowed - will invert"),a*=-1),(a=Math.floor(t*a))<18&&(a=18);var s=e.widthSegments||18;s<0&&(console.error("negative widthSegments not allowed - will invert"),s*=-1),(s=Math.floor(t*s))<18&&(s=18);var u,c,l,h,f,d,p,m,v,y,g,x,b,w,M=[],T=[],I=[],S=[];for(u=0;u<=a;u++)for(l=u*Math.PI/a,h=Math.sin(l),f=Math.cos(l),c=0;c<=s;c++)d=2*c*Math.PI/s,p=Math.sin(d),m=Math.cos(d)*h,v=f,y=p*h,g=1-c/s,x=u/a,T.push(m),T.push(v),T.push(y),I.push(g),I.push(x),M.push(r+o*m),M.push(n+o*v),M.push(i+o*y);for(u=0;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.radius||1;t<0&&(console.error("negative radius not allowed - will invert"),t*=-1),t*=.5;var r=e.tube||.3;r<0&&(console.error("negative tube not allowed - will invert"),r*=-1);var n=e.radialSegments||32;n<0&&(console.error("negative radialSegments not allowed - will invert"),n*=-1),n<4&&(n=4);var i=e.tubeSegments||24;i<0&&(console.error("negative tubeSegments not allowed - will invert"),i*=-1),i<4&&(i=4);var o=e.arc||2*Math.PI;o<0&&(console.warn("negative arc not allowed - will invert"),o*=-1),o>360&&(o=360);var a,s,u,c,l,h,f,d,p,m,v,y,g=e.center,x=g?g[0]:0,b=g?g[1]:0,w=g?g[2]:0,M=[],T=[],I=[],S=[];for(d=0;d<=i;d++)for(f=0;f<=n;f++)a=f/n*o,s=.785398+d/i*Math.PI*2,x=t*Math.cos(a),b=t*Math.sin(a),u=(t+r*Math.cos(s))*Math.cos(a),c=(t+r*Math.cos(s))*Math.sin(a),l=r*Math.sin(s),M.push(u+x),M.push(c+b),M.push(l+w),I.push(1-f/n),I.push(d/i),h=k.normalizeVec3(k.subVec3([u,c,l],[x,b,w],[]),[]),T.push(h[0]),T.push(h[1]),T.push(h[2]);for(d=1;d<=i;d++)for(f=1;f<=n;f++)p=(n+1)*d+f-1,m=(n+1)*(d-1)+f-1,v=(n+1)*(d-1)+f,y=(n+1)*d+f,S.push(p),S.push(m),S.push(v),S.push(v),S.push(y),S.push(p);return{primitiveType:"triangles",positions:M,normals:T,uv:I,uvs:I,indices:S}}var Yr={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};function Wr(){for(var e,t,r,n,i,o,a,s,u,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=c.origin||[0,0,0],h=l[0],f=l[1],d=l[2],p=c.size||1,m=[],v=[],y=((""+c.text).trim()||"").split("\n"),g=0,x=0,b=.04,w=0;w {\nreturn ","module.exports = require(\"fs\");","module.exports = require(\"path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/polyfills\");","/**\n * @desc Provides info on the XKT generated by xeokit-convert.\n */\nconst XKT_INFO = {\n\n /**\n * The XKT version generated by xeokit-convert.\n *\n * This is the XKT version that's modeled by {@link XKTModel}, serialized\n * by {@link writeXKTModelToArrayBuffer}, and written by {@link convert2xkt}.\n *\n * * Current XKT version: **10**\n * * [XKT format specs](https://github.com/xeokit/xeokit-convert/blob/main/specs/index.md)\n *\n * @property xktVersion\n * @type {number}\n */\n xktVersion: 10\n};\n\nexport {XKT_INFO};","// Some temporary vars to help avoid garbage collection\n\nconst doublePrecision = true;\nconst FloatArrayType = doublePrecision ? Float64Array : Float32Array;\n\nconst tempMat1 = new FloatArrayType(16);\nconst tempMat2 = new FloatArrayType(16);\nconst tempVec4 = new FloatArrayType(4);\n\n/**\n * @private\n */\nconst math = {\n\n MIN_DOUBLE: -Number.MAX_SAFE_INTEGER,\n MAX_DOUBLE: Number.MAX_SAFE_INTEGER,\n\n /**\n * The number of radiians in a degree (0.0174532925).\n * @property DEGTORAD\n * @type {Number}\n */\n DEGTORAD: 0.0174532925,\n\n /**\n * The number of degrees in a radian.\n * @property RADTODEG\n * @type {Number}\n */\n RADTODEG: 57.295779513,\n\n /**\n * Returns a new, uninitialized two-element vector.\n * @method vec2\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec2(values) {\n return new FloatArrayType(values || 2);\n },\n\n /**\n * Returns a new, uninitialized three-element vector.\n * @method vec3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec3(values) {\n return new FloatArrayType(values || 3);\n },\n\n /**\n * Returns a new, uninitialized four-element vector.\n * @method vec4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec4(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3x3 matrix.\n * @method mat3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat3(values) {\n return new FloatArrayType(values || 9);\n },\n\n /**\n * Converts a 3x3 matrix to 4x4\n * @method mat3ToMat4\n * @param mat3 3x3 matrix.\n * @param mat4 4x4 matrix\n * @static\n * @returns {Number[]}\n */\n mat3ToMat4(mat3, mat4 = new FloatArrayType(16)) {\n mat4[0] = mat3[0];\n mat4[1] = mat3[1];\n mat4[2] = mat3[2];\n mat4[3] = 0;\n mat4[4] = mat3[3];\n mat4[5] = mat3[4];\n mat4[6] = mat3[5];\n mat4[7] = 0;\n mat4[8] = mat3[6];\n mat4[9] = mat3[7];\n mat4[10] = mat3[8];\n mat4[11] = 0;\n mat4[12] = 0;\n mat4[13] = 0;\n mat4[14] = 0;\n mat4[15] = 1;\n return mat4;\n },\n\n /**\n * Returns a new, uninitialized 4x4 matrix.\n * @method mat4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat4(values) {\n return new FloatArrayType(values || 16);\n },\n\n /**\n * Converts a 4x4 matrix to 3x3\n * @method mat4ToMat3\n * @param mat4 4x4 matrix.\n * @param mat3 3x3 matrix\n * @static\n * @returns {Number[]}\n */\n mat4ToMat3(mat4, mat3) { // TODO\n //return new FloatArrayType(values || 9);\n },\n\n /**\n * Returns a new UUID.\n * @method createUUID\n * @static\n * @return string The new UUID\n */\n createUUID: ((() => {\n const self = {};\n const lut = [];\n for (let i = 0; i < 256; i++) {\n lut[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n return () => {\n const d0 = Math.random() * 0xffffffff | 0;\n const d1 = Math.random() * 0xffffffff | 0;\n const d2 = Math.random() * 0xffffffff | 0;\n const d3 = Math.random() * 0xffffffff | 0;\n return `${lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]}-${lut[d1 & 0xff]}${lut[d1 >> 8 & 0xff]}-${lut[d1 >> 16 & 0x0f | 0x40]}${lut[d1 >> 24 & 0xff]}-${lut[d2 & 0x3f | 0x80]}${lut[d2 >> 8 & 0xff]}-${lut[d2 >> 16 & 0xff]}${lut[d2 >> 24 & 0xff]}${lut[d3 & 0xff]}${lut[d3 >> 8 & 0xff]}${lut[d3 >> 16 & 0xff]}${lut[d3 >> 24 & 0xff]}`;\n };\n }))(),\n\n /**\n * Clamps a value to the given range.\n * @param {Number} value Value to clamp.\n * @param {Number} min Lower bound.\n * @param {Number} max Upper bound.\n * @returns {Number} Clamped result.\n */\n clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n },\n\n /**\n * Floating-point modulus\n * @method fmod\n * @static\n * @param {Number} a\n * @param {Number} b\n * @returns {*}\n */\n fmod(a, b) {\n if (a < b) {\n console.error(\"math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring\");\n return a;\n }\n while (b <= a) {\n a -= b;\n }\n return a;\n },\n\n /**\n * Negates a four-element vector.\n * @method negateVec4\n * @static\n * @param {Array(Number)} v Vector to negate\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n negateVec4(v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = -v[0];\n dest[1] = -v[1];\n dest[2] = -v[2];\n dest[3] = -v[3];\n return dest;\n },\n\n /**\n * Adds one four-element vector to another.\n * @method addVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n dest[3] = u[3] + v[3];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a four-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n dest[3] = v[3] + s;\n return dest;\n },\n\n /**\n * Adds one three-element vector to another.\n * @method addVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a three-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n return dest;\n },\n\n /**\n * Subtracts one four-element vector from another.\n * @method subVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n dest[3] = u[3] - v[3];\n return dest;\n },\n\n /**\n * Subtracts one three-element vector from another.\n * @method subVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n return dest;\n },\n\n /**\n * Subtracts one two-element vector from another.\n * @method subVec2\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec2(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n return dest;\n },\n\n /**\n * Subtracts a scalar value from each element of a four-element vector.\n * @method subVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] - s;\n dest[1] = v[1] - s;\n dest[2] = v[2] - s;\n dest[3] = v[3] - s;\n return dest;\n },\n\n /**\n * Sets each element of a 4-element vector to a scalar value minus the value of that element.\n * @method subScalarVec4\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subScalarVec4(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s - v[0];\n dest[1] = s - v[1];\n dest[2] = s - v[2];\n dest[3] = s - v[3];\n return dest;\n },\n\n /**\n * Multiplies one three-element vector by another.\n * @method mulVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n mulVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] * v[0];\n dest[1] = u[1] * v[1];\n dest[2] = u[2] * v[2];\n dest[3] = u[3] * v[3];\n return dest;\n },\n\n /**\n * Multiplies each element of a four-element vector by a scalar.\n * @method mulVec34calar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n dest[3] = v[3] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a three-element vector by a scalar.\n * @method mulVec3Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a two-element vector by a scalar.\n * @method mulVec2Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec2Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n return dest;\n },\n\n /**\n * Divides one three-element vector by another.\n * @method divVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n return dest;\n },\n\n /**\n * Divides one four-element vector by another.\n * @method divVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n dest[3] = u[3] / v[3];\n return dest;\n },\n\n /**\n * Divides a scalar by a three-element vector, returning a new vector.\n * @method divScalarVec3\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec3(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n return dest;\n },\n\n /**\n * Divides a three-element vector by a scalar.\n * @method divVec3Scalar\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n return dest;\n },\n\n /**\n * Divides a four-element vector by a scalar.\n * @method divVec4Scalar\n * @static\n * @param v vec4\n * @param s scalar\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n dest[3] = v[3] / s;\n return dest;\n },\n\n\n /**\n * Divides a scalar by a four-element vector, returning a new vector.\n * @method divScalarVec4\n * @static\n * @param s scalar\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec4(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n dest[3] = s / v[3];\n return dest;\n },\n\n /**\n * Returns the dot product of two four-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec4(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2] + u[3] * v[3]);\n },\n\n /**\n * Returns the cross product of two four-element vectors.\n * @method cross3Vec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec4(u, v) {\n const u0 = u[0];\n const u1 = u[1];\n const u2 = u[2];\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return [\n u1 * v2 - u2 * v1,\n u2 * v0 - u0 * v2,\n u0 * v1 - u1 * v0,\n 0.0];\n },\n\n /**\n * Returns the cross product of two three-element vectors.\n * @method cross3Vec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n const x = u[0];\n const y = u[1];\n const z = u[2];\n const x2 = v[0];\n const y2 = v[1];\n const z2 = v[2];\n dest[0] = y * z2 - z * y2;\n dest[1] = z * x2 - x * z2;\n dest[2] = x * y2 - y * x2;\n return dest;\n },\n\n\n sqLenVec4(v) { // TODO\n return math.dotVec4(v, v);\n },\n\n /**\n * Returns the length of a four-element vector.\n * @method lenVec4\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec4(v) {\n return Math.sqrt(math.sqLenVec4(v));\n },\n\n /**\n * Returns the dot product of two three-element vectors.\n * @method dotVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec3(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);\n },\n\n /**\n * Returns the dot product of two two-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec2(u, v) {\n return (u[0] * v[0] + u[1] * v[1]);\n },\n\n\n sqLenVec3(v) {\n return math.dotVec3(v, v);\n },\n\n\n sqLenVec2(v) {\n return math.dotVec2(v, v);\n },\n\n /**\n * Returns the length of a three-element vector.\n * @method lenVec3\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec3(v) {\n return Math.sqrt(math.sqLenVec3(v));\n },\n\n distVec3: ((() => {\n const vec = new FloatArrayType(3);\n return (v, w) => math.lenVec3(math.subVec3(v, w, vec));\n }))(),\n\n /**\n * Returns the length of a two-element vector.\n * @method lenVec2\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec2(v) {\n return Math.sqrt(math.sqLenVec2(v));\n },\n\n distVec2: ((() => {\n const vec = new FloatArrayType(2);\n return (v, w) => math.lenVec2(math.subVec2(v, w, vec));\n }))(),\n\n /**\n * @method rcpVec3\n * @static\n * @param v vec3\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n rcpVec3(v, dest) {\n return math.divScalarVec3(1.0, v, dest);\n },\n\n /**\n * Normalizes a four-element vector\n * @method normalizeVec4\n * @static\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n normalizeVec4(v, dest) {\n const f = 1.0 / math.lenVec4(v);\n return math.mulVec4Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a three-element vector\n * @method normalizeVec4\n * @static\n */\n normalizeVec3(v, dest) {\n const f = 1.0 / math.lenVec3(v);\n return math.mulVec3Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a two-element vector\n * @method normalizeVec2\n * @static\n */\n normalizeVec2(v, dest) {\n const f = 1.0 / math.lenVec2(v);\n return math.mulVec2Scalar(v, f, dest);\n },\n\n /**\n * Gets the angle between two vectors\n * @method angleVec3\n * @param v\n * @param w\n * @returns {number}\n */\n angleVec3(v, w) {\n let theta = math.dotVec3(v, w) / (Math.sqrt(math.sqLenVec3(v) * math.sqLenVec3(w)));\n theta = theta < -1 ? -1 : (theta > 1 ? 1 : theta); // Clamp to handle numerical problems\n return Math.acos(theta);\n },\n\n /**\n * Creates a three-element vector from the rotation part of a sixteen-element matrix.\n * @param m\n * @param dest\n */\n vec3FromMat4Scale: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (m, dest) => {\n\n tempVec3[0] = m[0];\n tempVec3[1] = m[1];\n tempVec3[2] = m[2];\n\n dest[0] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[4];\n tempVec3[1] = m[5];\n tempVec3[2] = m[6];\n\n dest[1] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[8];\n tempVec3[1] = m[9];\n tempVec3[2] = m[10];\n\n dest[2] = math.lenVec3(tempVec3);\n\n return dest;\n };\n }))(),\n\n /**\n * Converts an n-element vector to a JSON-serializable\n * array with values rounded to two decimal places.\n */\n vecToArray: ((() => {\n function trunc(v) {\n return Math.round(v * 100000) / 100000\n }\n\n return v => {\n v = Array.prototype.slice.call(v);\n for (let i = 0, len = v.length; i < len; i++) {\n v[i] = trunc(v[i]);\n }\n return v;\n };\n }))(),\n\n /**\n * Converts a 3-element vector from an array to an object of the form ````{x:999, y:999, z:999}````.\n * @param arr\n * @returns {{x: *, y: *, z: *}}\n */\n xyzArrayToObject(arr) {\n return {\"x\": arr[0], \"y\": arr[1], \"z\": arr[2]};\n },\n\n /**\n * Converts a 3-element vector object of the form ````{x:999, y:999, z:999}```` to an array.\n * @param xyz\n * @param [arry]\n * @returns {*[]}\n */\n xyzObjectToArray(xyz, arry) {\n arry = arry || new FloatArrayType(3);\n arry[0] = xyz.x;\n arry[1] = xyz.y;\n arry[2] = xyz.z;\n return arry;\n },\n\n /**\n * Duplicates a 4x4 identity matrix.\n * @method dupMat4\n * @static\n */\n dupMat4(m) {\n return m.slice(0, 16);\n },\n\n /**\n * Extracts a 3x3 matrix from a 4x4 matrix.\n * @method mat4To3\n * @static\n */\n mat4To3(m) {\n return [\n m[0], m[1], m[2],\n m[4], m[5], m[6],\n m[8], m[9], m[10]\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to the given scalar value.\n * @method m4s\n * @static\n */\n m4s(s) {\n return [\n s, s, s, s,\n s, s, s, s,\n s, s, s, s,\n s, s, s, s\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to zero.\n * @method setMat4ToZeroes\n * @static\n */\n setMat4ToZeroes() {\n return math.m4s(0.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n setMat4ToOnes() {\n return math.m4s(1.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n diagonalMat4v(v) {\n return new FloatArrayType([\n v[0], 0.0, 0.0, 0.0,\n 0.0, v[1], 0.0, 0.0,\n 0.0, 0.0, v[2], 0.0,\n 0.0, 0.0, 0.0, v[3]\n ]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given vector.\n * @method diagonalMat4c\n * @static\n */\n diagonalMat4c(x, y, z, w) {\n return math.diagonalMat4v([x, y, z, w]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given scalar.\n * @method diagonalMat4s\n * @static\n */\n diagonalMat4s(s) {\n return math.diagonalMat4c(s, s, s, s);\n },\n\n /**\n * Returns a 4x4 identity matrix.\n * @method identityMat4\n * @static\n */\n identityMat4(mat = new FloatArrayType(16)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n mat[3] = 0.0;\n\n mat[4] = 0.0;\n mat[5] = 1.0;\n mat[6] = 0.0;\n mat[7] = 0.0;\n\n mat[8] = 0.0;\n mat[9] = 0.0;\n mat[10] = 1.0;\n mat[11] = 0.0;\n\n mat[12] = 0.0;\n mat[13] = 0.0;\n mat[14] = 0.0;\n mat[15] = 1.0;\n\n return mat;\n },\n\n /**\n * Returns a 3x3 identity matrix.\n * @method identityMat3\n * @static\n */\n identityMat3(mat = new FloatArrayType(9)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n\n mat[3] = 0.0;\n mat[4] = 1.0;\n mat[5] = 0.0;\n\n mat[6] = 0.0;\n mat[7] = 0.0;\n mat[8] = 1.0;\n\n return mat;\n },\n\n /**\n * Tests if the given 4x4 matrix is the identity matrix.\n * @method isIdentityMat4\n * @static\n */\n isIdentityMat4(m) {\n if (m[0] !== 1.0 || m[1] !== 0.0 || m[2] !== 0.0 || m[3] !== 0.0 ||\n m[4] !== 0.0 || m[5] !== 1.0 || m[6] !== 0.0 || m[7] !== 0.0 ||\n m[8] !== 0.0 || m[9] !== 0.0 || m[10] !== 1.0 || m[11] !== 0.0 ||\n m[12] !== 0.0 || m[13] !== 0.0 || m[14] !== 0.0 || m[15] !== 1.0) {\n return false;\n }\n return true;\n },\n\n /**\n * Negates the given 4x4 matrix.\n * @method negateMat4\n * @static\n */\n negateMat4(m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = -m[0];\n dest[1] = -m[1];\n dest[2] = -m[2];\n dest[3] = -m[3];\n dest[4] = -m[4];\n dest[5] = -m[5];\n dest[6] = -m[6];\n dest[7] = -m[7];\n dest[8] = -m[8];\n dest[9] = -m[9];\n dest[10] = -m[10];\n dest[11] = -m[11];\n dest[12] = -m[12];\n dest[13] = -m[13];\n dest[14] = -m[14];\n dest[15] = -m[15];\n return dest;\n },\n\n /**\n * Adds the given 4x4 matrices together.\n * @method addMat4\n * @static\n */\n addMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] + b[0];\n dest[1] = a[1] + b[1];\n dest[2] = a[2] + b[2];\n dest[3] = a[3] + b[3];\n dest[4] = a[4] + b[4];\n dest[5] = a[5] + b[5];\n dest[6] = a[6] + b[6];\n dest[7] = a[7] + b[7];\n dest[8] = a[8] + b[8];\n dest[9] = a[9] + b[9];\n dest[10] = a[10] + b[10];\n dest[11] = a[11] + b[11];\n dest[12] = a[12] + b[12];\n dest[13] = a[13] + b[13];\n dest[14] = a[14] + b[14];\n dest[15] = a[15] + b[15];\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addMat4Scalar\n * @static\n */\n addMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] + s;\n dest[1] = m[1] + s;\n dest[2] = m[2] + s;\n dest[3] = m[3] + s;\n dest[4] = m[4] + s;\n dest[5] = m[5] + s;\n dest[6] = m[6] + s;\n dest[7] = m[7] + s;\n dest[8] = m[8] + s;\n dest[9] = m[9] + s;\n dest[10] = m[10] + s;\n dest[11] = m[11] + s;\n dest[12] = m[12] + s;\n dest[13] = m[13] + s;\n dest[14] = m[14] + s;\n dest[15] = m[15] + s;\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addScalarMat4\n * @static\n */\n addScalarMat4(s, m, dest) {\n return math.addMat4Scalar(m, s, dest);\n },\n\n /**\n * Subtracts the second 4x4 matrix from the first.\n * @method subMat4\n * @static\n */\n subMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] - b[0];\n dest[1] = a[1] - b[1];\n dest[2] = a[2] - b[2];\n dest[3] = a[3] - b[3];\n dest[4] = a[4] - b[4];\n dest[5] = a[5] - b[5];\n dest[6] = a[6] - b[6];\n dest[7] = a[7] - b[7];\n dest[8] = a[8] - b[8];\n dest[9] = a[9] - b[9];\n dest[10] = a[10] - b[10];\n dest[11] = a[11] - b[11];\n dest[12] = a[12] - b[12];\n dest[13] = a[13] - b[13];\n dest[14] = a[14] - b[14];\n dest[15] = a[15] - b[15];\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subMat4Scalar\n * @static\n */\n subMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] - s;\n dest[1] = m[1] - s;\n dest[2] = m[2] - s;\n dest[3] = m[3] - s;\n dest[4] = m[4] - s;\n dest[5] = m[5] - s;\n dest[6] = m[6] - s;\n dest[7] = m[7] - s;\n dest[8] = m[8] - s;\n dest[9] = m[9] - s;\n dest[10] = m[10] - s;\n dest[11] = m[11] - s;\n dest[12] = m[12] - s;\n dest[13] = m[13] - s;\n dest[14] = m[14] - s;\n dest[15] = m[15] - s;\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subScalarMat4\n * @static\n */\n subScalarMat4(s, m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = s - m[0];\n dest[1] = s - m[1];\n dest[2] = s - m[2];\n dest[3] = s - m[3];\n dest[4] = s - m[4];\n dest[5] = s - m[5];\n dest[6] = s - m[6];\n dest[7] = s - m[7];\n dest[8] = s - m[8];\n dest[9] = s - m[9];\n dest[10] = s - m[10];\n dest[11] = s - m[11];\n dest[12] = s - m[12];\n dest[13] = s - m[13];\n dest[14] = s - m[14];\n dest[15] = s - m[15];\n return dest;\n },\n\n /**\n * Multiplies the two given 4x4 matrix by each other.\n * @method mulMat4\n * @static\n */\n mulMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = a[0];\n\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[4];\n const b11 = b[5];\n const b12 = b[6];\n const b13 = b[7];\n const b20 = b[8];\n const b21 = b[9];\n const b22 = b[10];\n const b23 = b[11];\n const b30 = b[12];\n const b31 = b[13];\n const b32 = b[14];\n const b33 = b[15];\n\n dest[0] = b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30;\n dest[1] = b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31;\n dest[2] = b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32;\n dest[3] = b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33;\n dest[4] = b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30;\n dest[5] = b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31;\n dest[6] = b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32;\n dest[7] = b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33;\n dest[8] = b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30;\n dest[9] = b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31;\n dest[10] = b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32;\n dest[11] = b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33;\n dest[12] = b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30;\n dest[13] = b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31;\n dest[14] = b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32;\n dest[15] = b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33;\n\n return dest;\n },\n\n /**\n * Multiplies the two given 3x3 matrices by each other.\n * @method mulMat4\n * @static\n */\n mulMat3(a, b, dest) {\n if (!dest) {\n dest = new FloatArrayType(9);\n }\n\n const a11 = a[0];\n const a12 = a[3];\n const a13 = a[6];\n const a21 = a[1];\n const a22 = a[4];\n const a23 = a[7];\n const a31 = a[2];\n const a32 = a[5];\n const a33 = a[8];\n const b11 = b[0];\n const b12 = b[3];\n const b13 = b[6];\n const b21 = b[1];\n const b22 = b[4];\n const b23 = b[7];\n const b31 = b[2];\n const b32 = b[5];\n const b33 = b[8];\n\n dest[0] = a11 * b11 + a12 * b21 + a13 * b31;\n dest[3] = a11 * b12 + a12 * b22 + a13 * b32;\n dest[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\n dest[1] = a21 * b11 + a22 * b21 + a23 * b31;\n dest[4] = a21 * b12 + a22 * b22 + a23 * b32;\n dest[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\n dest[2] = a31 * b11 + a32 * b21 + a33 * b31;\n dest[5] = a31 * b12 + a32 * b22 + a33 * b32;\n dest[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\n return dest;\n },\n\n /**\n * Multiplies each element of the given 4x4 matrix by the given scalar.\n * @method mulMat4Scalar\n * @static\n */\n mulMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] * s;\n dest[1] = m[1] * s;\n dest[2] = m[2] * s;\n dest[3] = m[3] * s;\n dest[4] = m[4] * s;\n dest[5] = m[5] * s;\n dest[6] = m[6] * s;\n dest[7] = m[7] * s;\n dest[8] = m[8] * s;\n dest[9] = m[9] * s;\n dest[10] = m[10] * s;\n dest[11] = m[11] * s;\n dest[12] = m[12] * s;\n dest[13] = m[13] * s;\n dest[14] = m[14] * s;\n dest[15] = m[15] * s;\n return dest;\n },\n\n /**\n * Multiplies the given 4x4 matrix by the given four-element vector.\n * @method mulMat4v4\n * @static\n */\n mulMat4v4(m, v, dest = math.vec4()) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Transposes the given 4x4 matrix.\n * @method transposeMat4\n * @static\n */\n transposeMat4(mat, dest) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n const m4 = mat[4];\n\n const m14 = mat[14];\n const m8 = mat[8];\n const m13 = mat[13];\n const m12 = mat[12];\n const m9 = mat[9];\n if (!dest || mat === dest) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a12 = mat[6];\n const a13 = mat[7];\n const a23 = mat[11];\n mat[1] = m4;\n mat[2] = m8;\n mat[3] = m12;\n mat[4] = a01;\n mat[6] = m9;\n mat[7] = m13;\n mat[8] = a02;\n mat[9] = a12;\n mat[11] = m14;\n mat[12] = a03;\n mat[13] = a13;\n mat[14] = a23;\n return mat;\n }\n dest[0] = mat[0];\n dest[1] = m4;\n dest[2] = m8;\n dest[3] = m12;\n dest[4] = mat[1];\n dest[5] = mat[5];\n dest[6] = m9;\n dest[7] = m13;\n dest[8] = mat[2];\n dest[9] = mat[6];\n dest[10] = mat[10];\n dest[11] = m14;\n dest[12] = mat[3];\n dest[13] = mat[7];\n dest[14] = mat[11];\n dest[15] = mat[15];\n return dest;\n },\n\n /**\n * Transposes the given 3x3 matrix.\n *\n * @method transposeMat3\n * @static\n */\n transposeMat3(mat, dest) {\n if (dest === mat) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a12 = mat[5];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = a01;\n dest[5] = mat[7];\n dest[6] = a02;\n dest[7] = a12;\n } else {\n dest[0] = mat[0];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = mat[1];\n dest[4] = mat[4];\n dest[5] = mat[7];\n dest[6] = mat[2];\n dest[7] = mat[5];\n dest[8] = mat[8];\n }\n return dest;\n },\n\n /**\n * Returns the determinant of the given 4x4 matrix.\n * @method determinantMat4\n * @static\n */\n determinantMat4(mat) {\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n return a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 +\n a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 +\n a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 +\n a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 +\n a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 +\n a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33;\n },\n\n /**\n * Returns the inverse of the given 4x4 matrix.\n * @method inverseMat4\n * @static\n */\n inverseMat4(mat, dest) {\n if (!dest) {\n dest = mat;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant (inlined to avoid double-caching)\n const invDet = 1 / (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06);\n\n dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;\n dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;\n dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;\n dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;\n dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;\n dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;\n dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;\n dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;\n dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;\n dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;\n dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;\n dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;\n dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;\n dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;\n dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;\n dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;\n\n return dest;\n },\n\n /**\n * Returns the trace of the given 4x4 matrix.\n * @method traceMat4\n * @static\n */\n traceMat4(m) {\n return (m[0] + m[5] + m[10] + m[15]);\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4\n * @static\n */\n translationMat4v(v, dest) {\n const m = dest || math.identityMat4();\n m[12] = v[0];\n m[13] = v[1];\n m[14] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 translation matrix.\n * @method translationMat3\n * @static\n */\n translationMat3v(v, dest) {\n const m = dest || math.identityMat3();\n m[6] = v[0];\n m[7] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4c\n * @static\n */\n translationMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.translationMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4s\n * @static\n */\n translationMat4s(s, dest) {\n return math.translationMat4c(s, s, s, dest);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param v\n * @param m\n */\n translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param x\n * @param y\n * @param z\n * @param m\n */\n OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n },\n\n translateMat4c(x, y, z, m) {\n\n const m3 = m[3];\n m[0] += m3 * x;\n m[1] += m3 * y;\n m[2] += m3 * z;\n\n const m7 = m[7];\n m[4] += m7 * x;\n m[5] += m7 * y;\n m[6] += m7 * z;\n\n const m11 = m[11];\n m[8] += m11 * x;\n m[9] += m11 * y;\n m[10] += m11 * z;\n\n const m15 = m[15];\n m[12] += m15 * x;\n m[13] += m15 * y;\n m[14] += m15 * z;\n\n return m;\n },\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4v\n * @static\n */\n rotationMat4v(anglerad, axis, m) {\n const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []);\n const s = Math.sin(anglerad);\n const c = Math.cos(anglerad);\n const q = 1.0 - c;\n\n const x = ax[0];\n const y = ax[1];\n const z = ax[2];\n\n let xy;\n let yz;\n let zx;\n let xs;\n let ys;\n let zs;\n\n //xx = x * x; used once\n //yy = y * y; used once\n //zz = z * z; used once\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n m = m || math.mat4();\n\n m[0] = (q * x * x) + c;\n m[1] = (q * xy) + zs;\n m[2] = (q * zx) - ys;\n m[3] = 0.0;\n\n m[4] = (q * xy) - zs;\n m[5] = (q * y * y) + c;\n m[6] = (q * yz) + xs;\n m[7] = 0.0;\n\n m[8] = (q * zx) + ys;\n m[9] = (q * yz) - xs;\n m[10] = (q * z * z) + c;\n m[11] = 0.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n\n return m;\n },\n\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4c\n * @static\n */\n rotationMat4c(anglerad, x, y, z, mat) {\n return math.rotationMat4v(anglerad, [x, y, z], mat);\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4v\n * @static\n */\n scalingMat4v(v, m = math.identityMat4()) {\n m[0] = v[0];\n m[5] = v[1];\n m[10] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 scale matrix.\n * @method scalingMat3v\n * @static\n */\n scalingMat3v(v, m = math.identityMat3()) {\n m[0] = v[0];\n m[4] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4c\n * @static\n */\n scalingMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.scalingMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param x\n * @param y\n * @param z\n * @param m\n */\n scaleMat4c(x, y, z, m) {\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n return m;\n },\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param xyz\n * @param m\n */\n scaleMat4v(xyz, m) {\n\n const x = xyz[0];\n const y = xyz[1];\n const z = xyz[2];\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4s\n * @static\n */\n scalingMat4s(s) {\n return math.scalingMat4c(s, s, s);\n },\n\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n *\n * @param {Number[]} q Rotation quaternion\n * @param {Number[]} v Translation vector\n * @param {Number[]} dest Destination matrix\n * @returns {Number[]} dest\n */\n rotationTranslationMat4(q, v, dest = math.mat4()) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n dest[0] = 1 - (yy + zz);\n dest[1] = xy + wz;\n dest[2] = xz - wy;\n dest[3] = 0;\n dest[4] = xy - wz;\n dest[5] = 1 - (xx + zz);\n dest[6] = yz + wx;\n dest[7] = 0;\n dest[8] = xz + wy;\n dest[9] = yz - wx;\n dest[10] = 1 - (xx + yy);\n dest[11] = 0;\n dest[12] = v[0];\n dest[13] = v[1];\n dest[14] = v[2];\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Gets Euler angles from a 4x4 matrix.\n *\n * @param {Number[]} mat The 4x4 matrix.\n * @param {String} order Desired Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination Euler angles, created by default.\n * @returns {Number[]} The Euler angles.\n */\n mat4ToEuler(mat, order, dest = math.vec4()) {\n const clamp = math.clamp;\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = mat[0];\n\n const m12 = mat[4];\n const m13 = mat[8];\n const m21 = mat[1];\n const m22 = mat[5];\n const m23 = mat[9];\n const m31 = mat[2];\n const m32 = mat[6];\n const m33 = mat[10];\n\n if (order === 'XYZ') {\n\n dest[1] = Math.asin(clamp(m13, -1, 1));\n\n if (Math.abs(m13) < 0.99999) {\n dest[0] = Math.atan2(-m23, m33);\n dest[2] = Math.atan2(-m12, m11);\n } else {\n dest[0] = Math.atan2(m32, m22);\n dest[2] = 0;\n\n }\n\n } else if (order === 'YXZ') {\n\n dest[0] = Math.asin(-clamp(m23, -1, 1));\n\n if (Math.abs(m23) < 0.99999) {\n dest[1] = Math.atan2(m13, m33);\n dest[2] = Math.atan2(m21, m22);\n } else {\n dest[1] = Math.atan2(-m31, m11);\n dest[2] = 0;\n }\n\n } else if (order === 'ZXY') {\n\n dest[0] = Math.asin(clamp(m32, -1, 1));\n\n if (Math.abs(m32) < 0.99999) {\n dest[1] = Math.atan2(-m31, m33);\n dest[2] = Math.atan2(-m12, m22);\n } else {\n dest[1] = 0;\n dest[2] = Math.atan2(m21, m11);\n }\n\n } else if (order === 'ZYX') {\n\n dest[1] = Math.asin(-clamp(m31, -1, 1));\n\n if (Math.abs(m31) < 0.99999) {\n dest[0] = Math.atan2(m32, m33);\n dest[2] = Math.atan2(m21, m11);\n } else {\n dest[0] = 0;\n dest[2] = Math.atan2(-m12, m22);\n }\n\n } else if (order === 'YZX') {\n\n dest[2] = Math.asin(clamp(m21, -1, 1));\n\n if (Math.abs(m21) < 0.99999) {\n dest[0] = Math.atan2(-m23, m22);\n dest[1] = Math.atan2(-m31, m11);\n } else {\n dest[0] = 0;\n dest[1] = Math.atan2(m13, m33);\n }\n\n } else if (order === 'XZY') {\n\n dest[2] = Math.asin(-clamp(m12, -1, 1));\n\n if (Math.abs(m12) < 0.99999) {\n dest[0] = Math.atan2(m32, m22);\n dest[1] = Math.atan2(m13, m11);\n } else {\n dest[0] = Math.atan2(-m23, m33);\n dest[1] = 0;\n }\n }\n\n return dest;\n },\n\n composeMat4(position, quaternion, scale, mat = math.mat4()) {\n math.quaternionToRotationMat4(quaternion, mat);\n math.scaleMat4v(scale, mat);\n math.translateMat4v(position, mat);\n\n return mat;\n },\n\n decomposeMat4: (() => {\n\n const vec = new FloatArrayType(3);\n const matrix = new FloatArrayType(16);\n\n return function decompose(mat, position, quaternion, scale) {\n\n vec[0] = mat[0];\n vec[1] = mat[1];\n vec[2] = mat[2];\n\n let sx = math.lenVec3(vec);\n\n vec[0] = mat[4];\n vec[1] = mat[5];\n vec[2] = mat[6];\n\n const sy = math.lenVec3(vec);\n\n vec[8] = mat[8];\n vec[9] = mat[9];\n vec[10] = mat[10];\n\n const sz = math.lenVec3(vec);\n\n // if determine is negative, we need to invert one scale\n const det = math.determinantMat4(mat);\n\n if (det < 0) {\n sx = -sx;\n }\n\n position[0] = mat[12];\n position[1] = mat[13];\n position[2] = mat[14];\n\n // scale the rotation part\n matrix.set(mat);\n\n const invSX = 1 / sx;\n const invSY = 1 / sy;\n const invSZ = 1 / sz;\n\n matrix[0] *= invSX;\n matrix[1] *= invSX;\n matrix[2] *= invSX;\n\n matrix[4] *= invSY;\n matrix[5] *= invSY;\n matrix[6] *= invSY;\n\n matrix[8] *= invSZ;\n matrix[9] *= invSZ;\n matrix[10] *= invSZ;\n\n math.mat4ToQuaternion(matrix, quaternion);\n\n scale[0] = sx;\n scale[1] = sy;\n scale[2] = sz;\n\n return this;\n\n };\n\n })(),\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4v\n * @param pos vec3 position of the viewer\n * @param target vec3 point the viewer is looking at\n * @param up vec3 pointing \"up\"\n * @param dest mat4 Optional, mat4 matrix will be written into\n *\n * @return {mat4} dest if specified, a new mat4 otherwise\n */\n lookAtMat4v(pos, target, up, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n\n const posx = pos[0];\n const posy = pos[1];\n const posz = pos[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const targetx = target[0];\n const targety = target[1];\n const targetz = target[2];\n\n if (posx === targetx && posy === targety && posz === targetz) {\n return math.identityMat4();\n }\n\n let z0;\n let z1;\n let z2;\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let len;\n\n //vec3.direction(eye, center, z);\n z0 = posx - targetx;\n z1 = posy - targety;\n z2 = posz - targetz;\n\n // normalize (no check needed for 0 because of early return)\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n //vec3.normalize(vec3.cross(up, z, x));\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n //vec3.normalize(vec3.cross(z, x, y));\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n dest[0] = x0;\n dest[1] = y0;\n dest[2] = z0;\n dest[3] = 0;\n dest[4] = x1;\n dest[5] = y1;\n dest[6] = z1;\n dest[7] = 0;\n dest[8] = x2;\n dest[9] = y2;\n dest[10] = z2;\n dest[11] = 0;\n dest[12] = -(x0 * posx + x1 * posy + x2 * posz);\n dest[13] = -(y0 * posx + y1 * posy + y2 * posz);\n dest[14] = -(z0 * posx + z1 * posy + z2 * posz);\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4c\n * @static\n */\n lookAtMat4c(posx, posy, posz, targetx, targety, targetz, upx, upy, upz) {\n return math.lookAtMat4v([posx, posy, posz], [targetx, targety, targetz], [upx, upy, upz], []);\n },\n\n /**\n * Returns a 4x4 orthographic projection matrix.\n * @method orthoMat4c\n * @static\n */\n orthoMat4c(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n\n dest[0] = 2.0 / rl;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 0.0;\n\n dest[4] = 0.0;\n dest[5] = 2.0 / tb;\n dest[6] = 0.0;\n dest[7] = 0.0;\n\n dest[8] = 0.0;\n dest[9] = 0.0;\n dest[10] = -2.0 / fn;\n dest[11] = 0.0;\n\n dest[12] = -(left + right) / rl;\n dest[13] = -(top + bottom) / tb;\n dest[14] = -(far + near) / fn;\n dest[15] = 1.0;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4v(fmin, fmax, m) {\n if (!m) {\n m = math.mat4();\n }\n\n const fmin4 = [fmin[0], fmin[1], fmin[2], 0.0];\n const fmax4 = [fmax[0], fmax[1], fmax[2], 0.0];\n\n math.addVec4(fmax4, fmin4, tempMat1);\n math.subVec4(fmax4, fmin4, tempMat2);\n\n const t = 2.0 * fmin4[2];\n\n const tempMat20 = tempMat2[0];\n const tempMat21 = tempMat2[1];\n const tempMat22 = tempMat2[2];\n\n m[0] = t / tempMat20;\n m[1] = 0.0;\n m[2] = 0.0;\n m[3] = 0.0;\n\n m[4] = 0.0;\n m[5] = t / tempMat21;\n m[6] = 0.0;\n m[7] = 0.0;\n\n m[8] = tempMat1[0] / tempMat20;\n m[9] = tempMat1[1] / tempMat21;\n m[10] = -tempMat1[2] / tempMat22;\n m[11] = -1.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = -t * fmax4[2] / tempMat22;\n m[15] = 0.0;\n\n return m;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n dest[0] = (near * 2) / rl;\n dest[1] = 0;\n dest[2] = 0;\n dest[3] = 0;\n dest[4] = 0;\n dest[5] = (near * 2) / tb;\n dest[6] = 0;\n dest[7] = 0;\n dest[8] = (right + left) / rl;\n dest[9] = (top + bottom) / tb;\n dest[10] = -(far + near) / fn;\n dest[11] = -1;\n dest[12] = 0;\n dest[13] = 0;\n dest[14] = -(far * near * 2) / fn;\n dest[15] = 0;\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method perspectiveMat4v\n * @static\n */\n perspectiveMat4(fovyrad, aspectratio, znear, zfar, m) {\n const pmin = [];\n const pmax = [];\n\n pmin[2] = znear;\n pmax[2] = zfar;\n\n pmax[1] = pmin[2] * Math.tan(fovyrad / 2.0);\n pmin[1] = -pmax[1];\n\n pmax[0] = pmax[1] * aspectratio;\n pmin[0] = -pmax[0];\n\n return math.frustumMat4v(pmin, pmax, m);\n },\n\n /**\n * Transforms a three-element position by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint3(m, p, dest = math.vec3()) {\n\n const x = p[0];\n const y = p[1];\n const z = p[2];\n\n dest[0] = (m[0] * x) + (m[4] * y) + (m[8] * z) + m[12];\n dest[1] = (m[1] * x) + (m[5] * y) + (m[9] * z) + m[13];\n dest[2] = (m[2] * x) + (m[6] * y) + (m[10] * z) + m[14];\n\n return dest;\n },\n\n /**\n * Transforms a homogeneous coordinate by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint4(m, v, dest = math.vec4()) {\n dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];\n dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];\n dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3];\n dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3];\n\n return dest;\n },\n\n\n /**\n * Transforms an array of three-element positions by a 4x4 matrix.\n * @method transformPoints3\n * @static\n */\n transformPoints3(m, points, points2) {\n const result = points2 || [];\n const len = points.length;\n let p0;\n let p1;\n let p2;\n let pi;\n\n // cache values\n const m0 = m[0];\n\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n let r;\n\n for (let i = 0; i < len; ++i) {\n\n // cache values\n pi = points[i];\n\n p0 = pi[0];\n p1 = pi[1];\n p2 = pi[2];\n\n r = result[i] || (result[i] = [0, 0, 0]);\n\n r[0] = (m0 * p0) + (m4 * p1) + (m8 * p2) + m12;\n r[1] = (m1 * p0) + (m5 * p1) + (m9 * p2) + m13;\n r[2] = (m2 * p0) + (m6 * p1) + (m10 * p2) + m14;\n r[3] = (m3 * p0) + (m7 * p1) + (m11 * p2) + m15;\n }\n\n result.length = len;\n\n return result;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions3\n * @static\n */\n transformPositions3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 3) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions4\n * @static\n */\n transformPositions4(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms a three-element vector by a 4x4 matrix.\n * @method transformVec3\n * @static\n */\n transformVec3(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n dest = dest || this.vec3();\n dest[0] = (m[0] * v0) + (m[4] * v1) + (m[8] * v2);\n dest[1] = (m[1] * v0) + (m[5] * v1) + (m[9] * v2);\n dest[2] = (m[2] * v0) + (m[6] * v1) + (m[10] * v2);\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 matrix.\n * @method transformVec4\n * @static\n */\n transformVec4(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest = dest || math.vec4();\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the x-axis\n *\n * @method rotateVec3X\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3X(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);\n r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the y-axis\n *\n * @method rotateVec3Y\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Y(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the z-axis\n *\n * @method rotateVec3Z\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Z(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);\n r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);\n r[2] = p[2];\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 projection matrix.\n *\n * @method projectVec4\n * @param {Number[]} p 3D View-space coordinate\n * @param {Number[]} q 2D Projected coordinate\n * @returns {Number[]} 2D Projected coordinate\n * @static\n */\n projectVec4(p, q) {\n const f = 1.0 / p[3];\n q = q || math.vec2();\n q[0] = v[0] * f;\n q[1] = v[1] * f;\n return q;\n },\n\n /**\n * Unprojects a three-element vector.\n *\n * @method unprojectVec3\n * @param {Number[]} p 3D Projected coordinate\n * @param {Number[]} viewMat View matrix\n * @returns {Number[]} projMat Projection matrix\n * @static\n */\n unprojectVec3: ((() => {\n const mat = new FloatArrayType(16);\n const mat2 = new FloatArrayType(16);\n const mat3 = new FloatArrayType(16);\n return function (p, viewMat, projMat, q) {\n return this.transformVec3(this.mulMat4(this.inverseMat4(viewMat, mat), this.inverseMat4(projMat, mat2), mat3), p, q)\n };\n }))(),\n\n /**\n * Linearly interpolates between two 3D vectors.\n * @method lerpVec3\n * @static\n */\n lerpVec3(t, t1, t2, p1, p2, dest) {\n const result = dest || math.vec3();\n const f = (t - t1) / (t2 - t1);\n result[0] = p1[0] + (f * (p2[0] - p1[0]));\n result[1] = p1[1] + (f * (p2[1] - p1[1]));\n result[2] = p1[2] + (f * (p2[2] - p1[2]));\n return result;\n },\n\n\n /**\n * Flattens a two-dimensional array into a one-dimensional array.\n *\n * @method flatten\n * @static\n * @param {Array of Arrays} a A 2D array\n * @returns Flattened 1D array\n */\n flatten(a) {\n\n const result = [];\n\n let i;\n let leni;\n let j;\n let lenj;\n let item;\n\n for (i = 0, leni = a.length; i < leni; i++) {\n item = a[i];\n for (j = 0, lenj = item.length; j < lenj; j++) {\n result.push(item[j]);\n }\n }\n\n return result;\n },\n\n\n identityQuaternion(dest = math.vec4()) {\n dest[0] = 0.0;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 1.0;\n return dest;\n },\n\n /**\n * Initializes a quaternion from Euler angles.\n *\n * @param {Number[]} euler The Euler angles.\n * @param {String} order Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination quaternion, created by default.\n * @returns {Number[]} The quaternion.\n */\n eulerToQuaternion(euler, order, dest = math.vec4()) {\n // http://www.mathworks.com/matlabcentral/fileexchange/\n // \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n //\tcontent/SpinCalc.m\n\n const a = (euler[0] * math.DEGTORAD) / 2;\n const b = (euler[1] * math.DEGTORAD) / 2;\n const c = (euler[2] * math.DEGTORAD) / 2;\n\n const c1 = Math.cos(a);\n const c2 = Math.cos(b);\n const c3 = Math.cos(c);\n const s1 = Math.sin(a);\n const s2 = Math.sin(b);\n const s3 = Math.sin(c);\n\n if (order === 'XYZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'YXZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'ZXY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'ZYX') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'YZX') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'XZY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n }\n\n return dest;\n },\n\n mat4ToQuaternion(m, dest = math.vec4()) {\n // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = m[0];\n const m12 = m[4];\n const m13 = m[8];\n const m21 = m[1];\n const m22 = m[5];\n const m23 = m[9];\n const m31 = m[2];\n const m32 = m[6];\n const m33 = m[10];\n let s;\n\n const trace = m11 + m22 + m33;\n\n if (trace > 0) {\n\n s = 0.5 / Math.sqrt(trace + 1.0);\n\n dest[3] = 0.25 / s;\n dest[0] = (m32 - m23) * s;\n dest[1] = (m13 - m31) * s;\n dest[2] = (m21 - m12) * s;\n\n } else if (m11 > m22 && m11 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n dest[3] = (m32 - m23) / s;\n dest[0] = 0.25 * s;\n dest[1] = (m12 + m21) / s;\n dest[2] = (m13 + m31) / s;\n\n } else if (m22 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n dest[3] = (m13 - m31) / s;\n dest[0] = (m12 + m21) / s;\n dest[1] = 0.25 * s;\n dest[2] = (m23 + m32) / s;\n\n } else {\n\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n dest[3] = (m21 - m12) / s;\n dest[0] = (m13 + m31) / s;\n dest[1] = (m23 + m32) / s;\n dest[2] = 0.25 * s;\n }\n\n return dest;\n },\n\n vec3PairToQuaternion(u, v, dest = math.vec4()) {\n const norm_u_norm_v = Math.sqrt(math.dotVec3(u, u) * math.dotVec3(v, v));\n let real_part = norm_u_norm_v + math.dotVec3(u, v);\n\n if (real_part < 0.00000001 * norm_u_norm_v) {\n\n // If u and v are exactly opposite, rotate 180 degrees\n // around an arbitrary orthogonal axis. Axis normalisation\n // can happen later, when we normalise the quaternion.\n\n real_part = 0.0;\n\n if (Math.abs(u[0]) > Math.abs(u[2])) {\n\n dest[0] = -u[1];\n dest[1] = u[0];\n dest[2] = 0;\n\n } else {\n dest[0] = 0;\n dest[1] = -u[2];\n dest[2] = u[1]\n }\n\n } else {\n\n // Otherwise, build quaternion the standard way.\n math.cross3Vec3(u, v, dest);\n }\n\n dest[3] = real_part;\n\n return math.normalizeQuaternion(dest);\n },\n\n angleAxisToQuaternion(angleAxis, dest = math.vec4()) {\n const halfAngle = angleAxis[3] / 2.0;\n const fsin = Math.sin(halfAngle);\n dest[0] = fsin * angleAxis[0];\n dest[1] = fsin * angleAxis[1];\n dest[2] = fsin * angleAxis[2];\n dest[3] = Math.cos(halfAngle);\n return dest;\n },\n\n quaternionToEuler: ((() => {\n const mat = new FloatArrayType(16);\n return (q, order, dest) => {\n dest = dest || math.vec3();\n math.quaternionToRotationMat4(q, mat);\n math.mat4ToEuler(mat, order, dest);\n return dest;\n };\n }))(),\n\n mulQuaternions(p, q, dest = math.vec4()) {\n const p0 = p[0];\n const p1 = p[1];\n const p2 = p[2];\n const p3 = p[3];\n const q0 = q[0];\n const q1 = q[1];\n const q2 = q[2];\n const q3 = q[3];\n dest[0] = p3 * q0 + p0 * q3 + p1 * q2 - p2 * q1;\n dest[1] = p3 * q1 + p1 * q3 + p2 * q0 - p0 * q2;\n dest[2] = p3 * q2 + p2 * q3 + p0 * q1 - p1 * q0;\n dest[3] = p3 * q3 - p0 * q0 - p1 * q1 - p2 * q2;\n return dest;\n },\n\n vec3ApplyQuaternion(q, vec, dest = math.vec3()) {\n const x = vec[0];\n const y = vec[1];\n const z = vec[2];\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n // calculate quat * vector\n\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n\n dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return dest;\n },\n\n quaternionToMat4(q, dest) {\n\n dest = math.identityMat4(dest);\n\n const q0 = q[0]; //x\n const q1 = q[1]; //y\n const q2 = q[2]; //z\n const q3 = q[3]; //w\n\n const tx = 2.0 * q0;\n const ty = 2.0 * q1;\n const tz = 2.0 * q2;\n\n const twx = tx * q3;\n const twy = ty * q3;\n const twz = tz * q3;\n\n const txx = tx * q0;\n const txy = ty * q0;\n const txz = tz * q0;\n\n const tyy = ty * q1;\n const tyz = tz * q1;\n const tzz = tz * q2;\n\n dest[0] = 1.0 - (tyy + tzz);\n dest[1] = txy + twz;\n dest[2] = txz - twy;\n\n dest[4] = txy - twz;\n dest[5] = 1.0 - (txx + tzz);\n dest[6] = tyz + twx;\n\n dest[8] = txz + twy;\n dest[9] = tyz - twx;\n\n dest[10] = 1.0 - (txx + tyy);\n\n return dest;\n },\n\n quaternionToRotationMat4(q, m) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n m[0] = 1 - (yy + zz);\n m[4] = xy - wz;\n m[8] = xz + wy;\n\n m[1] = xy + wz;\n m[5] = 1 - (xx + zz);\n m[9] = yz - wx;\n\n m[2] = xz - wy;\n m[6] = yz + wx;\n m[10] = 1 - (xx + yy);\n\n // last column\n m[3] = 0;\n m[7] = 0;\n m[11] = 0;\n\n // bottom row\n m[12] = 0;\n m[13] = 0;\n m[14] = 0;\n m[15] = 1;\n\n return m;\n },\n\n normalizeQuaternion(q, dest = q) {\n const len = math.lenVec4([q[0], q[1], q[2], q[3]]);\n dest[0] = q[0] / len;\n dest[1] = q[1] / len;\n dest[2] = q[2] / len;\n dest[3] = q[3] / len;\n return dest;\n },\n\n conjugateQuaternion(q, dest = q) {\n dest[0] = -q[0];\n dest[1] = -q[1];\n dest[2] = -q[2];\n dest[3] = q[3];\n return dest;\n },\n\n inverseQuaternion(q, dest) {\n return math.normalizeQuaternion(math.conjugateQuaternion(q, dest));\n },\n\n quaternionToAngleAxis(q, angleAxis = math.vec4()) {\n q = math.normalizeQuaternion(q, tempVec4);\n const q3 = q[3];\n const angle = 2 * Math.acos(q3);\n const s = Math.sqrt(1 - q3 * q3);\n if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt\n angleAxis[0] = q[0];\n angleAxis[1] = q[1];\n angleAxis[2] = q[2];\n } else {\n angleAxis[0] = q[0] / s;\n angleAxis[1] = q[1] / s;\n angleAxis[2] = q[2] / s;\n }\n angleAxis[3] = angle; // * 57.295779579;\n return angleAxis;\n },\n\n //------------------------------------------------------------------------------------------------------------------\n // Boundaries\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Returns a new, uninitialized 3D axis-aligned bounding box.\n *\n * @private\n */\n AABB3(values) {\n return new FloatArrayType(values || 6);\n },\n\n /**\n * Returns a new, uninitialized 2D axis-aligned bounding box.\n *\n * @private\n */\n AABB2(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3D oriented bounding box (OBB).\n *\n * @private\n */\n OBB3(values) {\n return new FloatArrayType(values || 32);\n },\n\n /**\n * Returns a new, uninitialized 2D oriented bounding box (OBB).\n *\n * @private\n */\n OBB2(values) {\n return new FloatArrayType(values || 16);\n },\n\n /** Returns a new 3D bounding sphere */\n Sphere3(x, y, z, r) {\n return new FloatArrayType([x, y, z, r]);\n },\n\n /**\n * Transforms an OBB3 by a 4x4 matrix.\n *\n * @private\n */\n transformOBB3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /** Returns true if the first AABB contains the second AABB.\n * @param aabb1\n * @param aabb2\n * @returns {boolean}\n */\n containsAABB3: function (aabb1, aabb2) {\n const result = (\n aabb1[0] <= aabb2[0] && aabb2[3] <= aabb1[3] &&\n aabb1[1] <= aabb2[1] && aabb2[4] <= aabb1[4] &&\n aabb1[2] <= aabb2[2] && aabb2[5] <= aabb1[5]);\n return result;\n },\n\n /**\n * Gets the diagonal size of an AABB3 given as minima and maxima.\n *\n * @private\n */\n getAABB3Diag: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return aabb => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n math.subVec3(max, min, tempVec3);\n\n return Math.abs(math.lenVec3(tempVec3));\n };\n }))(),\n\n /**\n * Get a diagonal boundary size that is symmetrical about the given point.\n *\n * @private\n */\n getAABB3DiagPoint: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (aabb, p) => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n const diagVec = math.subVec3(max, min, tempVec3);\n\n const xneg = p[0] - aabb[0];\n const xpos = aabb[3] - p[0];\n const yneg = p[1] - aabb[1];\n const ypos = aabb[4] - p[1];\n const zneg = p[2] - aabb[2];\n const zpos = aabb[5] - p[2];\n\n diagVec[0] += (xneg > xpos) ? xneg : xpos;\n diagVec[1] += (yneg > ypos) ? yneg : ypos;\n diagVec[2] += (zneg > zpos) ? zneg : zpos;\n\n return Math.abs(math.lenVec3(diagVec));\n };\n }))(),\n\n /**\n * Gets the center of an AABB.\n *\n * @private\n */\n getAABB3Center(aabb, dest) {\n const r = dest || math.vec3();\n\n r[0] = (aabb[0] + aabb[3]) / 2;\n r[1] = (aabb[1] + aabb[4]) / 2;\n r[2] = (aabb[2] + aabb[5]) / 2;\n\n return r;\n },\n\n /**\n * Gets the center of a 2D AABB.\n *\n * @private\n */\n getAABB2Center(aabb, dest) {\n const r = dest || math.vec2();\n\n r[0] = (aabb[2] + aabb[0]) / 2;\n r[1] = (aabb[3] + aabb[1]) / 2;\n\n return r;\n },\n\n /**\n * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points.\n * Creates new AABB if none supplied.\n *\n * @private\n */\n collapseAABB3(aabb = math.AABB3()) {\n aabb[0] = math.MAX_DOUBLE;\n aabb[1] = math.MAX_DOUBLE;\n aabb[2] = math.MAX_DOUBLE;\n aabb[3] = -math.MAX_DOUBLE;\n aabb[4] = -math.MAX_DOUBLE;\n aabb[5] = -math.MAX_DOUBLE;\n\n return aabb;\n },\n\n /**\n * Converts an axis-aligned 3D boundary into an oriented boundary consisting of\n * an array of eight 3D positions, one for each corner of the boundary.\n *\n * @private\n */\n AABB3ToOBB3(aabb, obb = math.OBB3()) {\n obb[0] = aabb[0];\n obb[1] = aabb[1];\n obb[2] = aabb[2];\n obb[3] = 1;\n\n obb[4] = aabb[3];\n obb[5] = aabb[1];\n obb[6] = aabb[2];\n obb[7] = 1;\n\n obb[8] = aabb[3];\n obb[9] = aabb[4];\n obb[10] = aabb[2];\n obb[11] = 1;\n\n obb[12] = aabb[0];\n obb[13] = aabb[4];\n obb[14] = aabb[2];\n obb[15] = 1;\n\n obb[16] = aabb[0];\n obb[17] = aabb[1];\n obb[18] = aabb[5];\n obb[19] = 1;\n\n obb[20] = aabb[3];\n obb[21] = aabb[1];\n obb[22] = aabb[5];\n obb[23] = 1;\n\n obb[24] = aabb[3];\n obb[25] = aabb[4];\n obb[26] = aabb[5];\n obb[27] = 1;\n\n obb[28] = aabb[0];\n obb[29] = aabb[4];\n obb[30] = aabb[5];\n obb[31] = 1;\n\n return obb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n positions3ToAABB3: ((() => {\n\n const p = new FloatArrayType(3);\n\n return (positions, aabb, positionsDecodeMatrix) => {\n aabb = aabb || math.AABB3();\n\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n if (positionsDecodeMatrix) {\n\n p[0] = positions[i + 0];\n p[1] = positions[i + 1];\n p[2] = positions[i + 2];\n\n math.decompressPosition(p, positionsDecodeMatrix, p);\n\n x = p[0];\n y = p[1];\n z = p[2];\n\n } else {\n x = positions[i + 0];\n y = positions[i + 1];\n z = positions[i + 2];\n }\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n };\n }))(),\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n OBB3ToAABB3(obb, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = obb.length; i < len; i += 4) {\n\n x = obb[i + 0];\n y = obb[i + 1];\n z = obb[i + 2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the given 3D points.\n *\n * @private\n */\n points3ToAABB3(points, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = points.length; i < len; i++) {\n\n x = points[i][0];\n y = points[i][1];\n z = points[i][2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n points3ToSphere3: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const numPoints = points.length;\n\n for (i = 0; i < numPoints; i++) {\n x += points[i][0];\n y += points[i][1];\n z += points[i][2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < numPoints; i++) {\n\n dist = Math.abs(math.lenVec3(math.subVec3(points[i], sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D positions.\n *\n * @private\n */\n positions3ToSphere3: ((() => {\n\n const tempVec3a = new FloatArrayType(3);\n const tempVec3b = new FloatArrayType(3);\n\n return (positions, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPositions = positions.length;\n let radius = 0;\n\n for (i = 0; i < lenPositions; i += 3) {\n x += positions[i];\n y += positions[i + 1];\n z += positions[i + 2];\n }\n\n const numPositions = lenPositions / 3;\n\n sphere[0] = x / numPositions;\n sphere[1] = y / numPositions;\n sphere[2] = z / numPositions;\n\n let dist;\n\n for (i = 0; i < lenPositions; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(tempVec3a, sphere, tempVec3b)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n OBB3ToSphere3: ((() => {\n\n const point = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPoints = points.length;\n const numPoints = lenPoints / 4;\n\n for (i = 0; i < lenPoints; i += 4) {\n x += points[i + 0];\n y += points[i + 1];\n z += points[i + 2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < lenPoints; i += 4) {\n\n point[0] = points[i + 0];\n point[1] = points[i + 1];\n point[2] = points[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(point, sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Gets the center of a bounding sphere.\n *\n * @private\n */\n getSphere3Center(sphere, dest = math.vec3()) {\n dest[0] = sphere[0];\n dest[1] = sphere[1];\n dest[2] = sphere[2];\n\n return dest;\n },\n\n /**\n * Expands the first axis-aligned 3D boundary to enclose the second, if required.\n *\n * @private\n */\n expandAABB3(aabb1, aabb2) {\n\n if (aabb1[0] > aabb2[0]) {\n aabb1[0] = aabb2[0];\n }\n\n if (aabb1[1] > aabb2[1]) {\n aabb1[1] = aabb2[1];\n }\n\n if (aabb1[2] > aabb2[2]) {\n aabb1[2] = aabb2[2];\n }\n\n if (aabb1[3] < aabb2[3]) {\n aabb1[3] = aabb2[3];\n }\n\n if (aabb1[4] < aabb2[4]) {\n aabb1[4] = aabb2[4];\n }\n\n if (aabb1[5] < aabb2[5]) {\n aabb1[5] = aabb2[5];\n }\n\n return aabb1;\n },\n\n /**\n * Expands an axis-aligned 3D boundary to enclose the given point, if needed.\n *\n * @private\n */\n expandAABB3Point3(aabb, p) {\n\n if (aabb[0] > p[0]) {\n aabb[0] = p[0];\n }\n\n if (aabb[1] > p[1]) {\n aabb[1] = p[1];\n }\n\n if (aabb[2] > p[2]) {\n aabb[2] = p[2];\n }\n\n if (aabb[3] < p[0]) {\n aabb[3] = p[0];\n }\n\n if (aabb[4] < p[1]) {\n aabb[4] = p[1];\n }\n\n if (aabb[5] < p[2]) {\n aabb[5] = p[2];\n }\n\n return aabb;\n },\n\n /**\n * Calculates the normal vector of a triangle.\n *\n * @private\n */\n triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n }\n};\n\nexport {math};","import {math} from \"../../lib/math.js\";\n\nfunction quantizePositions (positions, lenPositions, aabb, quantizedPositions) {\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n const xMultiplier = maxInt / xwid;\n const yMultiplier = maxInt / ywid;\n const zMultiplier = maxInt / zwid;\n const verify = (num) => num >= 0 ? num : 0;\n for (let i = 0; i < lenPositions; i += 3) {\n quantizedPositions[i + 0] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 0] - xmin) * xMultiplier)));\n quantizedPositions[i + 1] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 1] - ymin) * yMultiplier)));\n quantizedPositions[i + 2] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 2] - zmin) * zMultiplier)));\n }\n}\n\nfunction compressPosition(p, aabb, q) {\n const multiplier = new Float32Array([\n aabb[3] !== aabb[0] ? 65535 / (aabb[3] - aabb[0]) : 0,\n aabb[4] !== aabb[1] ? 65535 / (aabb[4] - aabb[1]) : 0,\n aabb[5] !== aabb[2] ? 65535 / (aabb[5] - aabb[2]) : 0\n ]);\n q[0] = Math.max(0, Math.min(65535, Math.floor((p[0] - aabb[0]) * multiplier[0])));\n q[1] = Math.max(0, Math.min(65535, Math.floor((p[1] - aabb[1]) * multiplier[1])));\n q[2] = Math.max(0, Math.min(65535, Math.floor((p[2] - aabb[2]) * multiplier[2])));\n}\n\nvar createPositionsDecodeMatrix = (function () {\n const translate = math.mat4();\n const scale = math.mat4();\n return function (aabb, positionsDecodeMatrix) {\n positionsDecodeMatrix = positionsDecodeMatrix || math.mat4();\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n math.identityMat4(translate);\n math.translationMat4v(aabb, translate);\n math.identityMat4(scale);\n math.scalingMat4v([xwid / maxInt, ywid / maxInt, zwid / maxInt], scale);\n math.mulMat4(translate, scale, positionsDecodeMatrix);\n return positionsDecodeMatrix;\n };\n})();\n\nfunction transformAndOctEncodeNormals(modelNormalMatrix, normals, lenNormals, compressedNormals, lenCompressedNormals) {\n // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n let i, ei;\n let localNormal = math.vec3();\n let worldNormal = math.vec3();\n for (i = 0; i < lenNormals; i += 3) {\n localNormal[0] = normals[i];\n localNormal[1] = normals[i + 1];\n localNormal[2] = normals[i + 2];\n\n math.transformVec3(modelNormalMatrix, localNormal, worldNormal);\n math.normalizeVec3(worldNormal, worldNormal);\n\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(worldNormal, 0, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(worldNormal, 0, dec);\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\nfunction octEncodeNormals(normals, lenNormals, compressedNormals, lenCompressedNormals) { // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n for (let i = 0; i < lenNormals; i += 3) {\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(normals, i, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(normals, i, dec);\n oct = octEncodeVec3(normals, i, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\n/**\n * @private\n */\nfunction octEncodeVec3(array, i, xfunc, yfunc) { // Oct-encode single normal vector in 2 bytes\n let x = array[i] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n let y = array[i + 1] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n if (array[i + 2] < 0) {\n let tempx = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n let tempy = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n x = tempx;\n y = tempy;\n }\n return new Int8Array([\n Math[xfunc](x * 127.5 + (x < 0 ? -1 : 0)),\n Math[yfunc](y * 127.5 + (y < 0 ? -1 : 0))\n ]);\n}\n\n/**\n * Decode an oct-encoded normal\n */\nfunction octDecodeVec2(oct) {\n let x = oct[0];\n let y = oct[1];\n x /= x < 0 ? 127 : 128;\n y /= y < 0 ? 127 : 128;\n const z = 1 - Math.abs(x) - Math.abs(y);\n if (z < 0) {\n x = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n y = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n }\n const length = Math.sqrt(x * x + y * y + z * z);\n return [\n x / length,\n y / length,\n z / length\n ];\n}\n\n/**\n * Dot product of a normal in an array against a candidate decoding\n * @private\n */\nfunction dot(array, i, vec3) {\n return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2];\n}\n\n/**\n * @private\n */\nconst geometryCompression = {\n quantizePositions,\n compressPosition,\n createPositionsDecodeMatrix,\n transformAndOctEncodeNormals,\n octEncodeNormals,\n};\n\nexport {geometryCompression}","/*----------------------------------------------------------------------------------------------------------------------\n * NOTE: The values of these constants must match those within xeokit-sdk\n *--------------------------------------------------------------------------------------------------------------------*/\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity.\n */\nexport const RepeatWrapping = 1000;\n\n/**\n * Texture wrapping mode in which the last pixel of the texture stretches to the edge of the mesh.\n */\nexport const ClampToEdgeWrapping = 1001;\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity, mirroring on each repeat.\n */\nexport const MirroredRepeatWrapping = 1002;\n\n/**\n * Texture magnification and minification filter that returns the nearest texel to the given sample coordinates.\n */\nexport const NearestFilter = 1003;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipMapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured\n * and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipmapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipmapLinearFilter = 1005;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipMapLinearFilter = 1005;\n\n/**\n * Texture magnification and minification filter that returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearFilter = 1006;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipmapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipMapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipmapLinearFilter = 1008;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipMapLinearFilter = 1008;\n\n/**\n * Media type for GIF images.\n */\nexport const GIFMediaType = 10000;\n\n/**\n * Media type for JPEG images.\n */\nexport const JPEGMediaType = 10001;\n\n/**\n * Media type for PNG images.\n */\nexport const PNGMediaType = 10002;","import {math} from \"../../lib/math.js\";\n\n/**\n * @private\n */\nconst buildEdgeIndices = (function () {\n\n const uniquePositions = [];\n const indicesLookup = [];\n const indicesReverseLookup = [];\n const weldedIndices = [];\n\n// TODO: Optimize with caching, but need to cater to both compressed and uncompressed positions\n\n const faces = [];\n let numFaces = 0;\n const compa = new Uint16Array(3);\n const compb = new Uint16Array(3);\n const compc = new Uint16Array(3);\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n const cb = math.vec3();\n const ab = math.vec3();\n const cross = math.vec3();\n const normal = math.vec3();\n const inverseNormal = math.vec3();\n\n function weldVertices(positions, indices) {\n const positionsMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique)\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = Math.pow(10, precisionPoints);\n let i;\n let len;\n let lenUniquePositions = 0;\n for (i = 0, len = positions.length; i < len; i += 3) {\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n key = Math.round(vx * precision) + '_' + Math.round(vy * precision) + '_' + Math.round(vz * precision);\n if (positionsMap[key] === undefined) {\n positionsMap[key] = lenUniquePositions / 3;\n uniquePositions[lenUniquePositions++] = vx;\n uniquePositions[lenUniquePositions++] = vy;\n uniquePositions[lenUniquePositions++] = vz;\n }\n indicesLookup[i / 3] = positionsMap[key];\n }\n for (i = 0, len = indices.length; i < len; i++) {\n weldedIndices[i] = indicesLookup[indices[i]];\n indicesReverseLookup[weldedIndices[i]] = indices[i];\n }\n }\n\n function buildFaces(numIndices, positionsDecodeMatrix) {\n numFaces = 0;\n for (let i = 0, len = numIndices; i < len; i += 3) {\n const ia = ((weldedIndices[i]) * 3);\n const ib = ((weldedIndices[i + 1]) * 3);\n const ic = ((weldedIndices[i + 2]) * 3);\n if (positionsDecodeMatrix) {\n compa[0] = uniquePositions[ia];\n compa[1] = uniquePositions[ia + 1];\n compa[2] = uniquePositions[ia + 2];\n compb[0] = uniquePositions[ib];\n compb[1] = uniquePositions[ib + 1];\n compb[2] = uniquePositions[ib + 2];\n compc[0] = uniquePositions[ic];\n compc[1] = uniquePositions[ic + 1];\n compc[2] = uniquePositions[ic + 2];\n // Decode\n math.decompressPosition(compa, positionsDecodeMatrix, a);\n math.decompressPosition(compb, positionsDecodeMatrix, b);\n math.decompressPosition(compc, positionsDecodeMatrix, c);\n } else {\n a[0] = uniquePositions[ia];\n a[1] = uniquePositions[ia + 1];\n a[2] = uniquePositions[ia + 2];\n b[0] = uniquePositions[ib];\n b[1] = uniquePositions[ib + 1];\n b[2] = uniquePositions[ib + 2];\n c[0] = uniquePositions[ic];\n c[1] = uniquePositions[ic + 1];\n c[2] = uniquePositions[ic + 2];\n }\n math.subVec3(c, b, cb);\n math.subVec3(a, b, ab);\n math.cross3Vec3(cb, ab, cross);\n math.normalizeVec3(cross, normal);\n const face = faces[numFaces] || (faces[numFaces] = {normal: math.vec3()});\n face.normal[0] = normal[0];\n face.normal[1] = normal[1];\n face.normal[2] = normal[2];\n numFaces++;\n }\n }\n\n return function (positions, indices, positionsDecodeMatrix, edgeThreshold) {\n weldVertices(positions, indices);\n buildFaces(indices.length, positionsDecodeMatrix);\n const edgeIndices = [];\n const thresholdDot = Math.cos(math.DEGTORAD * edgeThreshold);\n const edges = {};\n let edge1;\n let edge2;\n let index1;\n let index2;\n let key;\n let largeIndex = false;\n let edge;\n let normal1;\n let normal2;\n let dot;\n let ia;\n let ib;\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const faceIndex = i / 3;\n for (let j = 0; j < 3; j++) {\n edge1 = weldedIndices[i + j];\n edge2 = weldedIndices[i + ((j + 1) % 3)];\n index1 = Math.min(edge1, edge2);\n index2 = Math.max(edge1, edge2);\n key = index1 + ',' + index2;\n if (edges[key] === undefined) {\n edges[key] = {\n index1: index1,\n index2: index2,\n face1: faceIndex,\n face2: undefined,\n };\n } else {\n edges[key].face2 = faceIndex;\n }\n }\n }\n for (key in edges) {\n edge = edges[key];\n // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.\n if (edge.face2 !== undefined) {\n normal1 = faces[edge.face1].normal;\n normal2 = faces[edge.face2].normal;\n inverseNormal[0] = -normal2[0];\n inverseNormal[1] = -normal2[1];\n inverseNormal[2] = -normal2[2];\n dot = Math.abs(math.dotVec3(normal1, normal2));\n const dot2 = Math.abs(math.dotVec3(normal1, inverseNormal));\n if (dot > thresholdDot && dot2 > thresholdDot) {\n continue;\n }\n }\n ia = indicesReverseLookup[edge.index1];\n ib = indicesReverseLookup[edge.index2];\n if (!largeIndex && ia > 65535 || ib > 65535) {\n largeIndex = true;\n }\n edgeIndices.push(ia);\n edgeIndices.push(ib);\n }\n return (largeIndex) ? new Uint32Array(edgeIndices) : new Uint16Array(edgeIndices);\n };\n})();\n\n\nexport {buildEdgeIndices};","/**\n * Uses edge adjacency counts to identify if the given triangle mesh can be rendered with backface culling enabled.\n *\n * If all edges are connected to exactly two triangles, then the mesh will likely be a closed solid, and we can safely\n * render it with backface culling enabled.\n *\n * Otherwise, the mesh is a surface, and we must render it with backface culling disabled.\n *\n * @private\n */\nconst isTriangleMeshSolid = (indices, positions, vertexIndexMapping, edges) => {\n\n function compareIndexPositions(a, b)\n {\n let posA, posB;\n\n for (let i = 0; i < 3; i++) {\n posA = positions [a*3+i];\n posB = positions [b*3+i];\n\n if (posA !== posB) {\n return posB - posA;\n }\n }\n\n return 0;\n };\n\n // Group together indices corresponding to same position coordinates\n let newIndices = indices.slice ().sort (compareIndexPositions);\n\n // Calculate the mapping:\n // - from original index in indices array\n // - to indices-for-unique-positions\n let uniqueVertexIndex = null;\n\n for (let i = 0, len = newIndices.length; i < len; i++) {\n if (i == 0 || 0 != compareIndexPositions (\n newIndices[i],\n newIndices[i-1],\n )) {\n // different position\n uniqueVertexIndex = newIndices [i];\n }\n\n vertexIndexMapping [\n newIndices[i]\n ] = uniqueVertexIndex;\n }\n\n // Generate the list of edges\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const a = vertexIndexMapping[indices[i]];\n const b = vertexIndexMapping[indices[i+1]];\n const c = vertexIndexMapping[indices[i+2]];\n\n let a2 = a;\n let b2 = b;\n let c2 = c;\n\n if (a > b && a > c) {\n if (b > c) {\n a2 = a;\n b2 = b;\n c2 = c;\n } else {\n a2 = a;\n b2 = c;\n c2 = b;\n }\n } else if (b > a && b > c) {\n if (a > c) {\n a2 = b;\n b2 = a;\n c2 = c;\n } else {\n a2 = b;\n b2 = c;\n c2 = a;\n }\n } else if (c > a && c > b) {\n if (a > b) {\n a2 = c;\n b2 = a;\n c2 = b;\n } else {\n a2 = c;\n b2 = b;\n c2 = a;\n }\n }\n\n edges[i+0] = [\n a2, b2\n ];\n edges[i+1] = [\n b2, c2\n ];\n\n if (a2 > c2) {\n const temp = c2;\n c2 = a2;\n a2 = temp;\n }\n\n edges[i+2] = [\n c2, a2\n ];\n }\n\n // Group semantically equivalent edgdes together\n function compareEdges (e1, e2) {\n let a, b;\n\n for (let i = 0; i < 2; i++) {\n a = e1[i];\n b = e2[i];\n\n if (b !== a) {\n return b - a;\n }\n }\n\n return 0;\n }\n\n edges = edges.slice(0, indices.length);\n\n edges.sort (compareEdges);\n\n // Make sure each edge is used exactly twice\n let sameEdgeCount = 0;\n\n for (let i = 0; i < edges.length; i++)\n {\n if (i === 0 || 0 !== compareEdges (\n edges[i], edges[i-1]\n )) {\n // different edge\n if (0 !== i && sameEdgeCount !== 2)\n {\n return false;\n }\n\n sameEdgeCount = 1;\n }\n else\n {\n // same edge\n sameEdgeCount++;\n }\n }\n\n if (edges.length > 0 && sameEdgeCount !== 2)\n {\n return false;\n }\n\n // Each edge is used exactly twice, this is a\n // watertight surface and hence a solid geometry.\n return true;\n};\n\nexport {isTriangleMeshSolid};","/**\n * Represents the usage of a {@link XKTGeometry} by an {@link XKTEntity}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTEntity#meshes} and {@link XKTModel#meshesList}\n * * Has an {@link XKTGeometry}, and an optional {@link XKTTextureSet}, both of which it can share with other {@link XKTMesh}es\n * * Has {@link XKTMesh#color}, {@link XKTMesh#opacity}, {@link XKTMesh#metallic} and {@link XKTMesh#roughness} PBR attributes\n * @class XKTMesh\n */\nclass XKTMesh {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTMesh in {@link XKTModel#meshes}.\n *\n * @type {Number}\n */\n this.meshId = cfg.meshId;\n\n /**\n * Index of this XKTMesh in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.meshIndex = cfg.meshIndex;\n\n /**\n * The 4x4 modeling transform matrix.\n *\n * Transform is relative to the center of the {@link XKTTile} that contains this XKTMesh's {@link XKTEntity},\n * which is given in {@link XKTMesh#entity}.\n *\n * When the ````XKTEntity```` shares its {@link XKTGeometry}s with other ````XKTEntity````s, this matrix is used\n * to transform this XKTMesh's XKTGeometry into World-space. When this XKTMesh does not share its ````XKTGeometry````,\n * then this matrix is ignored.\n *\n * @type {Number[]}\n */\n this.matrix = cfg.matrix;\n\n /**\n * The instanced {@link XKTGeometry}.\n *\n * @type {XKTGeometry}\n */\n this.geometry = cfg.geometry;\n\n /**\n * RGB color of this XKTMesh.\n *\n * @type {Float32Array}\n */\n this.color = cfg.color || new Float32Array([1, 1, 1]);\n\n /**\n * PBR metallness of this XKTMesh.\n *\n * @type {Number}\n */\n this.metallic = (cfg.metallic !== null && cfg.metallic !== undefined) ? cfg.metallic : 0;\n\n /**\n * PBR roughness of this XKTMesh.\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {Number}\n * @type {XKTTextureSet}\n */\n this.roughness = (cfg.roughness !== null && cfg.roughness !== undefined) ? cfg.roughness : 1;\n\n /**\n * Opacity of this XKTMesh.\n *\n * @type {Number}\n */\n this.opacity = (cfg.opacity !== undefined && cfg.opacity !== null) ? cfg.opacity : 1.0;\n\n /**\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {XKTTextureSet}\n */\n this.textureSet = cfg.textureSet;\n\n /**\n * The owner {@link XKTEntity}.\n *\n * Set by {@link XKTModel#createEntity}.\n *\n * @type {XKTEntity}\n */\n this.entity = null; // Set after instantiation, when the Entity is known\n }\n}\n\nexport {XKTMesh};","/**\n * An element of reusable geometry within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createGeometry}\n * * Stored in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}\n * * Referenced by {@link XKTMesh}s, which belong to {@link XKTEntity}s\n *\n * @class XKTGeometry\n */\nclass XKTGeometry {\n\n /**\n * @private\n * @param {*} cfg Configuration for the XKTGeometry.\n * @param {Number} cfg.geometryId Unique ID of the geometry in {@link XKTModel#geometries}.\n * @param {String} cfg.primitiveType Type of this geometry - \"triangles\", \"points\" or \"lines\" so far.\n * @param {Number} cfg.geometryIndex Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n * @param {Float64Array} cfg.positions Non-quantized 3D vertex positions.\n * @param {Float32Array} cfg.normals Non-compressed vertex normals.\n * @param {Uint8Array} cfg.colorsCompressed Unsigned 8-bit integer RGBA vertex colors.\n * @param {Float32Array} cfg.uvs Non-compressed vertex UV coordinates.\n * @param {Uint32Array} cfg.indices Indices to organize the vertex positions and normals into triangles.\n * @param {Uint32Array} cfg.edgeIndices Indices to organize the vertex positions into edges.\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTGeometry in {@link XKTModel#geometries}.\n *\n * @type {Number}\n */\n this.geometryId = cfg.geometryId;\n\n /**\n * The type of primitive - \"triangles\" | \"points\" | \"lines\".\n *\n * @type {String}\n */\n this.primitiveType = cfg.primitiveType;\n\n /**\n * Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n *\n * @type {Number}\n */\n this.geometryIndex = cfg.geometryIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTGeometry.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * Non-quantized 3D vertex positions.\n *\n * Defined for all primitive types.\n *\n * @type {Float64Array}\n */\n this.positions = cfg.positions;\n\n /**\n * Quantized vertex positions.\n *\n * Defined for all primitive types.\n *\n * This array is later created from {@link XKTGeometry#positions} by {@link XKTModel#finalize}.\n *\n * @type {Uint16Array}\n */\n this.positionsQuantized = new Uint16Array(cfg.positions.length);\n\n /**\n * Non-compressed 3D vertex normals.\n *\n * Defined only for triangle primitives. Can be null if we want xeokit to auto-generate them. Ignored for points and lines.\n *\n * @type {Float32Array}\n */\n this.normals = cfg.normals;\n\n /**\n * Compressed vertex normals.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * This array is later created from {@link XKTGeometry#normals} by {@link XKTModel#finalize}.\n *\n * Will be null if {@link XKTGeometry#normals} is also null.\n *\n * @type {Int8Array}\n */\n this.normalsOctEncoded = null;\n\n /**\n * Compressed RGBA vertex colors.\n *\n * Defined only for point primitives. Ignored for triangles and lines.\n *\n * @type {Uint8Array}\n */\n this.colorsCompressed = cfg.colorsCompressed;\n\n /**\n * Non-compressed vertex UVs.\n *\n * @type {Float32Array}\n */\n this.uvs = cfg.uvs;\n\n /**\n * Compressed vertex UVs.\n *\n * @type {Uint16Array}\n */\n this.uvsCompressed = cfg.uvsCompressed;\n\n /**\n * Indices that organize the vertex positions and normals as triangles.\n *\n * Defined only for triangle and lines primitives. Ignored for points.\n *\n * @type {Uint32Array}\n */\n this.indices = cfg.indices;\n\n /**\n * Indices that organize the vertex positions as edges.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * @type {Uint32Array}\n */\n this.edgeIndices = cfg.edgeIndices;\n\n /**\n * When {@link XKTGeometry#primitiveType} is \"triangles\", this is ````true```` when this geometry is a watertight mesh.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.solid = false;\n }\n\n /**\n * Convenience property that is ````true```` when {@link XKTGeometry#numInstances} is greater that one.\n * @returns {boolean}\n */\n get reused() {\n return (this.numInstances > 1);\n }\n}\n\nexport {XKTGeometry};","import {math} from \"../lib/math.js\";\n\n/**\n * An object within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTModel#entities} and {@link XKTModel#entitiesList}\n * * Has one or more {@link XKTMesh}s, each having an {@link XKTGeometry}\n *\n * @class XKTEntity\n */\nclass XKTEntity {\n\n /**\n * @private\n * @param entityId\n * @param meshes\n */\n constructor(entityId, meshes) {\n\n /**\n * Unique ID of this ````XKTEntity```` in {@link XKTModel#entities}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * We can also use {@link XKTModel#createMetaObject} to create an {@link XKTMetaObject} to specify metadata for\n * this ````XKTEntity````. To associate the {@link XKTMetaObject} with our {@link XKTEntity}, we give\n * {@link XKTMetaObject#metaObjectId} the same value as {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.entityId = entityId;\n\n /**\n * Index of this ````XKTEntity```` in {@link XKTModel#entitiesList}.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Number}\n */\n this.entityIndex = null;\n\n /**\n * A list of {@link XKTMesh}s that indicate which {@link XKTGeometry}s are used by this Entity.\n *\n * @type {XKTMesh[]}\n */\n this.meshes = meshes;\n\n /**\n * World-space axis-aligned bounding box (AABB) that encloses the {@link XKTGeometry#positions} of\n * the {@link XKTGeometry}s that are used by this ````XKTEntity````.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Float32Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this ````XKTEntity```` shares {@link XKTGeometry}s with other {@link XKTEntity}'s.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * Note that when an ````XKTEntity```` shares ````XKTGeometrys````, it shares **all** of its ````XKTGeometrys````. An ````XKTEntity````\n * never shares only some of its ````XKTGeometrys```` - it always shares either the whole set or none at all.\n *\n * @type {Boolean}\n */\n this.hasReusedGeometries = false;\n }\n}\n\nexport {XKTEntity};","/**\n * @desc A box-shaped 3D region within an {@link XKTModel} that contains {@link XKTEntity}s.\n *\n * * Created by {@link XKTModel#finalize}\n * * Stored in {@link XKTModel#tilesList}\n *\n * @class XKTTile\n */\nclass XKTTile {\n\n /**\n * Creates a new XKTTile.\n *\n * @private\n * @param aabb\n * @param entities\n */\n constructor(aabb, entities) {\n\n /**\n * Axis-aligned World-space bounding box that encloses the {@link XKTEntity}'s within this Tile.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}'s within this XKTTile.\n *\n * @type {XKTEntity[]}\n */\n this.entities = entities;\n }\n}\n\nexport {XKTTile};","/**\n * A kd-Tree node, used internally by {@link XKTModel}.\n *\n * @private\n */\nclass KDNode {\n\n /**\n * Create a KDNode with an axis-aligned 3D World-space boundary.\n */\n constructor(aabb) {\n\n /**\n * The axis-aligned 3D World-space boundary of this KDNode.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}s within this KDNode.\n */\n this.entities = null;\n\n /**\n * The left child KDNode.\n */\n this.left = null;\n\n /**\n * The right child KDNode.\n */\n this.right = null;\n }\n}\n\nexport {KDNode};","/**\n * A meta object within an {@link XKTModel}.\n *\n * These are plugged together into a parent-child hierarchy to represent structural\n * metadata for the {@link XKTModel}.\n *\n * The leaf XKTMetaObjects are usually associated with\n * an {@link XKTEntity}, which they do so by sharing the same ID,\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * * Created by {@link XKTModel#createMetaObject}\n * * Stored in {@link XKTModel#metaObjects} and {@link XKTModel#metaObjectsList}\n * * Has an ID, a type, and a human-readable name\n * * May have a parent {@link XKTMetaObject}\n * * When no children, is usually associated with an {@link XKTEntity}\n *\n * @class XKTMetaObject\n */\nclass XKTMetaObject {\n\n /**\n * @private\n * @param metaObjectId\n * @param propertySetIds\n * @param metaObjectType\n * @param metaObjectName\n * @param parentMetaObjectId\n */\n constructor(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId) {\n\n /**\n * Unique ID of this ````XKTMetaObject```` in {@link XKTModel#metaObjects}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * If this is a leaf XKTMetaObject, where it is not a parent to any other XKTMetaObject,\n * then this will be equal to the ID of an {@link XKTEntity} in {@link XKTModel#entities},\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.metaObjectId = metaObjectId;\n\n /**\n * Unique ID of one or more property sets that contains additional metadata about this\n * {@link XKTMetaObject}. The property sets can be stored in an external system, or\n * within the {@link XKTModel}, as {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n *\n * @type {String[]}\n */\n this.propertySetIds = propertySetIds;\n\n /**\n * Indicates the XKTMetaObject meta object type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.metaObjectType = metaObjectType;\n\n /**\n * Indicates the XKTMetaObject meta object name.\n *\n * This defaults to {@link XKTMetaObject#metaObjectId}.\n *\n * @type {string}\n */\n this.metaObjectName = metaObjectName;\n\n /**\n * The parent XKTMetaObject, if any.\n *\n * Will be null if there is no parent.\n *\n * @type {String}\n */\n this.parentMetaObjectId = parentMetaObjectId;\n }\n}\n\nexport {XKTMetaObject};","/**\n * A property set within an {@link XKTModel}.\n *\n * These are shared among {@link XKTMetaObject}s.\n *\n * * Created by {@link XKTModel#createPropertySet}\n * * Stored in {@link XKTModel#propertySets} and {@link XKTModel#propertySetsList}\n * * Has an ID, a type, and a human-readable name\n *\n * @class XKTPropertySet\n */\nclass XKTPropertySet {\n\n /**\n * @private\n */\n constructor(propertySetId, propertySetType, propertySetName, properties) {\n\n /**\n * Unique ID of this ````XKTPropertySet```` in {@link XKTModel#propertySets}.\n *\n * @type {String}\n */\n this.propertySetId = propertySetId;\n\n /**\n * Indicates the ````XKTPropertySet````'s type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.propertySetType = propertySetType;\n\n /**\n * Indicates the XKTPropertySet meta object name.\n *\n * This defaults to {@link XKTPropertySet#propertySetId}.\n *\n * @type {string}\n */\n this.propertySetName = propertySetName;\n\n /**\n * The properties within this ````XKTPropertySet````.\n *\n * @type {*[]}\n */\n this.properties = properties;\n }\n}\n\nexport {XKTPropertySet};","/**\n * A texture shared by {@link XKTTextureSet}s.\n *\n * * Created by {@link XKTModel#createTexture}\n * * Stored in {@link XKTTextureSet#textures}, {@link XKTModel#textures} and {@link XKTModel#texturesList}\n *\n * @class XKTTexture\n */\nimport {RepeatWrapping, LinearMipMapNearestFilter} from \"../constants\";\n\nclass XKTTexture {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTexture in {@link XKTModel#textures}.\n *\n * @type {Number}\n */\n this.textureId = cfg.textureId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureIndex = cfg.textureIndex;\n\n /**\n * Texture image data.\n *\n * @type {Buffer}\n */\n this.imageData = cfg.imageData;\n\n /**\n * Which material channel this texture is applied to, as determined by its {@link XKTTextureSet}s.\n *\n * @type {Number}\n */\n this.channel = null;\n\n /**\n * Width of this XKTTexture.\n *\n * @type {Number}\n */\n this.width = cfg.width;\n\n /**\n * Height of this XKTTexture.\n *\n * @type {Number}\n */\n this.height = cfg.height;\n\n /**\n * Texture file source.\n *\n * @type {String}\n */\n this.src = cfg.src;\n\n /**\n * Whether this XKTTexture is to be compressed.\n *\n * @type {Boolean}\n */\n this.compressed = (!!cfg.compressed);\n\n /**\n * Media type of this XKTTexture.\n *\n * Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.mediaType = cfg.mediaType;\n\n /**\n * How the texture is sampled when a texel covers less than one pixel. Supported values\n * are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter},\n * {@link NearestMipMapNearestFilter}, {@link NearestMipMapLinearFilter}\n * and {@link LinearMipMapLinearFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.minFilter = cfg.minFilter || LinearMipMapNearestFilter;\n\n /**\n * How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.magFilter = cfg.magFilter || LinearMipMapNearestFilter;\n\n /**\n * S wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapS = cfg.wrapS || RepeatWrapping;\n\n /**\n * T wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapT = cfg.wrapT || RepeatWrapping;\n\n /**\n * R wrapping mode.\n *\n * Ignored for compressed textures.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * @type {*|number}\n */\n this.wrapR = cfg.wrapR || RepeatWrapping\n }\n}\n\nexport {XKTTexture};","/**\n * A set of textures shared by {@link XKTMesh}es.\n *\n * * Created by {@link XKTModel#createTextureSet}\n * * Registered in {@link XKTMesh#material}, {@link XKTModel#materials} and {@link XKTModel#.textureSetsList}\n *\n * @class XKTMetalRoughMaterial\n */\nclass XKTTextureSet {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTextureSet in {@link XKTModel#materials}.\n *\n * @type {Number}\n */\n this.textureSetId = cfg.textureSetId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureSetIndex = cfg.textureSetIndex;\n\n /**\n * Identifies the material type.\n *\n * @type {Number}\n */\n this.materialType = cfg.materialType;\n\n /**\n * Index of this XKTTextureSet in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.materialIndex = cfg.materialIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTTextureSet.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * RGBA {@link XKTTexture} containing base color in RGB and opacity in A.\n *\n * @type {XKTTexture}\n */\n this.colorTexture = cfg.colorTexture;\n\n /**\n * RGBA {@link XKTTexture} containing metallic and roughness factors in R and G.\n *\n * @type {XKTTexture}\n */\n this.metallicRoughnessTexture = cfg.metallicRoughnessTexture;\n\n /**\n * RGBA {@link XKTTexture} with surface normals in RGB.\n *\n * @type {XKTTexture}\n */\n this.normalsTexture = cfg.normalsTexture;\n\n /**\n * RGBA {@link XKTTexture} with emissive color in RGB.\n *\n * @type {XKTTexture}\n */\n this.emissiveTexture = cfg.emissiveTexture;\n\n /**\n * RGBA {@link XKTTexture} with ambient occlusion factors in RGB.\n *\n * @type {XKTTexture}\n */\n this.occlusionTexture = cfg.occlusionTexture;\n }\n}\n\nexport {XKTTextureSet};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/textures\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/images\");","import {math} from \"../lib/math.js\";\nimport {geometryCompression} from \"./lib/geometryCompression.js\";\nimport {buildEdgeIndices} from \"./lib/buildEdgeIndices.js\";\nimport {isTriangleMeshSolid} from \"./lib/isTriangleMeshSolid.js\";\n\nimport {XKTMesh} from './XKTMesh.js';\nimport {XKTGeometry} from './XKTGeometry.js';\nimport {XKTEntity} from './XKTEntity.js';\nimport {XKTTile} from './XKTTile.js';\nimport {KDNode} from \"./KDNode.js\";\nimport {XKTMetaObject} from \"./XKTMetaObject.js\";\nimport {XKTPropertySet} from \"./XKTPropertySet.js\";\nimport {mergeVertices} from \"../lib/mergeVertices.js\";\nimport {XKT_INFO} from \"../XKT_INFO.js\";\nimport {XKTTexture} from \"./XKTTexture\";\nimport {XKTTextureSet} from \"./XKTTextureSet\";\nimport {encode, load} from \"@loaders.gl/core\";\nimport {KTX2BasisWriter} from \"@loaders.gl/textures\";\nimport {ImageLoader} from '@loaders.gl/images';\n\nconst tempVec4a = math.vec4([0, 0, 0, 1]);\nconst tempVec4b = math.vec4([0, 0, 0, 1]);\n\nconst tempMat4 = math.mat4();\nconst tempMat4b = math.mat4();\n\nconst kdTreeDimLength = new Float64Array(3);\n\n// XKT texture types\n\nconst COLOR_TEXTURE = 0;\nconst METALLIC_ROUGHNESS_TEXTURE = 1;\nconst NORMALS_TEXTURE = 2;\nconst EMISSIVE_TEXTURE = 3;\nconst OCCLUSION_TEXTURE = 4;\n\n// KTX2 encoding options for each texture type\n\nconst TEXTURE_ENCODING_OPTIONS = {}\nTEXTURE_ENCODING_OPTIONS[COLOR_TEXTURE] = {\n useSRGB: true,\n qualityLevel: 50,\n encodeUASTC: true,\n mipmaps: true\n};\nTEXTURE_ENCODING_OPTIONS[EMISSIVE_TEXTURE] = {\n useSRGB: true,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[METALLIC_ROUGHNESS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 50,\n mipmaps: true // Needed for GGX roughness shading\n};\nTEXTURE_ENCODING_OPTIONS[NORMALS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[OCCLUSION_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\n\n/**\n * A document model that represents the contents of an .XKT file.\n *\n * * An XKTModel contains {@link XKTTile}s, which spatially subdivide the model into axis-aligned, box-shaped regions.\n * * Each {@link XKTTile} contains {@link XKTEntity}s, which represent the objects within its region.\n * * Each {@link XKTEntity} has {@link XKTMesh}s, which each have a {@link XKTGeometry}. Each {@link XKTGeometry} can be shared by multiple {@link XKTMesh}s.\n * * Import models into an XKTModel using {@link parseGLTFJSONIntoXKTModel}, {@link parseIFCIntoXKTModel}, {@link parseCityJSONIntoXKTModel} etc.\n * * Build an XKTModel programmatically using {@link XKTModel#createGeometry}, {@link XKTModel#createMesh} and {@link XKTModel#createEntity}.\n * * Serialize an XKTModel to an ArrayBuffer using {@link writeXKTModelToArrayBuffer}.\n *\n * ## Usage\n *\n * See [main docs page](/docs/#javascript-api) for usage examples.\n *\n * @class XKTModel\n */\nclass XKTModel {\n\n /**\n * Constructs a new XKTModel.\n *\n * @param {*} [cfg] Configuration\n * @param {Number} [cfg.edgeThreshold=10]\n * @param {Number} [cfg.minTileSize=500]\n */\n constructor(cfg = {}) {\n\n /**\n * The model's ID, if available.\n *\n * Will be \"default\" by default.\n *\n * @type {String}\n */\n this.modelId = cfg.modelId || \"default\";\n\n /**\n * The project ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.projectId = cfg.projectId || \"\";\n\n /**\n * The revision ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.revisionId = cfg.revisionId || \"\";\n\n /**\n * The model author, if available.\n *\n * Will be an empty string by default.\n *\n * @property author\n * @type {String}\n */\n this.author = cfg.author || \"\";\n\n /**\n * The date the model was created, if available.\n *\n * Will be an empty string by default.\n *\n * @property createdAt\n * @type {String}\n */\n this.createdAt = cfg.createdAt || \"\";\n\n /**\n * The application that created the model, if available.\n *\n * Will be an empty string by default.\n *\n * @property creatingApplication\n * @type {String}\n */\n this.creatingApplication = cfg.creatingApplication || \"\";\n\n /**\n * The model schema version, if available.\n *\n * In the case of IFC, this could be \"IFC2x3\" or \"IFC4\", for example.\n *\n * Will be an empty string by default.\n *\n * @property schema\n * @type {String}\n */\n this.schema = cfg.schema || \"\";\n\n /**\n * The XKT format version.\n *\n * @property xktVersion;\n * @type {number}\n */\n this.xktVersion = XKT_INFO.xktVersion;\n\n /**\n *\n * @type {Number|number}\n */\n this.edgeThreshold = cfg.edgeThreshold || 10;\n\n /**\n * Minimum diagonal size of the boundary of an {@link XKTTile}.\n *\n * @type {Number|number}\n */\n this.minTileSize = cfg.minTileSize || 500;\n\n /**\n * Optional overall AABB that contains all the {@link XKTEntity}s we'll create in this model, if previously known.\n *\n * This is the AABB of a complete set of input files that are provided as a split-model set for conversion.\n *\n * This is used to help the {@link XKTTile.aabb}s within split models align neatly with each other, as we\n * build them with a k-d tree in {@link XKTModel#finalize}. Without this, the AABBs of the different parts\n * tend to misalign slightly, resulting in excess number of {@link XKTTile}s, which degrades memory and rendering\n * performance when the XKT is viewer in the xeokit Viewer.\n */\n this.modelAABB = cfg.modelAABB;\n\n /**\n * Map of {@link XKTPropertySet}s within this XKTModel, each mapped to {@link XKTPropertySet#propertySetId}.\n *\n * Created by {@link XKTModel#createPropertySet}.\n *\n * @type {{String:XKTPropertySet}}\n */\n this.propertySets = {};\n\n /**\n * {@link XKTPropertySet}s within this XKTModel.\n *\n * Each XKTPropertySet holds its position in this list in {@link XKTPropertySet#propertySetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTPropertySet[]}\n */\n this.propertySetsList = [];\n\n /**\n * Map of {@link XKTMetaObject}s within this XKTModel, each mapped to {@link XKTMetaObject#metaObjectId}.\n *\n * Created by {@link XKTModel#createMetaObject}.\n *\n * @type {{String:XKTMetaObject}}\n */\n this.metaObjects = {};\n\n /**\n * {@link XKTMetaObject}s within this XKTModel.\n *\n * Each XKTMetaObject holds its position in this list in {@link XKTMetaObject#metaObjectIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMetaObject[]}\n */\n this.metaObjectsList = [];\n\n /**\n * The positions of all shared {@link XKTGeometry}s are de-quantized using this singular\n * de-quantization matrix.\n *\n * This de-quantization matrix is generated from the collective Local-space boundary of the\n * positions of all shared {@link XKTGeometry}s.\n *\n * @type {Float32Array}\n */\n this.reusedGeometriesDecodeMatrix = new Float32Array(16);\n\n /**\n * Map of {@link XKTGeometry}s within this XKTModel, each mapped to {@link XKTGeometry#geometryId}.\n *\n * Created by {@link XKTModel#createGeometry}.\n *\n * @type {{Number:XKTGeometry}}\n */\n this.geometries = {};\n\n /**\n * List of {@link XKTGeometry}s within this XKTModel, in the order they were created.\n *\n * Each XKTGeometry holds its position in this list in {@link XKTGeometry#geometryIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTGeometry[]}\n */\n this.geometriesList = [];\n\n /**\n * Map of {@link XKTTexture}s within this XKTModel, each mapped to {@link XKTTexture#textureId}.\n *\n * Created by {@link XKTModel#createTexture}.\n *\n * @type {{Number:XKTTexture}}\n */\n this.textures = {};\n\n /**\n * List of {@link XKTTexture}s within this XKTModel, in the order they were created.\n *\n * Each XKTTexture holds its position in this list in {@link XKTTexture#textureIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTexture[]}\n */\n this.texturesList = [];\n\n /**\n * Map of {@link XKTTextureSet}s within this XKTModel, each mapped to {@link XKTTextureSet#textureSetId}.\n *\n * Created by {@link XKTModel#createTextureSet}.\n *\n * @type {{Number:XKTTextureSet}}\n */\n this.textureSets = {};\n\n /**\n * List of {@link XKTTextureSet}s within this XKTModel, in the order they were created.\n *\n * Each XKTTextureSet holds its position in this list in {@link XKTTextureSet#textureSetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTextureSet[]}\n */\n this.textureSetsList = [];\n\n /**\n * Map of {@link XKTMesh}s within this XKTModel, each mapped to {@link XKTMesh#meshId}.\n *\n * Created by {@link XKTModel#createMesh}.\n *\n * @type {{Number:XKTMesh}}\n */\n this.meshes = {};\n\n /**\n * List of {@link XKTMesh}s within this XKTModel, in the order they were created.\n *\n * Each XKTMesh holds its position in this list in {@link XKTMesh#meshIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMesh[]}\n */\n this.meshesList = [];\n\n /**\n * Map of {@link XKTEntity}s within this XKTModel, each mapped to {@link XKTEntity#entityId}.\n *\n * Created by {@link XKTModel#createEntity}.\n *\n * @type {{String:XKTEntity}}\n */\n this.entities = {};\n\n /**\n * {@link XKTEntity}s within this XKTModel.\n *\n * Each XKTEntity holds its position in this list in {@link XKTEntity#entityIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTEntity[]}\n */\n this.entitiesList = [];\n\n /**\n * {@link XKTTile}s within this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTile[]}\n */\n this.tilesList = [];\n\n /**\n * The axis-aligned 3D World-space boundary of this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {Float64Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this XKTModel has been finalized.\n *\n * Set ````true```` by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.finalized = false;\n }\n\n /**\n * Creates an {@link XKTPropertySet} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.propertySetId Unique ID for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetType=\"default\"] A meta type for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetName] Human-readable name for the {@link XKTPropertySet}. Defaults to the ````propertySetId```` parameter.\n * @param {String[]} params.properties Properties for the {@link XKTPropertySet}.\n * @returns {XKTPropertySet} The new {@link XKTPropertySet}.\n */\n createPropertySet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.propertySetId === null || params.propertySetId === undefined) {\n throw \"Parameter expected: params.propertySetId\";\n }\n\n if (params.properties === null || params.properties === undefined) {\n throw \"Parameter expected: params.properties\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more property sets\");\n return;\n }\n\n if (this.propertySets[params.propertySetId]) {\n // console.error(\"XKTPropertySet already exists with this ID: \" + params.propertySetId);\n return;\n }\n\n const propertySetId = params.propertySetId;\n const propertySetType = params.propertySetType || \"Default\";\n const propertySetName = params.propertySetName || params.propertySetId;\n const properties = params.properties || [];\n\n const propertySet = new XKTPropertySet(propertySetId, propertySetType, propertySetName, properties);\n\n this.propertySets[propertySetId] = propertySet;\n this.propertySetsList.push(propertySet);\n\n return propertySet;\n }\n\n /**\n * Creates an {@link XKTMetaObject} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.metaObjectId Unique ID for the {@link XKTMetaObject}.\n * @param {String} params.propertySetIds ID of one or more property sets that contains additional metadata about\n * this {@link XKTMetaObject}. The property sets could be stored externally (ie not managed at all by the XKT file),\n * or could be {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n * @param {String} [params.metaObjectType=\"default\"] A meta type for the {@link XKTMetaObject}. Can be anything,\n * but is usually an IFC type, such as \"IfcSite\" or \"IfcWall\".\n * @param {String} [params.metaObjectName] Human-readable name for the {@link XKTMetaObject}. Defaults to the ````metaObjectId```` parameter.\n * @param {String} [params.parentMetaObjectId] ID of the parent {@link XKTMetaObject}, if any. Defaults to the ````metaObjectId```` parameter.\n * @returns {XKTMetaObject} The new {@link XKTMetaObject}.\n */\n createMetaObject(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.metaObjectId === null || params.metaObjectId === undefined) {\n throw \"Parameter expected: params.metaObjectId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more meta objects\");\n return;\n }\n\n if (this.metaObjects[params.metaObjectId]) {\n // console.error(\"XKTMetaObject already exists with this ID: \" + params.metaObjectId);\n return;\n }\n\n const metaObjectId = params.metaObjectId;\n const propertySetIds = params.propertySetIds;\n const metaObjectType = params.metaObjectType || \"Default\";\n const metaObjectName = params.metaObjectName || params.metaObjectId;\n const parentMetaObjectId = params.parentMetaObjectId;\n\n const metaObject = new XKTMetaObject(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId);\n\n this.metaObjects[metaObjectId] = metaObject;\n this.metaObjectsList.push(metaObject);\n\n if (!parentMetaObjectId) {\n if (!this._rootMetaObject) {\n this._rootMetaObject = metaObject;\n }\n }\n\n return metaObject;\n }\n\n /**\n * Creates an {@link XKTTexture} within this XKTModel.\n *\n * Registers the new {@link XKTTexture} in {@link XKTModel#textures} and {@link XKTModel#texturesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureId Unique ID for the {@link XKTTexture}.\n * @param {String} [params.src] Source of an image file for the texture.\n * @param {Buffer} [params.imageData] Image data for the texture.\n * @param {Number} [params.mediaType] Media type (ie. MIME type) of ````imageData````. Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n * @param {Number} [params.width] Texture width, used with ````imageData````. Ignored for compressed textures.\n * @param {Number} [params.height] Texture height, used with ````imageData````. Ignored for compressed textures.\n * @param {Boolean} [params.compressed=true] Whether to compress the texture.\n * @param {Number} [params.minFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers less than one pixel. Supported\n * values are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter}, {@link NearestMipMapNearestFilter},\n * {@link NearestMipMapLinearFilter} and {@link LinearMipMapLinearFilter}. Ignored for compressed textures.\n * @param {Number} [params.magFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}. Ignored for compressed textures.\n * @param {Number} [params.wrapS=RepeatWrapping] Wrap parameter for texture coordinate *S*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @param {Number} [params.wrapT=RepeatWrapping] Wrap parameter for texture coordinate *T*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * {@param {Number} [params.wrapR=RepeatWrapping] Wrap parameter for texture coordinate *R*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @returns {XKTTexture} The new {@link XKTTexture}.\n */\n createTexture(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureId === null || params.textureId === undefined) {\n throw \"Parameter expected: params.textureId\";\n }\n\n if (!params.imageData && !params.src) {\n throw \"Parameter expected: params.imageData or params.src\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textures\");\n return;\n }\n\n if (this.textures[params.textureId]) {\n console.error(\"XKTTexture already exists with this ID: \" + params.textureId);\n return;\n }\n\n if (params.src) {\n const fileExt = params.src.split('.').pop();\n if (fileExt !== \"jpg\" && fileExt !== \"jpeg\" && fileExt !== \"png\") {\n console.error(`XKTModel does not support image files with extension '${fileExt}' - won't create texture '${params.textureId}`);\n return;\n }\n }\n\n const textureId = params.textureId;\n\n const texture = new XKTTexture({\n textureId,\n imageData: params.imageData,\n mediaType: params.mediaType,\n minFilter: params.minFilter,\n magFilter: params.magFilter,\n wrapS: params.wrapS,\n wrapT: params.wrapT,\n wrapR: params.wrapR,\n width: params.width,\n height: params.height,\n compressed: (params.compressed !== false),\n src: params.src\n });\n\n this.textures[textureId] = texture;\n this.texturesList.push(texture);\n\n return texture;\n }\n\n /**\n * Creates an {@link XKTTextureSet} within this XKTModel.\n *\n * Registers the new {@link XKTTextureSet} in {@link XKTModel#textureSets} and {@link XKTModel#.textureSetsList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureSetId Unique ID for the {@link XKTTextureSet}.\n * @param {*} [params.colorTextureId] ID of *RGBA* base color {@link XKTTexture}, with color in *RGB* and alpha in *A*.\n * @param {*} [params.metallicRoughnessTextureId] ID of *RGBA* metal-roughness {@link XKTTexture}, with the metallic factor in *R*, and roughness factor in *G*.\n * @param {*} [params.normalsTextureId] ID of *RGBA* normal {@link XKTTexture}, with normal map vectors in *RGB*.\n * @param {*} [params.emissiveTextureId] ID of *RGBA* emissive {@link XKTTexture}, with emissive color in *RGB*.\n * @param {*} [params.occlusionTextureId] ID of *RGBA* occlusion {@link XKTTexture}, with occlusion factor in *R*.\n * @returns {XKTTextureSet} The new {@link XKTTextureSet}.\n */\n createTextureSet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureSetId === null || params.textureSetId === undefined) {\n throw \"Parameter expected: params.textureSetId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textureSets\");\n return;\n }\n\n if (this.textureSets[params.textureSetId]) {\n console.error(\"XKTTextureSet already exists with this ID: \" + params.textureSetId);\n return;\n }\n\n let colorTexture;\n if (params.colorTextureId !== undefined && params.colorTextureId !== null) {\n colorTexture = this.textures[params.colorTextureId];\n if (!colorTexture) {\n console.error(`Texture not found: ${params.colorTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n colorTexture.channel = COLOR_TEXTURE;\n }\n\n let metallicRoughnessTexture;\n if (params.metallicRoughnessTextureId !== undefined && params.metallicRoughnessTextureId !== null) {\n metallicRoughnessTexture = this.textures[params.metallicRoughnessTextureId];\n if (!metallicRoughnessTexture) {\n console.error(`Texture not found: ${params.metallicRoughnessTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n metallicRoughnessTexture.channel = METALLIC_ROUGHNESS_TEXTURE;\n }\n\n let normalsTexture;\n if (params.normalsTextureId !== undefined && params.normalsTextureId !== null) {\n normalsTexture = this.textures[params.normalsTextureId];\n if (!normalsTexture) {\n console.error(`Texture not found: ${params.normalsTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n normalsTexture.channel = NORMALS_TEXTURE;\n }\n\n let emissiveTexture;\n if (params.emissiveTextureId !== undefined && params.emissiveTextureId !== null) {\n emissiveTexture = this.textures[params.emissiveTextureId];\n if (!emissiveTexture) {\n console.error(`Texture not found: ${params.emissiveTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n emissiveTexture.channel = EMISSIVE_TEXTURE;\n }\n\n let occlusionTexture;\n if (params.occlusionTextureId !== undefined && params.occlusionTextureId !== null) {\n occlusionTexture = this.textures[params.occlusionTextureId];\n if (!occlusionTexture) {\n console.error(`Texture not found: ${params.occlusionTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n occlusionTexture.channel = OCCLUSION_TEXTURE;\n }\n\n const textureSet = new XKTTextureSet({\n textureSetId: params.textureSetId,\n textureSetIndex: this.textureSetsList.length,\n colorTexture,\n metallicRoughnessTexture,\n normalsTexture,\n emissiveTexture,\n occlusionTexture\n });\n\n this.textureSets[params.textureSetId] = textureSet;\n this.textureSetsList.push(textureSet);\n\n return textureSet;\n }\n\n /**\n * Creates an {@link XKTGeometry} within this XKTModel.\n *\n * Registers the new {@link XKTGeometry} in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.geometryId Unique ID for the {@link XKTGeometry}.\n * @param {String} params.primitiveType The type of {@link XKTGeometry}: \"triangles\", \"lines\" or \"points\".\n * @param {Float64Array} params.positions Floating-point Local-space vertex positions for the {@link XKTGeometry}. Required for all primitive types.\n * @param {Number[]} [params.normals] Floating-point vertex normals for the {@link XKTGeometry}. Only used with triangles primitives. Ignored for points and lines.\n * @param {Number[]} [params.colors] Floating-point RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.uvs] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uv````.\n * @param {Number[]} [params.uv] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uvs````.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Uint32Array} [params.indices] Indices for the {@link XKTGeometry}. Required for triangles and lines primitives. Ignored for points.\n * @param {Number} [params.edgeThreshold=10]\n * @returns {XKTGeometry} The new {@link XKTGeometry}.\n */\n createGeometry(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (!params.primitiveType) {\n throw \"Parameter expected: params.primitiveType\";\n }\n\n if (!params.positions) {\n throw \"Parameter expected: params.positions\";\n }\n\n const triangles = params.primitiveType === \"triangles\";\n const points = params.primitiveType === \"points\";\n const lines = params.primitiveType === \"lines\";\n const line_strip = params.primitiveType === \"line-strip\";\n const triangle_strip = params.primitiveType === \"triangle-strip\";\n const triangle_fan = params.primitiveType === \"triangle-fan\";\n\n if (!triangles && !points && !lines && !line_strip) {\n throw \"Unsupported value for params.primitiveType: \"\n + params.primitiveType\n + \"' - supported values are 'triangles', 'points', 'lines', 'line-strip', 'triangle-strip' and 'triangle-fan\";\n }\n\n if (triangles) {\n if (!params.indices) {\n params.indices = this._createDefaultIndices()\n throw \"Parameter expected for 'triangles' primitive: params.indices\";\n }\n }\n\n if (points) {\n if (!params.colors && !params.colorsCompressed) {\n throw \"Parameter expected for 'points' primitive: params.colors or params.colorsCompressed\";\n }\n }\n\n if (lines) {\n if (!params.indices) {\n throw \"Parameter expected for 'lines' primitive: params.indices\";\n }\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more geometries\");\n return;\n }\n\n if (this.geometries[params.geometryId]) {\n console.error(\"XKTGeometry already exists with this ID: \" + params.geometryId);\n return;\n }\n\n const geometryId = params.geometryId;\n const primitiveType = params.primitiveType;\n const positions = new Float64Array(params.positions); // May modify in #finalize\n\n const xktGeometryCfg = {\n geometryId: geometryId,\n geometryIndex: this.geometriesList.length,\n primitiveType: primitiveType,\n positions: positions,\n uvs: params.uvs || params.uv\n }\n\n if (triangles) {\n if (params.normals) {\n xktGeometryCfg.normals = new Float32Array(params.normals);\n }\n if (params.indices) {\n xktGeometryCfg.indices = params.indices;\n } else {\n xktGeometryCfg.indices = this._createDefaultIndices(positions.length / 3);\n }\n }\n\n if (points) {\n if (params.colorsCompressed) {\n xktGeometryCfg.colorsCompressed = new Uint8Array(params.colorsCompressed);\n\n } else {\n const colors = params.colors;\n const colorsCompressed = new Uint8Array(colors.length);\n for (let i = 0, len = colors.length; i < len; i++) {\n colorsCompressed[i] = Math.floor(colors[i] * 255);\n }\n xktGeometryCfg.colorsCompressed = colorsCompressed;\n }\n }\n\n if (lines) {\n xktGeometryCfg.indices = params.indices;\n }\n\n if (triangles) {\n\n if (!params.normals && !params.uv && !params.uvs) {\n\n // Building models often duplicate positions to allow face-aligned vertex normals; when we're not\n // providing normals for a geometry, it becomes possible to merge duplicate vertex positions within it.\n\n // TODO: Make vertex merging also merge normals?\n\n const mergedPositions = [];\n const mergedIndices = [];\n mergeVertices(xktGeometryCfg.positions, xktGeometryCfg.indices, mergedPositions, mergedIndices);\n xktGeometryCfg.positions = new Float64Array(mergedPositions);\n xktGeometryCfg.indices = mergedIndices;\n }\n\n xktGeometryCfg.edgeIndices = buildEdgeIndices(xktGeometryCfg.positions, xktGeometryCfg.indices, null, params.edgeThreshold || this.edgeThreshold || 10);\n }\n\n const geometry = new XKTGeometry(xktGeometryCfg);\n\n this.geometries[geometryId] = geometry;\n this.geometriesList.push(geometry);\n\n return geometry;\n }\n\n _createDefaultIndices(numIndices) {\n const indices = [];\n for (let i = 0; i < numIndices; i++) {\n indices.push(i);\n }\n return indices;\n }\n\n /**\n * Creates an {@link XKTMesh} within this XKTModel.\n *\n * An {@link XKTMesh} can be owned by one {@link XKTEntity}, which can own multiple {@link XKTMesh}es.\n *\n * Registers the new {@link XKTMesh} in {@link XKTModel#meshes} and {@link XKTModel#meshesList}.\n *\n * @param {*} params Method parameters.\n * @param {Number} params.meshId Unique ID for the {@link XKTMesh}.\n * @param {Number} params.geometryId ID of an existing {@link XKTGeometry} in {@link XKTModel#geometries}.\n * @param {Number} [params.textureSetId] Unique ID of an {@link XKTTextureSet} in {@link XKTModel#textureSets}.\n * @param {Float32Array} params.color RGB color for the {@link XKTMesh}, with each color component in range [0..1].\n * @param {Number} [params.metallic=0] How metallic the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully dielectric material, while ````1```` indicates fully metallic.\n * @param {Number} [params.roughness=1] How rough the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully smooth, while ````1```` indicates fully rough.\n * @param {Number} params.opacity Opacity factor for the {@link XKTMesh}, in range [0..1].\n * @param {Float64Array} [params.matrix] Modeling matrix for the {@link XKTMesh}. Overrides ````position````, ````scale```` and ````rotation```` parameters.\n * @param {Number[]} [params.position=[0,0,0]] Position of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.scale=[1,1,1]] Scale of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.rotation=[0,0,0]] Rotation of the {@link XKTMesh} as Euler angles given in degrees, for each of the X, Y and Z axis. Overridden by the ````matrix```` parameter.\n * @returns {XKTMesh} The new {@link XKTMesh}.\n */\n createMesh(params) {\n\n if (params.meshId === null || params.meshId === undefined) {\n throw \"Parameter expected: params.meshId\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (this.finalized) {\n throw \"XKTModel has been finalized, can't add more meshes\";\n }\n\n if (this.meshes[params.meshId]) {\n console.error(\"XKTMesh already exists with this ID: \" + params.meshId);\n return;\n }\n\n const geometry = this.geometries[params.geometryId];\n\n if (!geometry) {\n console.error(\"XKTGeometry not found: \" + params.geometryId);\n return;\n }\n\n geometry.numInstances++;\n\n let textureSet = null;\n if (params.textureSetId) {\n textureSet = this.textureSets[params.textureSetId];\n if (!textureSet) {\n console.error(\"XKTTextureSet not found: \" + params.textureSetId);\n return;\n }\n textureSet.numInstances++;\n }\n\n let matrix = params.matrix;\n\n if (!matrix) {\n\n const position = params.position;\n const scale = params.scale;\n const rotation = params.rotation;\n\n if (position || scale || rotation) {\n matrix = math.identityMat4();\n const quaternion = math.eulerToQuaternion(rotation || [0, 0, 0], \"XYZ\", math.identityQuaternion());\n math.composeMat4(position || [0, 0, 0], quaternion, scale || [1, 1, 1], matrix)\n\n } else {\n matrix = math.identityMat4();\n }\n }\n\n const meshIndex = this.meshesList.length;\n\n const mesh = new XKTMesh({\n meshId: params.meshId,\n meshIndex,\n matrix,\n geometry,\n color: params.color,\n metallic: params.metallic,\n roughness: params.roughness,\n opacity: params.opacity,\n textureSet\n });\n\n this.meshes[mesh.meshId] = mesh;\n this.meshesList.push(mesh);\n\n return mesh;\n }\n\n /**\n * Creates an {@link XKTEntity} within this XKTModel.\n *\n * Registers the new {@link XKTEntity} in {@link XKTModel#entities} and {@link XKTModel#entitiesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.entityId Unique ID for the {@link XKTEntity}.\n * @param {String[]} params.meshIds IDs of {@link XKTMesh}es used by the {@link XKTEntity}. Note that each {@link XKTMesh} can only be used by one {@link XKTEntity}.\n * @returns {XKTEntity} The new {@link XKTEntity}.\n */\n createEntity(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.entityId === null || params.entityId === undefined) {\n throw \"Parameter expected: params.entityId\";\n }\n\n if (!params.meshIds) {\n throw \"Parameter expected: params.meshIds\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more entities\");\n return;\n }\n\n if (params.meshIds.length === 0) {\n console.warn(\"XKTEntity has no meshes - won't create: \" + params.entityId);\n return;\n }\n\n let entityId = params.entityId;\n\n if (this.entities[entityId]) {\n while (this.entities[entityId]) {\n entityId = math.createUUID();\n }\n console.error(\"XKTEntity already exists with this ID: \" + params.entityId + \" - substituting random ID instead: \" + entityId);\n }\n\n const meshIds = params.meshIds;\n const meshes = [];\n\n for (let meshIdIdx = 0, meshIdLen = meshIds.length; meshIdIdx < meshIdLen; meshIdIdx++) {\n\n const meshId = meshIds[meshIdIdx];\n const mesh = this.meshes[meshId];\n\n if (!mesh) {\n console.error(\"XKTMesh found: \" + meshId);\n continue;\n }\n\n if (mesh.entity) {\n console.error(\"XKTMesh \" + meshId + \" already used by XKTEntity \" + mesh.entity.entityId);\n continue;\n }\n\n meshes.push(mesh);\n }\n\n const entity = new XKTEntity(entityId, meshes);\n\n for (let i = 0, len = meshes.length; i < len; i++) {\n const mesh = meshes[i];\n mesh.entity = entity;\n }\n\n this.entities[entityId] = entity;\n this.entitiesList.push(entity);\n\n return entity;\n }\n\n /**\n * Creates a default {@link XKTMetaObject} for each {@link XKTEntity} that does not already have one.\n */\n createDefaultMetaObjects() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const metaObjectId = entity.entityId;\n const metaObject = this.metaObjects[metaObjectId];\n\n if (!metaObject) {\n\n if (!this._rootMetaObject) {\n this._rootMetaObject = this.createMetaObject({\n metaObjectId: this.modelId,\n metaObjectType: \"Default\",\n metaObjectName: this.modelId\n });\n }\n\n this.createMetaObject({\n metaObjectId: metaObjectId,\n metaObjectType: \"Default\",\n metaObjectName: \"\" + metaObjectId,\n parentMetaObjectId: this._rootMetaObject.metaObjectId\n });\n }\n }\n }\n\n /**\n * Finalizes this XKTModel.\n *\n * After finalizing, we may then serialize the model to an array buffer using {@link writeXKTModelToArrayBuffer}.\n *\n * Logs error and does nothing if this XKTModel has already been finalized.\n *\n * Internally, this method:\n *\n * * for each {@link XKTEntity} that doesn't already have a {@link XKTMetaObject}, creates one with {@link XKTMetaObject#metaObjectType} set to \"default\"\n * * sets each {@link XKTEntity}'s {@link XKTEntity#hasReusedGeometries} true if it shares its {@link XKTGeometry}s with other {@link XKTEntity}s,\n * * creates each {@link XKTEntity}'s {@link XKTEntity#aabb},\n * * creates {@link XKTTile}s in {@link XKTModel#tilesList}, and\n * * sets {@link XKTModel#finalized} ````true````.\n */\n async finalize() {\n\n if (this.finalized) {\n console.log(\"XKTModel already finalized\");\n return;\n }\n\n this._removeUnusedTextures();\n\n await this._compressTextures();\n\n this._bakeSingleUseGeometryPositions();\n\n this._bakeAndOctEncodeNormals();\n\n this._createEntityAABBs();\n\n const rootKDNode = this._createKDTree();\n\n this.entitiesList = [];\n\n this._createTilesFromKDTree(rootKDNode);\n\n this._createReusedGeometriesDecodeMatrix();\n\n this._flagSolidGeometries();\n\n this.aabb.set(rootKDNode.aabb);\n\n this.finalized = true;\n }\n\n _removeUnusedTextures() {\n let texturesList = [];\n const textures = {};\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n if (texture.channel !== null) {\n texture.textureIndex = texturesList.length;\n texturesList.push(texture);\n textures[texture.textureId] = texture;\n }\n }\n this.texturesList = texturesList;\n this.textures = textures;\n }\n\n _compressTextures() {\n let countTextures = this.texturesList.length;\n return new Promise((resolve) => {\n if (countTextures === 0) {\n resolve();\n return;\n }\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n const encodingOptions = TEXTURE_ENCODING_OPTIONS[texture.channel] || {};\n\n if (texture.src) {\n\n // XKTTexture created with XKTModel#createTexture({ src: ... })\n\n const src = texture.src;\n const fileExt = src.split('.').pop();\n switch (fileExt) {\n case \"jpeg\":\n case \"jpg\":\n case \"png\":\n load(src, ImageLoader, {\n image: {\n type: \"data\"\n }\n }).then((imageData) => {\n if (texture.compressed) {\n encode(imageData, KTX2BasisWriter, encodingOptions).then((encodedData) => {\n const encodedImageData = new Uint8Array(encodedData);\n texture.imageData = encodedImageData;\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to load image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n break;\n default:\n if (--countTextures <= 0) {\n resolve();\n }\n break;\n }\n }\n\n if (texture.imageData) {\n\n // XKTTexture created with XKTModel#createTexture({ imageData: ... })\n\n if (texture.compressed) {\n encode(texture.imageData, KTX2BasisWriter, encodingOptions)\n .then((encodedImageData) => {\n texture.imageData = new Uint8Array(encodedImageData);\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }\n }\n });\n }\n\n _bakeSingleUseGeometryPositions() {\n\n for (let j = 0, lenj = this.meshesList.length; j < lenj; j++) {\n\n const mesh = this.meshesList[j];\n\n const geometry = mesh.geometry;\n\n if (geometry.numInstances === 1) {\n\n const matrix = mesh.matrix;\n\n if (matrix && (!math.isIdentityMat4(matrix))) {\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n\n positions[i + 0] = tempVec4b[0];\n positions[i + 1] = tempVec4b[1];\n positions[i + 2] = tempVec4b[2];\n }\n }\n }\n }\n }\n\n _bakeAndOctEncodeNormals() {\n\n for (let i = 0, len = this.meshesList.length; i < len; i++) {\n\n const mesh = this.meshesList[i];\n const geometry = mesh.geometry;\n\n if (geometry.normals && !geometry.normalsOctEncoded) {\n\n geometry.normalsOctEncoded = new Int8Array(geometry.normals.length);\n\n if (geometry.numInstances > 1) {\n geometryCompression.octEncodeNormals(geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n\n } else {\n const modelNormalMatrix = math.inverseMat4(math.transposeMat4(mesh.matrix, tempMat4), tempMat4b);\n geometryCompression.transformAndOctEncodeNormals(modelNormalMatrix, geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n }\n }\n }\n }\n\n _createEntityAABBs() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const entityAABB = entity.aabb;\n const meshes = entity.meshes;\n\n math.collapseAABB3(entityAABB);\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n const matrix = mesh.matrix;\n\n if (geometry.numInstances > 1) {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n math.expandAABB3Point3(entityAABB, tempVec4b);\n }\n\n } else {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n math.expandAABB3Point3(entityAABB, tempVec4a);\n }\n }\n }\n }\n }\n\n _createKDTree() {\n\n let aabb;\n if (this.modelAABB) {\n aabb = this.modelAABB; // Pre-known uber AABB\n } else {\n aabb = math.collapseAABB3();\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n math.expandAABB3(aabb, entity.aabb);\n }\n }\n\n const rootKDNode = new KDNode(aabb);\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n this._insertEntityIntoKDTree(rootKDNode, entity);\n }\n\n return rootKDNode;\n }\n\n _insertEntityIntoKDTree(kdNode, entity) {\n\n const nodeAABB = kdNode.aabb;\n const entityAABB = entity.aabb;\n\n const nodeAABBDiag = math.getAABB3Diag(nodeAABB);\n\n if (nodeAABBDiag < this.minTileSize) {\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n math.expandAABB3(nodeAABB, entityAABB);\n return;\n }\n\n if (kdNode.left) {\n if (math.containsAABB3(kdNode.left.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (kdNode.right) {\n if (math.containsAABB3(kdNode.right.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdTreeDimLength[0] = nodeAABB[3] - nodeAABB[0];\n kdTreeDimLength[1] = nodeAABB[4] - nodeAABB[1];\n kdTreeDimLength[2] = nodeAABB[5] - nodeAABB[2];\n\n let dim = 0;\n\n if (kdTreeDimLength[1] > kdTreeDimLength[dim]) {\n dim = 1;\n }\n\n if (kdTreeDimLength[2] > kdTreeDimLength[dim]) {\n dim = 2;\n }\n\n if (!kdNode.left) {\n const aabbLeft = nodeAABB.slice();\n aabbLeft[dim + 3] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.left = new KDNode(aabbLeft);\n if (math.containsAABB3(aabbLeft, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (!kdNode.right) {\n const aabbRight = nodeAABB.slice();\n aabbRight[dim] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.right = new KDNode(aabbRight);\n if (math.containsAABB3(aabbRight, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n\n math.expandAABB3(nodeAABB, entityAABB);\n }\n\n _createTilesFromKDTree(rootKDNode) {\n this._createTilesFromKDNode(rootKDNode);\n }\n\n _createTilesFromKDNode(kdNode) {\n if (kdNode.entities && kdNode.entities.length > 0) {\n this._createTileFromEntities(kdNode);\n }\n if (kdNode.left) {\n this._createTilesFromKDNode(kdNode.left);\n }\n if (kdNode.right) {\n this._createTilesFromKDNode(kdNode.right);\n }\n }\n\n /**\n * Creates a tile from the given entities.\n *\n * For each single-use {@link XKTGeometry}, this method centers {@link XKTGeometry#positions} to make them relative to the\n * tile's center, then quantizes the positions to unsigned 16-bit integers, relative to the tile's boundary.\n *\n * @param kdNode\n */\n _createTileFromEntities(kdNode) {\n\n const tileAABB = kdNode.aabb;\n const entities = kdNode.entities;\n\n const tileCenter = math.getAABB3Center(tileAABB);\n const tileCenterNeg = math.mulVec3Scalar(tileCenter, -1, math.vec3());\n\n const rtcAABB = math.AABB3(); // AABB centered at the RTC origin\n\n rtcAABB[0] = tileAABB[0] - tileCenter[0];\n rtcAABB[1] = tileAABB[1] - tileCenter[1];\n rtcAABB[2] = tileAABB[2] - tileCenter[2];\n rtcAABB[3] = tileAABB[3] - tileCenter[0];\n rtcAABB[4] = tileAABB[4] - tileCenter[1];\n rtcAABB[5] = tileAABB[5] - tileCenter[2];\n\n for (let i = 0; i < entities.length; i++) {\n\n const entity = entities [i];\n\n const meshes = entity.meshes;\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n\n if (!geometry.reused) { // Batched geometry\n\n const positions = geometry.positions;\n\n // Center positions relative to their tile's World-space center\n\n for (let k = 0, lenk = positions.length; k < lenk; k += 3) {\n\n positions[k + 0] -= tileCenter[0];\n positions[k + 1] -= tileCenter[1];\n positions[k + 2] -= tileCenter[2];\n }\n\n // Quantize positions relative to tile's RTC-space boundary\n\n geometryCompression.quantizePositions(positions, positions.length, rtcAABB, geometry.positionsQuantized);\n\n } else { // Instanced geometry\n\n // Post-multiply a translation to the mesh's modeling matrix\n // to center the entity's geometry instances to the tile RTC center\n\n //////////////////////////////\n // Why do we do this?\n // Seems to break various models\n /////////////////////////////////\n\n math.translateMat4v(tileCenterNeg, mesh.matrix);\n }\n }\n\n entity.entityIndex = this.entitiesList.length;\n\n this.entitiesList.push(entity);\n }\n\n const tile = new XKTTile(tileAABB, entities);\n\n this.tilesList.push(tile);\n }\n\n _createReusedGeometriesDecodeMatrix() {\n\n const tempVec3a = math.vec3();\n const reusedGeometriesAABB = math.collapseAABB3(math.AABB3());\n let countReusedGeometries = 0;\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) { // Instanced geometry\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n math.expandAABB3Point3(reusedGeometriesAABB, tempVec3a);\n }\n\n countReusedGeometries++;\n }\n }\n\n if (countReusedGeometries > 0) {\n\n geometryCompression.createPositionsDecodeMatrix(reusedGeometriesAABB, this.reusedGeometriesDecodeMatrix);\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) {\n geometryCompression.quantizePositions(geometry.positions, geometry.positions.length, reusedGeometriesAABB, geometry.positionsQuantized);\n }\n }\n\n } else {\n math.identityMat4(this.reusedGeometriesDecodeMatrix); // No need for this matrix, but we'll be tidy and set it to identity\n }\n }\n\n _flagSolidGeometries() {\n let maxNumPositions = 0;\n let maxNumIndices = 0;\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n if (geometry.positionsQuantized.length > maxNumPositions) {\n maxNumPositions = geometry.positionsQuantized.length;\n }\n if (geometry.indices.length > maxNumIndices) {\n maxNumIndices = geometry.indices.length;\n }\n }\n }\n let vertexIndexMapping = new Array(maxNumPositions / 3);\n let edges = new Array(maxNumIndices);\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n geometry.solid = isTriangleMeshSolid(geometry.indices, geometry.positionsQuantized, vertexIndexMapping, edges);\n }\n }\n }\n}\n\nexport {\n XKTModel\n}","/**\n * Given geometry defined as an array of positions, optional normals, option uv and an array of indices, returns\n * modified arrays that have duplicate vertices removed.\n *\n * @private\n */\nfunction mergeVertices(positions, indices, mergedPositions, mergedIndices) {\n const positionsMap = {};\n const indicesLookup = [];\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let uvi = 0;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n const vx = positions[i];\n const vy = positions[i + 1];\n const vz = positions[i + 2];\n const key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n if (positionsMap[key] === undefined) {\n positionsMap[key] = mergedPositions.length / 3;\n mergedPositions.push(vx);\n mergedPositions.push(vy);\n mergedPositions.push(vz);\n }\n indicesLookup[i / 3] = positionsMap[key];\n uvi += 2;\n }\n for (let i = 0, len = indices.length; i < len; i++) {\n mergedIndices[i] = indicesLookup[indices[i]];\n }\n}\n\nexport {mergeVertices};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"pako\");","import {XKT_INFO} from \"../XKT_INFO.js\";\nimport * as pako from 'pako';\n\nconst XKT_VERSION = XKT_INFO.xktVersion;\nconst NUM_TEXTURE_ATTRIBUTES = 9;\nconst NUM_MATERIAL_ATTRIBUTES = 6;\n\n/**\n * Writes an {@link XKTModel} to an {@link ArrayBuffer}.\n *\n * @param {XKTModel} xktModel The {@link XKTModel}.\n * @param {String} metaModelJSON The metamodel JSON in a string.\n * @param {Object} [stats] Collects statistics.\n * @param {Object} options Options for how the XKT is written.\n * @param {Boolean} [options.zip=true] ZIP the contents?\n * @returns {ArrayBuffer} The {@link ArrayBuffer}.\n */\nfunction writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, options) {\n const data = getModelData(xktModel, metaModelJSON, stats);\n const deflatedData = deflateData(data, metaModelJSON, options);\n stats.texturesSize += deflatedData.textureData.byteLength;\n const arrayBuffer = createArrayBuffer(deflatedData);\n return arrayBuffer;\n}\n\nfunction getModelData(xktModel, metaModelDataStr, stats) {\n\n //------------------------------------------------------------------------------------------------------------------\n // Allocate data\n //------------------------------------------------------------------------------------------------------------------\n\n const propertySetsList = xktModel.propertySetsList;\n const metaObjectsList = xktModel.metaObjectsList;\n const geometriesList = xktModel.geometriesList;\n const texturesList = xktModel.texturesList;\n const textureSetsList = xktModel.textureSetsList;\n const meshesList = xktModel.meshesList;\n const entitiesList = xktModel.entitiesList;\n const tilesList = xktModel.tilesList;\n\n const numPropertySets = propertySetsList.length;\n const numMetaObjects = metaObjectsList.length;\n const numGeometries = geometriesList.length;\n const numTextures = texturesList.length;\n const numTextureSets = textureSetsList.length;\n const numMeshes = meshesList.length;\n const numEntities = entitiesList.length;\n const numTiles = tilesList.length;\n\n let lenPositions = 0;\n let lenNormals = 0;\n let lenColors = 0;\n let lenUVs = 0;\n let lenIndices = 0;\n let lenEdgeIndices = 0;\n let lenMatrices = 0;\n let lenTextures = 0;\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n if (geometry.positionsQuantized) {\n lenPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n lenNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n lenColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n lenUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n lenIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n lenEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n for (let textureIndex = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n lenTextures += imageData.byteLength;\n\n if (xktTexture.compressed) {\n stats.numCompressedTextures++;\n }\n }\n\n for (let meshIndex = 0; meshIndex < numMeshes; meshIndex++) {\n const mesh = meshesList[meshIndex];\n if (mesh.geometry.numInstances > 1) {\n lenMatrices += 16;\n }\n }\n\n const data = {\n metadata: {},\n textureData: new Uint8Array(lenTextures), // All textures\n eachTextureDataPortion: new Uint32Array(numTextures), // For each texture, an index to its first element in textureData\n eachTextureAttributes: new Uint16Array(numTextures * NUM_TEXTURE_ATTRIBUTES),\n positions: new Uint16Array(lenPositions), // All geometry arrays\n normals: new Int8Array(lenNormals),\n colors: new Uint8Array(lenColors),\n uvs: new Float32Array(lenUVs),\n indices: new Uint32Array(lenIndices),\n edgeIndices: new Uint32Array(lenEdgeIndices),\n eachTextureSetTextures: new Int32Array(numTextureSets * 5), // For each texture set, a set of five Texture indices [color, metal/roughness,normals,emissive,occlusion]; each index has value -1 if no texture\n matrices: new Float32Array(lenMatrices), // Modeling matrices for entities that share geometries. Each entity either shares all it's geometries, or owns all its geometries exclusively. Exclusively-owned geometries are pre-transformed into World-space, and so their entities don't have modeling matrices in this array.\n reusedGeometriesDecodeMatrix: new Float32Array(xktModel.reusedGeometriesDecodeMatrix), // A single, global vertex position de-quantization matrix for all reused geometries. Reused geometries are quantized to their collective Local-space AABB, and this matrix is derived from that AABB.\n eachGeometryPrimitiveType: new Uint8Array(numGeometries), // Primitive type for each geometry (0=solid triangles, 1=surface triangles, 2=lines, 3=points, 4=line-strip)\n eachGeometryPositionsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.positions. Every primitive type has positions.\n eachGeometryNormalsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.normals. If the next geometry has the same index, then this geometry has no normals.\n eachGeometryColorsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.colors. If the next geometry has the same index, then this geometry has no colors.\n eachGeometryUVsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.uvs. If the next geometry has the same index, then this geometry has no UVs.\n eachGeometryIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.indices. If the next geometry has the same index, then this geometry has no indices.\n eachGeometryEdgeIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.edgeIndices. If the next geometry has the same index, then this geometry has no edge indices.\n eachMeshGeometriesPortion: new Uint32Array(numMeshes), // For each mesh, an index into the eachGeometry* arrays\n eachMeshMatricesPortion: new Uint32Array(numMeshes), // For each mesh that shares its geometry, an index to its first element in data.matrices, to indicate the modeling matrix that transforms the shared geometry Local-space vertex positions. This is ignored for meshes that don't share geometries, because the vertex positions of non-shared geometries are pre-transformed into World-space.\n eachMeshTextureSet: new Int32Array(numMeshes), // For each mesh, the index of its texture set in data.eachTextureSetTextures; this array contains signed integers so that we can use -1 to indicate when a mesh has no texture set\n eachMeshMaterialAttributes: new Uint8Array(numMeshes * NUM_MATERIAL_ATTRIBUTES), // For each mesh, an RGBA integer color of format [0..255, 0..255, 0..255, 0..255], and PBR metallic and roughness factors, of format [0..255, 0..255]\n eachEntityId: [], // For each entity, an ID string\n eachEntityMeshesPortion: new Uint32Array(numEntities), // For each entity, the index of the first element of meshes used by the entity\n eachTileAABB: new Float64Array(numTiles * 6), // For each tile, an axis-aligned bounding box\n eachTileEntitiesPortion: new Uint32Array(numTiles) // For each tile, the index of the first element of eachEntityId, eachEntityMeshesPortion and eachEntityMatricesPortion used by the tile\n };\n\n let countPositions = 0;\n let countNormals = 0;\n let countColors = 0;\n let countUVs = 0;\n let countIndices = 0;\n let countEdgeIndices = 0;\n\n // Metadata\n\n data.metadata = {\n id: xktModel.modelId,\n projectId: xktModel.projectId,\n revisionId: xktModel.revisionId,\n author: xktModel.author,\n createdAt: xktModel.createdAt,\n creatingApplication: xktModel.creatingApplication,\n schema: xktModel.schema,\n propertySets: [],\n metaObjects: []\n };\n\n // Property sets\n\n for (let propertySetsIndex = 0; propertySetsIndex < numPropertySets; propertySetsIndex++) {\n const propertySet = propertySetsList[propertySetsIndex];\n const propertySetJSON = {\n id: \"\" + propertySet.propertySetId,\n name: propertySet.propertySetName,\n type: propertySet.propertySetType,\n properties: propertySet.properties\n };\n data.metadata.propertySets.push(propertySetJSON);\n }\n\n // Metaobjects\n\n if (!metaModelDataStr) {\n for (let metaObjectsIndex = 0; metaObjectsIndex < numMetaObjects; metaObjectsIndex++) {\n const metaObject = metaObjectsList[metaObjectsIndex];\n const metaObjectJSON = {\n name: metaObject.metaObjectName,\n type: metaObject.metaObjectType,\n id: \"\" + metaObject.metaObjectId\n };\n if (metaObject.parentMetaObjectId !== undefined && metaObject.parentMetaObjectId !== null) {\n metaObjectJSON.parent = \"\" + metaObject.parentMetaObjectId;\n }\n if (metaObject.propertySetIds && metaObject.propertySetIds.length > 0) {\n metaObjectJSON.propertySetIds = metaObject.propertySetIds;\n }\n if (metaObject.external) {\n metaObjectJSON.external = metaObject.external;\n }\n data.metadata.metaObjects.push(metaObjectJSON);\n }\n }\n\n // Geometries\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n let primitiveType = 1;\n switch (geometry.primitiveType) {\n case \"triangles\":\n primitiveType = geometry.solid ? 0 : 1;\n break;\n case \"points\":\n primitiveType = 2;\n break;\n case \"lines\":\n primitiveType = 3;\n break;\n case \"line-strip\":\n primitiveType = 4;\n break;\n case \"triangle-strip\":\n primitiveType = 5;\n break;\n case \"triangle-fan\":\n primitiveType = 6;\n break;\n default:\n primitiveType = 1\n }\n data.eachGeometryPrimitiveType [geometryIndex] = primitiveType;\n data.eachGeometryPositionsPortion [geometryIndex] = countPositions;\n data.eachGeometryNormalsPortion [geometryIndex] = countNormals;\n data.eachGeometryColorsPortion [geometryIndex] = countColors;\n data.eachGeometryUVsPortion [geometryIndex] = countUVs;\n data.eachGeometryIndicesPortion [geometryIndex] = countIndices;\n data.eachGeometryEdgeIndicesPortion [geometryIndex] = countEdgeIndices;\n if (geometry.positionsQuantized) {\n data.positions.set(geometry.positionsQuantized, countPositions);\n countPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n data.normals.set(geometry.normalsOctEncoded, countNormals);\n countNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n data.colors.set(geometry.colorsCompressed, countColors);\n countColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n data.uvs.set(geometry.uvs, countUVs);\n countUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n data.indices.set(geometry.indices, countIndices);\n countIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n data.edgeIndices.set(geometry.edgeIndices, countEdgeIndices);\n countEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n // Textures\n\n for (let textureIndex = 0, numTextures = xktModel.texturesList.length, portionIdx = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = xktModel.texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n data.textureData.set(imageData, portionIdx);\n data.eachTextureDataPortion[textureIndex] = portionIdx;\n\n portionIdx += imageData.byteLength;\n\n let textureAttrIdx = textureIndex * NUM_TEXTURE_ATTRIBUTES;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.compressed ? 1 : 0;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.mediaType; // GIFMediaType | PNGMediaType | JPEGMediaType\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.width;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.height;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.minFilter; // LinearMipmapLinearFilter | LinearMipMapNearestFilter | NearestMipMapNearestFilter | NearestMipMapLinearFilter | LinearMipMapLinearFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.magFilter; // LinearFilter | NearestFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapS; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapT; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapR; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n }\n\n // Texture sets\n\n for (let textureSetIndex = 0, numTextureSets = xktModel.textureSetsList.length, eachTextureSetTexturesIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {\n const textureSet = textureSetsList[textureSetIndex];\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.colorTexture ? textureSet.colorTexture.textureIndex : -1; // Color map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.metallicRoughnessTexture ? textureSet.metallicRoughnessTexture.textureIndex : -1; // Metal/rough map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.normalsTexture ? textureSet.normalsTexture.textureIndex : -1; // Normal map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.emissiveTexture ? textureSet.emissiveTexture.textureIndex : -1; // Emissive map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.occlusionTexture ? textureSet.occlusionTexture.textureIndex : -1; // Occlusion map\n }\n\n // Tiles -> Entities -> Meshes\n\n let entityIndex = 0;\n let countEntityMeshesPortion = 0;\n let eachMeshMaterialAttributesIndex = 0;\n let matricesIndex = 0;\n let meshIndex = 0;\n\n for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) {\n\n const tile = tilesList [tileIndex];\n const tileEntities = tile.entities;\n const numTileEntities = tileEntities.length;\n\n if (numTileEntities === 0) {\n continue;\n }\n\n data.eachTileEntitiesPortion[tileIndex] = entityIndex;\n\n const tileAABB = tile.aabb;\n\n for (let j = 0; j < numTileEntities; j++) {\n\n const entity = tileEntities[j];\n const entityMeshes = entity.meshes;\n const numEntityMeshes = entityMeshes.length;\n\n for (let k = 0; k < numEntityMeshes; k++) {\n\n const mesh = entityMeshes[k];\n const geometry = mesh.geometry;\n const geometryIndex = geometry.geometryIndex;\n\n data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex;\n\n if (mesh.geometry.numInstances > 1) {\n data.matrices.set(mesh.matrix, matricesIndex);\n data.eachMeshMatricesPortion [meshIndex] = matricesIndex;\n matricesIndex += 16;\n }\n\n data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;\n\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness\n\n meshIndex++;\n }\n\n data.eachEntityId [entityIndex] = entity.entityId;\n data.eachEntityMeshesPortion[entityIndex] = countEntityMeshesPortion; // <<<<<<<<<<<<<<<<<<<< Error here? Order/value of countEntityMeshesPortion correct?\n\n entityIndex++;\n countEntityMeshesPortion += numEntityMeshes;\n }\n\n const tileAABBIndex = tileIndex * 6;\n\n data.eachTileAABB.set(tileAABB, tileAABBIndex);\n }\n\n return data;\n}\n\nfunction deflateData(data, metaModelJSON, options) {\n\n function deflate(buffer) {\n return (options.zip !== false) ? pako.deflate(buffer) : buffer;\n }\n\n let metaModelBytes;\n if (metaModelJSON) {\n const deflatedJSON = deflateJSON(metaModelJSON);\n metaModelBytes = deflate(deflatedJSON)\n } else {\n const deflatedJSON = deflateJSON(data.metadata);\n metaModelBytes = deflate(deflatedJSON)\n }\n\n return {\n metadata: metaModelBytes,\n textureData: deflate(data.textureData.buffer),\n eachTextureDataPortion: deflate(data.eachTextureDataPortion.buffer),\n eachTextureAttributes: deflate(data.eachTextureAttributes.buffer),\n positions: deflate(data.positions.buffer),\n normals: deflate(data.normals.buffer),\n colors: deflate(data.colors.buffer),\n uvs: deflate(data.uvs.buffer),\n indices: deflate(data.indices.buffer),\n edgeIndices: deflate(data.edgeIndices.buffer),\n eachTextureSetTextures: deflate(data.eachTextureSetTextures.buffer),\n matrices: deflate(data.matrices.buffer),\n reusedGeometriesDecodeMatrix: deflate(data.reusedGeometriesDecodeMatrix.buffer),\n eachGeometryPrimitiveType: deflate(data.eachGeometryPrimitiveType.buffer),\n eachGeometryPositionsPortion: deflate(data.eachGeometryPositionsPortion.buffer),\n eachGeometryNormalsPortion: deflate(data.eachGeometryNormalsPortion.buffer),\n eachGeometryColorsPortion: deflate(data.eachGeometryColorsPortion.buffer),\n eachGeometryUVsPortion: deflate(data.eachGeometryUVsPortion.buffer),\n eachGeometryIndicesPortion: deflate(data.eachGeometryIndicesPortion.buffer),\n eachGeometryEdgeIndicesPortion: deflate(data.eachGeometryEdgeIndicesPortion.buffer),\n eachMeshGeometriesPortion: deflate(data.eachMeshGeometriesPortion.buffer),\n eachMeshMatricesPortion: deflate(data.eachMeshMatricesPortion.buffer),\n eachMeshTextureSet: deflate(data.eachMeshTextureSet.buffer),\n eachMeshMaterialAttributes: deflate(data.eachMeshMaterialAttributes.buffer),\n eachEntityId: deflate(JSON.stringify(data.eachEntityId)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n })),\n eachEntityMeshesPortion: deflate(data.eachEntityMeshesPortion.buffer),\n eachTileAABB: deflate(data.eachTileAABB.buffer),\n eachTileEntitiesPortion: deflate(data.eachTileEntitiesPortion.buffer)\n };\n}\n\nfunction deflateJSON(strings) {\n return JSON.stringify(strings)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n });\n}\n\nfunction createArrayBuffer(deflatedData) {\n return toArrayBuffer([\n deflatedData.metadata,\n deflatedData.textureData,\n deflatedData.eachTextureDataPortion,\n deflatedData.eachTextureAttributes,\n deflatedData.positions,\n deflatedData.normals,\n deflatedData.colors,\n deflatedData.uvs,\n deflatedData.indices,\n deflatedData.edgeIndices,\n deflatedData.eachTextureSetTextures,\n deflatedData.matrices,\n deflatedData.reusedGeometriesDecodeMatrix,\n deflatedData.eachGeometryPrimitiveType,\n deflatedData.eachGeometryPositionsPortion,\n deflatedData.eachGeometryNormalsPortion,\n deflatedData.eachGeometryColorsPortion,\n deflatedData.eachGeometryUVsPortion,\n deflatedData.eachGeometryIndicesPortion,\n deflatedData.eachGeometryEdgeIndicesPortion,\n deflatedData.eachMeshGeometriesPortion,\n deflatedData.eachMeshMatricesPortion,\n deflatedData.eachMeshTextureSet,\n deflatedData.eachMeshMaterialAttributes,\n deflatedData.eachEntityId,\n deflatedData.eachEntityMeshesPortion,\n deflatedData.eachTileAABB,\n deflatedData.eachTileEntitiesPortion\n ]);\n}\n\nfunction toArrayBuffer(elements) {\n const indexData = new Uint32Array(elements.length + 2);\n indexData[0] = XKT_VERSION;\n indexData [1] = elements.length; // Stored Data 1.1: number of stored elements\n let dataLen = 0; // Stored Data 1.2: length of stored elements\n for (let i = 0, len = elements.length; i < len; i++) {\n const element = elements[i];\n const elementsize = element.length;\n indexData[i + 2] = elementsize;\n dataLen += elementsize;\n }\n const indexBuf = new Uint8Array(indexData.buffer);\n const dataArray = new Uint8Array(indexBuf.length + dataLen);\n dataArray.set(indexBuf);\n let offset = indexBuf.length;\n for (let i = 0, len = elements.length; i < len; i++) { // Stored Data 2: the elements themselves\n const element = elements[i];\n dataArray.set(element, offset);\n offset += element.length;\n }\n return dataArray.buffer;\n}\n\nexport {writeXKTModelToArrayBuffer};","/** @private */\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n\n // filter collinear points around the cuts\n filterPoints(outerNode, outerNode.next);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n\nexport {earcut};","import {earcut} from './../lib/earcut';\nimport {math} from \"./../lib/math.js\";\n\nconst tempVec2a = math.vec2();\nconst tempVec3a = math.vec3();\nconst tempVec3b = math.vec3();\nconst tempVec3c = math.vec3();\n\n/**\n * @desc Parses a CityJSON model into an {@link XKTModel}.\n *\n * [CityJSON](https://www.cityjson.org) is a JSON-based encoding for a subset of the CityGML data model (version 2.0.0),\n * which is an open standardised data model and exchange format to store digital 3D models of cities and\n * landscapes. CityGML is an official standard of the [Open Geospatial Consortium](https://www.ogc.org/).\n *\n * This converter function supports most of the [CityJSON 1.0.2 Specification](https://www.cityjson.org/specs/1.0.2),\n * with the following limitations:\n *\n * * Does not (yet) support CityJSON semantics for geometry primitives.\n * * Does not (yet) support textured geometries.\n * * Does not (yet) support geometry templates.\n * * When the CityJSON file provides multiple *themes* for a geometry, then we parse only the first of the provided themes for that geometry.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a CityJSON model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/cityjson/DenHaag.json\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseCityJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.data CityJSON data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the CityJSON vertex positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform CityJSON vertex positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when CityJSON has been parsed.\n */\nfunction parseCityJSONIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n stats = {}, log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (data.type !== \"CityJSON\") {\n reject(\"Invalid argument: data is not a CityJSON file\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n let vertices;\n\n log(\"Using parser: parseCityJSONIntoXKTModel\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n\n if (data.transform || center || transform) {\n vertices = copyVertices(data.vertices);\n if (data.transform) {\n transformVertices(vertices, data.transform)\n }\n if (center) {\n centerVertices(vertices);\n }\n if (transform) {\n customTransformVertices(vertices, transform);\n }\n } else {\n vertices = data.vertices;\n }\n\n stats.sourceFormat = data.type || \"\";\n stats.schemaVersion = data.version || \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n stats.numMetaObjects++;\n\n const modelMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: modelMetaObjectId,\n metaObjectType: \"CityJSON\",\n metaObjectName: \"CityJSON\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n stats.numMetaObjects++;\n\n const ctx = {\n data,\n vertices,\n xktModel,\n rootMetaObjectId: modelMetaObjectId,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n ctx.xktModel.schema = data.type + \" \" + data.version;\n\n ctx.log(\"Converting \" + ctx.xktModel.schema);\n\n parseCityJSON(ctx);\n\n resolve();\n });\n}\n\nfunction copyVertices(vertices) {\n const vertices2 = [];\n for (let i = 0, j = 0; i < vertices.length; i++, j += 3) {\n const x = vertices[i][0];\n const y = vertices[i][1];\n const z = vertices[i][2];\n vertices2.push([x, y, z]);\n }\n return vertices2;\n}\n\nfunction transformVertices(vertices, cityJSONTransform) {\n const scale = cityJSONTransform.scale || math.vec3([1, 1, 1]);\n const translate = cityJSONTransform.translate || math.vec3([0, 0, 0]);\n for (let i = 0; i < vertices.length; i++) {\n const vertex = vertices[i];\n vertex[0] = (vertex[0] * scale[0]) + translate[0];\n vertex[1] = (vertex[1] * scale[1]) + translate[1];\n vertex[2] = (vertex[2] * scale[2]) + translate[2];\n }\n}\n\nfunction centerVertices(vertices) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = vertices.length;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n centerPos[0] += vertex[0];\n centerPos[1] += vertex[1];\n centerPos[2] += vertex[2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n vertex[0] -= centerPos[0];\n vertex[1] -= centerPos[1];\n vertex[2] -= centerPos[2];\n }\n }\n}\n\nfunction customTransformVertices(vertices, transform) {\n if (transform) {\n const mat = math.mat4(transform);\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n math.transformPoint3(mat, vertex, vertex);\n }\n }\n}\n\nfunction parseCityJSON(ctx) {\n\n const data = ctx.data;\n const cityObjects = data.CityObjects;\n\n for (const objectId in cityObjects) {\n if (cityObjects.hasOwnProperty(objectId)) {\n const cityObject = cityObjects[objectId];\n parseCityObject(ctx, cityObject, objectId);\n }\n }\n}\n\nfunction parseCityObject(ctx, cityObject, objectId) {\n\n const xktModel = ctx.xktModel;\n const data = ctx.data;\n const metaObjectId = objectId;\n const metaObjectType = cityObject.type;\n const metaObjectName = metaObjectType + \" : \" + objectId;\n\n const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObjectId;\n\n xktModel.createMetaObject({\n metaObjectId,\n metaObjectName,\n metaObjectType,\n parentMetaObjectId\n });\n\n ctx.stats.numMetaObjects++;\n\n if (!(cityObject.geometry && cityObject.geometry.length > 0)) {\n return;\n }\n\n const meshIds = [];\n\n for (let i = 0, len = cityObject.geometry.length; i < len; i++) {\n\n const geometry = cityObject.geometry[i];\n\n let objectMaterial;\n let surfaceMaterials;\n\n const appearance = data.appearance;\n if (appearance) {\n const materials = appearance.materials;\n if (materials) {\n const geometryMaterial = geometry.material;\n if (geometryMaterial) {\n const themeIds = Object.keys(geometryMaterial);\n if (themeIds.length > 0) {\n const themeId = themeIds[0];\n const theme = geometryMaterial[themeId];\n if (theme.value !== undefined) {\n objectMaterial = materials[theme.value];\n } else {\n const values = theme.values;\n if (values) {\n surfaceMaterials = [];\n for (let j = 0, lenj = values.length; j < lenj; j++) {\n const value = values[i];\n const surfaceMaterial = materials[value];\n surfaceMaterials.push(surfaceMaterial);\n }\n }\n }\n }\n }\n }\n }\n\n if (surfaceMaterials) {\n parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds);\n\n } else {\n parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds);\n }\n }\n\n if (meshIds.length > 0) {\n xktModel.createEntity({\n entityId: objectId,\n meshIds: meshIds\n });\n\n ctx.stats.numObjects++;\n }\n}\n\nfunction parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) {\n\n const geomType = geometry.type;\n\n switch (geomType) {\n\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n break;\n\n case \"MultiSolid\":\n\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n}\n\nfunction parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) {\n\n const vertices = ctx.vertices;\n const xktModel = ctx.xktModel;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n const surface = surfaces[i];\n const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0};\n\n const face = [];\n const holes = [];\n\n const sharedIndices = [];\n\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n for (let j = 0; j < surface.length; j++) {\n\n if (face.length > 0) {\n holes.push(face.length);\n }\n\n const newFace = extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg);\n\n face.push(...newFace);\n }\n\n if (face.length === 3) { // Triangle\n\n geometryCfg.indices.push(face[0]);\n geometryCfg.indices.push(face[1]);\n geometryCfg.indices.push(face[2]);\n\n } else if (face.length > 3) { // Polygon\n\n // Prepare to triangulate\n\n const pList = [];\n\n for (let k = 0; k < face.length; k++) {\n pList.push({\n x: vertices[sharedIndices[face[k]]][0],\n y: vertices[sharedIndices[face[k]]][1],\n z: vertices[sharedIndices[face[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n\n // Convert to 2D\n\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n\n to2D(pList[k], normal, tempVec2a);\n\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n // Triangulate\n\n const tr = earcut(pv, holes, 2);\n\n // Create triangles\n\n for (let k = 0; k < tr.length; k += 3) {\n geometryCfg.indices.unshift(face[tr[k]]);\n geometryCfg.indices.unshift(face[tr[k + 1]]);\n geometryCfg.indices.unshift(face[tr[k + 2]]);\n }\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n}\n\nfunction parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) {\n\n const xktModel = ctx.xktModel;\n const sharedIndices = [];\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n const geomType = geometry.type;\n\n switch (geomType) {\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n break;\n\n case \"MultiSolid\":\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n}\n\nfunction parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) {\n\n const vertices = ctx.vertices;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n let boundary = [];\n let holes = [];\n\n for (let j = 0; j < surfaces[i].length; j++) {\n if (boundary.length > 0) {\n holes.push(boundary.length);\n }\n const newBoundary = extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg);\n boundary.push(...newBoundary);\n }\n\n if (boundary.length === 3) { // Triangle\n\n primitiveCfg.indices.push(boundary[0]);\n primitiveCfg.indices.push(boundary[1]);\n primitiveCfg.indices.push(boundary[2]);\n\n } else if (boundary.length > 3) { // Polygon\n\n let pList = [];\n\n for (let k = 0; k < boundary.length; k++) {\n pList.push({\n x: vertices[sharedIndices[boundary[k]]][0],\n y: vertices[sharedIndices[boundary[k]]][1],\n z: vertices[sharedIndices[boundary[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n to2D(pList[k], normal, tempVec2a);\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n const tr = earcut(pv, holes, 2);\n\n for (let k = 0; k < tr.length; k += 3) {\n primitiveCfg.indices.unshift(boundary[tr[k]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 1]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 2]]);\n }\n }\n }\n}\n\nfunction extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) {\n\n const vertices = ctx.vertices;\n const newBoundary = []\n\n for (let i = 0, len = boundary.length; i < len; i++) {\n\n const index = boundary[i];\n\n if (sharedIndices.includes(index)) {\n const vertexIndex = sharedIndices.indexOf(index);\n newBoundary.push(vertexIndex);\n\n } else {\n geometryCfg.positions.push(vertices[index][0]);\n geometryCfg.positions.push(vertices[index][1]);\n geometryCfg.positions.push(vertices[index][2]);\n\n newBoundary.push(sharedIndices.length);\n\n sharedIndices.push(index);\n }\n }\n\n return newBoundary\n}\n\nfunction getNormalOfPositions(positions, normal) {\n\n for (let i = 0; i < positions.length; i++) {\n\n let nexti = i + 1;\n if (nexti === positions.length) {\n nexti = 0;\n }\n\n normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z));\n normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x));\n normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y));\n }\n\n return math.normalizeVec3(normal);\n}\n\nfunction to2D(_p, _n, re) {\n\n const p = tempVec3a;\n const n = tempVec3b;\n const x3 = tempVec3c;\n\n p[0] = _p.x;\n p[1] = _p.y;\n p[2] = _p.z;\n\n n[0] = _n.x;\n n[1] = _n.y;\n n[2] = _n.z;\n\n x3[0] = 1.1;\n x3[1] = 1.1;\n x3[2] = 1.1;\n\n const dist = math.lenVec3(math.subVec3(x3, n));\n\n if (dist < 0.01) {\n x3[0] += 1.0;\n x3[1] += 2.0;\n x3[2] += 3.0;\n }\n\n const dot = math.dotVec3(x3, n);\n const tmp2 = math.mulVec3Scalar(n, dot, math.vec3());\n\n x3[0] -= tmp2[0];\n x3[1] -= tmp2[1];\n x3[2] -= tmp2[2];\n\n math.normalizeVec3(x3);\n\n const y3 = math.cross3Vec3(n, x3, math.vec3());\n const x = math.dotVec3(p, x3);\n const y = math.dotVec3(p, y3);\n\n re[0] = x;\n re[1] = y;\n}\n\nexport {parseCityJSONIntoXKTModel};","function isString(value) {\n return (typeof value === 'string' || value instanceof String);\n}\n\nfunction apply(o, o2) {\n for (const name in o) {\n if (o.hasOwnProperty(name)) {\n o2[name] = o[name];\n }\n }\n return o2;\n}\n\n/**\n * @private\n */\nconst utils = {\n isString,\n apply\n};\n\nexport {utils};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/gltf\");","import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nimport {parse} from '@loaders.gl/core';\nimport {GLTFLoader} from '@loaders.gl/gltf';\nimport {\n ClampToEdgeWrapping,\n LinearFilter,\n LinearMipMapLinearFilter,\n LinearMipMapNearestFilter,\n MirroredRepeatWrapping,\n NearestFilter,\n NearestMipMapLinearFilter,\n NearestMipMapNearestFilter,\n RepeatWrapping\n} from \"../constants.js\";\n\n/**\n * @desc Parses glTF into an {@link XKTModel}, supporting ````.glb```` and textures.\n *\n * * Supports ````.glb```` and textures\n * * For a lightweight glTF JSON parser that ignores textures, see {@link parseGLTFJSONIntoXKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a binary glTF model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"../assets/models/gltf/HousePlan/glTF-Binary/HousePlan.glb\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {ArrayBuffer} params.data The glTF.\n * @param {String} [params.baseUri] The base URI used to load this glTF, if any. For resolving relative uris to linked resources.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeTextures=true] Whether to parse textures.\n * @param {Boolean} [params.includeNormals=true] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the glTF.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when glTF has been parsed.\n */\nfunction parseGLTFIntoXKTModel({\n data,\n baseUri,\n xktModel,\n metaModelData,\n includeTextures = true,\n includeNormals = true,\n getAttachment,\n stats = {},\n log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n parse(data, GLTFLoader, {\n baseUri\n }).then((gltfData) => {\n\n const ctx = {\n gltfData,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n error: function (msg) {\n console.error(msg);\n },\n xktModel,\n includeNormals: (includeNormals !== false),\n includeTextures: (includeTextures !== false),\n geometryCreated: {},\n nextId: 0,\n stats\n };\n\n ctx.log(\"Using parser: parseGLTFIntoXKTModel\");\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n ctx.log(`Parsing textures: ${ctx.includeTextures ? \"enabled\" : \"disabled\"}`);\n\n if (ctx.includeTextures) {\n parseTextures(ctx);\n }\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(`[parseGLTFIntoXKTModel] ${errMsg}`);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n return {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n}\n\nfunction parseTextures(ctx) {\n const gltfData = ctx.gltfData;\n const textures = gltfData.textures;\n if (textures) {\n for (let i = 0, len = textures.length; i < len; i++) {\n parseTexture(ctx, textures[i]);\n ctx.stats.numTextures++;\n }\n }\n}\n\nfunction parseTexture(ctx, texture) {\n if (!texture.source || !texture.source.image) {\n return;\n }\n const textureId = `texture-${ctx.nextId++}`;\n\n let minFilter = NearestMipMapLinearFilter;\n switch (texture.sampler.minFilter) {\n case 9728:\n minFilter = NearestFilter;\n break;\n case 9729:\n minFilter = LinearFilter;\n break;\n case 9984:\n minFilter = NearestMipMapNearestFilter;\n break;\n case 9985:\n minFilter = LinearMipMapNearestFilter;\n break;\n case 9986:\n minFilter = NearestMipMapLinearFilter;\n break;\n case 9987:\n minFilter = LinearMipMapLinearFilter;\n break;\n }\n\n let magFilter = LinearFilter;\n switch (texture.sampler.magFilter) {\n case 9728:\n magFilter = NearestFilter;\n break;\n case 9729:\n magFilter = LinearFilter;\n break;\n }\n\n let wrapS = RepeatWrapping;\n switch (texture.sampler.wrapS) {\n case 33071:\n wrapS = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapS = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapS = RepeatWrapping;\n break;\n }\n\n let wrapT = RepeatWrapping;\n switch (texture.sampler.wrapT) {\n case 33071:\n wrapT = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapT = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapT = RepeatWrapping;\n break;\n }\n\n let wrapR = RepeatWrapping;\n switch (texture.sampler.wrapR) {\n case 33071:\n wrapR = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapR = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapR = RepeatWrapping;\n break;\n }\n\n ctx.xktModel.createTexture({\n textureId: textureId,\n imageData: texture.source.image,\n mediaType: texture.source.mediaType,\n compressed: true,\n width: texture.source.image.width,\n height: texture.source.image.height,\n minFilter,\n magFilter,\n wrapS,\n wrapT,\n wrapR,\n flipY: !!texture.flipY,\n // encoding: \"sRGB\"\n });\n texture._textureId = textureId;\n}\n\nfunction parseMaterials(ctx) {\n const gltfData = ctx.gltfData;\n const materials = gltfData.materials;\n if (materials) {\n for (let i = 0, len = materials.length; i < len; i++) {\n const material = materials[i];\n material._textureSetId = ctx.includeTextures ? parseTextureSet(ctx, material) : null;\n material._attributes = parseMaterialAttributes(ctx, material);\n }\n }\n}\n\nfunction parseTextureSet(ctx, material) {\n const textureSetCfg = {};\n if (material.normalTexture) {\n textureSetCfg.normalTextureId = material.normalTexture.texture._textureId;\n }\n if (material.occlusionTexture) {\n textureSetCfg.occlusionTextureId = material.occlusionTexture.texture._textureId;\n }\n if (material.emissiveTexture) {\n textureSetCfg.emissiveTextureId = material.emissiveTexture.texture._textureId;\n }\n // const alphaMode = material.alphaMode;\n // switch (alphaMode) {\n // case \"NORMAL_OPAQUE\":\n // materialCfg.alphaMode = \"opaque\";\n // break;\n // case \"MASK\":\n // materialCfg.alphaMode = \"mask\";\n // break;\n // case \"BLEND\":\n // materialCfg.alphaMode = \"blend\";\n // break;\n // default:\n // }\n // const alphaCutoff = material.alphaCutoff;\n // if (alphaCutoff !== undefined) {\n // materialCfg.alphaCutoff = alphaCutoff;\n // }\n const metallicPBR = material.pbrMetallicRoughness;\n if (material.pbrMetallicRoughness) {\n const pbrMetallicRoughness = material.pbrMetallicRoughness;\n const baseColorTexture = pbrMetallicRoughness.baseColorTexture || pbrMetallicRoughness.colorTexture;\n if (baseColorTexture) {\n if (baseColorTexture.texture) {\n textureSetCfg.colorTextureId = baseColorTexture.texture._textureId;\n } else {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[baseColorTexture.index]._textureId;\n }\n }\n if (metallicPBR.metallicRoughnessTexture) {\n textureSetCfg.metallicRoughnessTextureId = metallicPBR.metallicRoughnessTexture.texture._textureId;\n }\n }\n const extensions = material.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const specularTexture = specularPBR.specularTexture;\n if (specularTexture !== null && specularTexture !== undefined) {\n // textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n const specularColorTexture = specularPBR.specularColorTexture;\n if (specularColorTexture !== null && specularColorTexture !== undefined) {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n }\n }\n if (textureSetCfg.normalTextureId !== undefined ||\n textureSetCfg.occlusionTextureId !== undefined ||\n textureSetCfg.emissiveTextureId !== undefined ||\n textureSetCfg.colorTextureId !== undefined ||\n textureSetCfg.metallicRoughnessTextureId !== undefined) {\n textureSetCfg.textureSetId = `textureSet-${ctx.nextId++};`\n ctx.xktModel.createTextureSet(textureSetCfg);\n ctx.stats.numTextureSets++;\n return textureSetCfg.textureSetId;\n }\n return null;\n}\n\nfunction parseMaterialAttributes(ctx, material) { // Substitute RGBA for material, to use fast flat shading instead\n const extensions = material.extensions;\n const materialAttributes = {\n color: new Float32Array([1, 1, 1, 1]),\n opacity: 1,\n metallic: 0,\n roughness: 1\n };\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n materialAttributes.color.set(diffuseFactor);\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n materialAttributes.color.set(diffuse);\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n materialAttributes.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n materialAttributes.opacity = transparent;\n }\n }\n }\n const metallicPBR = material.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n materialAttributes.color[0] = baseColorFactor[0];\n materialAttributes.color[1] = baseColorFactor[1];\n materialAttributes.color[2] = baseColorFactor[2];\n materialAttributes.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n materialAttributes.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n materialAttributes.roughness = roughnessFactor;\n }\n }\n return materialAttributes;\n}\n\nfunction parseDefaultScene(ctx) {\n const gltfData = ctx.gltfData;\n const scene = gltfData.scene || gltfData.scenes[0];\n if (!scene) {\n ctx.error(\"glTF has no default scene\");\n return;\n }\n parseScene(ctx, scene);\n}\n\nfunction parseScene(ctx, scene) {\n const nodes = scene.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n countMeshUsage(ctx, node);\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n parseNode(ctx, node, 0, null);\n }\n}\n\nfunction countMeshUsage(ctx, node) {\n const mesh = node.mesh;\n if (mesh) {\n mesh.instances = mesh.instances ? mesh.instances + 1 : 1;\n }\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n if (!childNode) {\n ctx.error(\"Node not found: \" + i);\n continue;\n }\n countMeshUsage(ctx, childNode);\n }\n }\n}\n\nconst deferredMeshIds = [];\n\nfunction parseNode(ctx, node, depth, matrix) {\n\n const xktModel = ctx.xktModel;\n\n // Pre-order visit scene node\n\n let localMatrix;\n if (node.matrix) {\n localMatrix = node.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.translation) {\n localMatrix = math.translationMat4v(node.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.rotation) {\n localMatrix = math.quaternionToMat4(node.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.scale) {\n localMatrix = math.scalingMat4v(node.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (node.mesh) {\n\n const mesh = node.mesh;\n const numPrimitives = mesh.primitives.length;\n\n if (numPrimitives > 0) {\n for (let i = 0; i < numPrimitives; i++) {\n const primitive = mesh.primitives[i];\n if (!primitive._xktGeometryId) {\n const xktGeometryId = \"geometry-\" + ctx.nextId++;\n const geometryCfg = {\n geometryId: xktGeometryId\n };\n switch (primitive.mode) {\n case 0: // POINTS\n geometryCfg.primitiveType = \"points\";\n break;\n case 1: // LINES\n geometryCfg.primitiveType = \"lines\";\n break;\n case 2: // LINE_LOOP\n geometryCfg.primitiveType = \"line-loop\";\n break;\n case 3: // LINE_STRIP\n geometryCfg.primitiveType = \"line-strip\";\n break;\n case 4: // TRIANGLES\n geometryCfg.primitiveType = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n geometryCfg.primitiveType = \"triangle-strip\";\n break;\n case 6: // TRIANGLE_FAN\n geometryCfg.primitiveType = \"triangle-fan\";\n break;\n default:\n geometryCfg.primitiveType = \"triangles\";\n }\n const POSITION = primitive.attributes.POSITION;\n if (!POSITION) {\n continue;\n }\n geometryCfg.positions = primitive.attributes.POSITION.value;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n if (ctx.includeNormals) {\n if (primitive.attributes.NORMAL) {\n geometryCfg.normals = primitive.attributes.NORMAL.value;\n ctx.stats.numNormals += geometryCfg.normals.length / 3;\n }\n }\n if (primitive.attributes.COLOR_0) {\n geometryCfg.colorsCompressed = primitive.attributes.COLOR_0.value;\n }\n if (ctx.includeTextures) {\n if (primitive.attributes.TEXCOORD_0) {\n geometryCfg.uvs = primitive.attributes.TEXCOORD_0.value;\n ctx.stats.numUVs += geometryCfg.uvs.length / 2;\n }\n }\n if (primitive.indices) {\n geometryCfg.indices = primitive.indices.value;\n if (primitive.mode === 4) {\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n }\n xktModel.createGeometry(geometryCfg);\n primitive._xktGeometryId = xktGeometryId;\n ctx.stats.numGeometries++;\n }\n\n const xktMeshId = ctx.nextId++;\n const meshCfg = {\n meshId: xktMeshId,\n geometryId: primitive._xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4()\n };\n const material = primitive.material;\n if (material) {\n meshCfg.textureSetId = material._textureSetId;\n meshCfg.color = material._attributes.color;\n meshCfg.opacity = material._attributes.opacity;\n meshCfg.metallic = material._attributes.metallic;\n meshCfg.roughness = material._attributes.roughness;\n } else {\n meshCfg.color = [1.0, 1.0, 1.0];\n meshCfg.opacity = 1.0;\n }\n xktModel.createMesh(meshCfg);\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n\n // Visit child scene nodes\n\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n parseNode(ctx, childNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = node.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (!!xktEntityId && xktModel.entities[xktEntityId]) {\n ctx.log(`Warning: Two or more glTF nodes found with same 'name' attribute: '${nodeName} - will randomly-generating an object ID in XKT`);\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n if (ctx.metaModelCorrections) {\n // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n } else {\n // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n}\n\nexport {parseGLTFIntoXKTModel};\n","import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nconst atob2 = (typeof atob !== 'undefined') ? atob : a => Buffer.from(a, 'base64').toString('binary');\n\nconst WEBGL_COMPONENT_TYPES = {\n 5120: Int8Array,\n 5121: Uint8Array,\n 5122: Int16Array,\n 5123: Uint16Array,\n 5125: Uint32Array,\n 5126: Float32Array\n};\n\nconst WEBGL_TYPE_SIZES = {\n 'SCALAR': 1,\n 'VEC2': 2,\n 'VEC3': 3,\n 'VEC4': 4,\n 'MAT2': 4,\n 'MAT3': 9,\n 'MAT4': 16\n};\n\n/**\n * @desc Parses glTF JSON into an {@link XKTModel}, without ````.glb```` and textures.\n *\n * * Lightweight JSON-based glTF parser which ignores textures\n * * For texture and ````.glb```` support, see {@link parseGLTFIntoXKTModel}\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a glTF model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/gltf/duplex/scene.gltf\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {Object} params.data The glTF JSON.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeNormals=false] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded representation of the glTF.\n * @param {Boolean} [params.reuseGeometries=true] When true, the parser will enable geometry reuse within the XKTModel. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be if we have 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {function} [params.getAttachment] Callback through which to fetch attachments, if the glTF has them.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise}\n */\nfunction parseGLTFJSONIntoXKTModel({\n data,\n xktModel,\n metaModelData,\n includeNormals,\n reuseGeometries,\n getAttachment,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseGLTFJSONIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const ctx = {\n gltf: data,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n xktModel,\n includeNormals,\n createXKTGeometryIds: {},\n nextMeshId: 0,\n reuseGeometries: (reuseGeometries !== false),\n stats\n };\n\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n\n parseBuffers(ctx).then(() => {\n\n parseBufferViews(ctx);\n freeBuffers(ctx);\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n const metaModelCorrections = {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n return metaModelCorrections;\n}\n\nfunction parseBuffers(ctx) { // Parses geometry buffers into temporary \"_buffer\" Unit8Array properties on the glTF \"buffer\" elements\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n return Promise.all(buffers.map(buffer => parseBuffer(ctx, buffer)));\n } else {\n return new Promise(function (resolve, reject) {\n resolve();\n });\n }\n}\n\nfunction parseBuffer(ctx, bufferInfo) {\n return new Promise(function (resolve, reject) {\n // Allow a shortcut where the glTF buffer is \"enrichened\" with direct\n // access to the data-arrayBuffer, w/out needing to either:\n // - read the file indicated by the \".uri\" component of the buffer\n // - base64-decode the encoded data in the \".uri\" component\n if (bufferInfo._arrayBuffer) {\n bufferInfo._buffer = bufferInfo._arrayBuffer;\n resolve(bufferInfo);\n return;\n }\n // Otherwise, proceed with \"standard-glTF\" .uri component.\n const uri = bufferInfo.uri;\n if (!uri) {\n reject('gltf/handleBuffer missing uri in ' + JSON.stringify(bufferInfo));\n return;\n }\n parseArrayBuffer(ctx, uri).then((arrayBuffer) => {\n bufferInfo._buffer = arrayBuffer;\n resolve(arrayBuffer);\n }, (errMsg) => {\n reject(errMsg);\n })\n });\n}\n\nfunction parseArrayBuffer(ctx, uri) {\n return new Promise(function (resolve, reject) {\n const dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; // Check for data: URI\n const dataUriRegexResult = uri.match(dataUriRegex);\n if (dataUriRegexResult) { // Safari can't handle data URIs through XMLHttpRequest\n const isBase64 = !!dataUriRegexResult[2];\n let data = dataUriRegexResult[3];\n data = decodeURIComponent(data);\n if (isBase64) {\n data = atob2(data);\n }\n const buffer = new ArrayBuffer(data.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < data.length; i++) {\n view[i] = data.charCodeAt(i);\n }\n resolve(buffer);\n } else { // Uri is a path to a file\n ctx.getAttachment(uri).then(\n (arrayBuffer) => {\n resolve(arrayBuffer);\n },\n (errMsg) => {\n reject(errMsg);\n });\n }\n });\n}\n\nfunction parseBufferViews(ctx) { // Parses our temporary \"_buffer\" properties into \"_buffer\" properties on glTF \"bufferView\" elements\n const bufferViewsInfo = ctx.gltf.bufferViews;\n if (bufferViewsInfo) {\n for (let i = 0, len = bufferViewsInfo.length; i < len; i++) {\n parseBufferView(ctx, bufferViewsInfo[i]);\n }\n }\n}\n\nfunction parseBufferView(ctx, bufferViewInfo) {\n const buffer = ctx.gltf.buffers[bufferViewInfo.buffer];\n bufferViewInfo._typedArray = null;\n const byteLength = bufferViewInfo.byteLength || 0;\n const byteOffset = bufferViewInfo.byteOffset || 0;\n bufferViewInfo._buffer = buffer._buffer.slice(byteOffset, byteOffset + byteLength);\n}\n\nfunction freeBuffers(ctx) { // Deletes the \"_buffer\" properties from the glTF \"buffer\" elements, to save memory\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n for (let i = 0, len = buffers.length; i < len; i++) {\n buffers[i]._buffer = null;\n }\n }\n}\n\nfunction parseMaterials(ctx) {\n const materialsInfo = ctx.gltf.materials;\n if (materialsInfo) {\n for (let i = 0, len = materialsInfo.length; i < len; i++) {\n const materialInfo = materialsInfo[i];\n const material = parseMaterial(ctx, materialInfo);\n materialInfo._materialData = material;\n }\n }\n}\n\nfunction parseMaterial(ctx, materialInfo) { // Attempts to extract an RGBA color for a glTF material\n const material = {\n color: new Float32Array([1, 1, 1]),\n opacity: 1.0,\n metallic: 0,\n roughness: 1\n };\n const extensions = materialInfo.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n material.color[0] = diffuseFactor[0];\n material.color[1] = diffuseFactor[1];\n material.color[2] = diffuseFactor[2];\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n material.color[0] = diffuse[0];\n material.color[1] = diffuse[1];\n material.color[2] = diffuse[2];\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n material.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n material.opacity = transparent;\n }\n }\n }\n const metallicPBR = materialInfo.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n material.color[0] = baseColorFactor[0];\n material.color[1] = baseColorFactor[1];\n material.color[2] = baseColorFactor[2];\n material.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n material.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n material.roughness = roughnessFactor;\n }\n }\n return material;\n}\n\nfunction parseDefaultScene(ctx) {\n const scene = ctx.gltf.scene || 0;\n const defaultSceneInfo = ctx.gltf.scenes[scene];\n if (!defaultSceneInfo) {\n throw new Error(\"glTF has no default scene\");\n }\n parseScene(ctx, defaultSceneInfo);\n}\n\n\nfunction parseScene(ctx, sceneInfo) {\n const nodes = sceneInfo.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const glTFNode = ctx.gltf.nodes[nodes[i]];\n if (glTFNode) {\n parseNode(ctx, glTFNode, 0, null);\n }\n }\n}\n\nlet deferredMeshIds = [];\n\nfunction parseNode(ctx, glTFNode, depth, matrix) {\n\n const gltf = ctx.gltf;\n const xktModel = ctx.xktModel;\n\n let localMatrix;\n\n if (glTFNode.matrix) {\n localMatrix = glTFNode.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.translation) {\n localMatrix = math.translationMat4v(glTFNode.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.rotation) {\n localMatrix = math.quaternionToMat4(glTFNode.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.scale) {\n localMatrix = math.scalingMat4v(glTFNode.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n const gltfMeshId = glTFNode.mesh;\n\n if (gltfMeshId !== undefined) {\n\n const meshInfo = gltf.meshes[gltfMeshId];\n\n if (meshInfo) {\n\n const numPrimitivesInMesh = meshInfo.primitives.length;\n\n if (numPrimitivesInMesh > 0) {\n\n for (let i = 0; i < numPrimitivesInMesh; i++) {\n\n const primitiveInfo = meshInfo.primitives[i];\n\n const geometryHash = createPrimitiveGeometryHash(primitiveInfo);\n\n let xktGeometryId = ctx.createXKTGeometryIds[geometryHash];\n\n if ((!ctx.reuseGeometries) || !xktGeometryId) {\n\n xktGeometryId = \"geometry-\" + ctx.nextMeshId++\n\n const geometryArrays = {};\n\n parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays);\n\n const colors = geometryArrays.colors;\n\n let colorsCompressed;\n\n if (geometryArrays.colors) {\n colorsCompressed = [];\n for (let j = 0, lenj = colors.length; j < lenj; j += 4) {\n colorsCompressed.push(colors[j + 0]);\n colorsCompressed.push(colors[j + 1]);\n colorsCompressed.push(colors[j + 2]);\n colorsCompressed.push(255);\n }\n }\n\n xktModel.createGeometry({\n geometryId: xktGeometryId,\n primitiveType: geometryArrays.primitive,\n positions: geometryArrays.positions,\n normals: ctx.includeNormals ? geometryArrays.normals : null,\n colorsCompressed: colorsCompressed,\n indices: geometryArrays.indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryArrays.positions ? geometryArrays.positions.length / 3 : 0;\n ctx.stats.numNormals += (ctx.includeNormals && geometryArrays.normals) ? geometryArrays.normals.length / 3 : 0;\n ctx.stats.numTriangles += geometryArrays.indices ? geometryArrays.indices.length / 3 : 0;\n\n ctx.createXKTGeometryIds[geometryHash] = xktGeometryId;\n } else {\n// Geometry reused\n }\n\n const materialIndex = primitiveInfo.material;\n const materialInfo = (materialIndex !== null && materialIndex !== undefined) ? gltf.materials[materialIndex] : null;\n const color = materialInfo ? materialInfo._materialData.color : new Float32Array([1.0, 1.0, 1.0, 1.0]);\n const opacity = materialInfo ? materialInfo._materialData.opacity : 1.0;\n const metallic = materialInfo ? materialInfo._materialData.metallic : 0.0;\n const roughness = materialInfo ? materialInfo._materialData.roughness : 1.0;\n\n const xktMeshId = \"mesh-\" + ctx.nextMeshId++;\n\n xktModel.createMesh({\n meshId: xktMeshId,\n geometryId: xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4(),\n color: color,\n opacity: opacity,\n metallic: metallic,\n roughness: roughness\n });\n\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n }\n\n\n if (glTFNode.children) {\n const children = glTFNode.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNodeIdx = children[i];\n const childGLTFNode = gltf.nodes[childNodeIdx];\n if (!childGLTFNode) {\n console.warn('Node not found: ' + i);\n continue;\n }\n parseNode(ctx, childGLTFNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = glTFNode.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`[parseGLTFJSONIntoXKTModel] Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (xktEntityId === undefined || xktEntityId === null) {\n if (xktModel.entities[xktEntityId]) {\n ctx.error(\"Two or more glTF nodes found with same 'name' attribute: '\" + nodeName + \"'\");\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n }\n if (ctx.metaModelCorrections) { // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n } else { // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n}\n\nfunction createPrimitiveGeometryHash(primitiveInfo) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return \"empty\";\n }\n const mode = primitiveInfo.mode;\n const material = primitiveInfo.material;\n const indices = primitiveInfo.indices;\n const positions = primitiveInfo.attributes.POSITION;\n const normals = primitiveInfo.attributes.NORMAL;\n const colors = primitiveInfo.attributes.COLOR_0;\n const uv = primitiveInfo.attributes.TEXCOORD_0;\n return [\n mode,\n // material,\n (indices !== null && indices !== undefined) ? indices : \"-\",\n (positions !== null && positions !== undefined) ? positions : \"-\",\n (normals !== null && normals !== undefined) ? normals : \"-\",\n (colors !== null && colors !== undefined) ? colors : \"-\",\n (uv !== null && uv !== undefined) ? uv : \"-\"\n ].join(\";\");\n}\n\nfunction parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return;\n }\n switch (primitiveInfo.mode) {\n case 0: // POINTS\n geometryArrays.primitive = \"points\";\n break;\n case 1: // LINES\n geometryArrays.primitive = \"lines\";\n break;\n case 2: // LINE_LOOP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 3: // LINE_STRIP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 4: // TRIANGLES\n geometryArrays.primitive = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n // TODO: convert\n console.log(\"TRIANGLE_STRIP\");\n geometryArrays.primitive = \"triangles\";\n break;\n case 6: // TRIANGLE_FAN\n // TODO: convert\n console.log(\"TRIANGLE_FAN\");\n geometryArrays.primitive = \"triangles\";\n break;\n default:\n geometryArrays.primitive = \"triangles\";\n }\n const accessors = ctx.gltf.accessors;\n const indicesIndex = primitiveInfo.indices;\n if (indicesIndex !== null && indicesIndex !== undefined) {\n const accessorInfo = accessors[indicesIndex];\n geometryArrays.indices = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const positionsIndex = attributes.POSITION;\n if (positionsIndex !== null && positionsIndex !== undefined) {\n const accessorInfo = accessors[positionsIndex];\n geometryArrays.positions = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const normalsIndex = attributes.NORMAL;\n if (normalsIndex !== null && normalsIndex !== undefined) {\n const accessorInfo = accessors[normalsIndex];\n geometryArrays.normals = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const colorsIndex = attributes.COLOR_0;\n if (colorsIndex !== null && colorsIndex !== undefined) {\n const accessorInfo = accessors[colorsIndex];\n geometryArrays.colors = parseAccessorTypedArray(ctx, accessorInfo);\n }\n}\n\nfunction parseAccessorTypedArray(ctx, accessorInfo) {\n const bufferView = ctx.gltf.bufferViews[accessorInfo.bufferView];\n const itemSize = WEBGL_TYPE_SIZES[accessorInfo.type];\n const TypedArray = WEBGL_COMPONENT_TYPES[accessorInfo.componentType];\n const elementBytes = TypedArray.BYTES_PER_ELEMENT; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n const itemBytes = elementBytes * itemSize;\n if (accessorInfo.byteStride && accessorInfo.byteStride !== itemBytes) { // The buffer is not interleaved if the stride is the item size in bytes.\n throw new Error(\"interleaved buffer!\"); // TODO\n } else {\n return new TypedArray(bufferView._buffer, accessorInfo.byteOffset || 0, accessorInfo.count * itemSize);\n }\n}\n\nexport {parseGLTFJSONIntoXKTModel};\n","/**\n * @desc Parses IFC STEP file data into an {@link XKTModel}.\n *\n * This function uses [web-ifc](https://github.com/tomvandig/web-ifc) to parse the IFC, which relies on a\n * WASM file to do the parsing.\n *\n * Depending on how we use this function, we may need to provide it with a path to the directory where that WASM file is stored.\n *\n * This function is tested with web-ifc version 0.0.34.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an IFC model into it.\n *\n * ````javascript\n * import {XKTModel, parseIFCIntoXKTModel, writeXKTModelToArrayBuffer} from \"xeokit-convert.es.js\";\n *\n * import * as WebIFC from \"web-ifc-api.js\";\n *\n * utils.loadArraybuffer(\"rac_advanced_sample_project.ifc\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseIFCIntoXKTModel({\n * WebIFC,\n * data,\n * xktModel,\n * wasmPath: \"../dist/\",\n * autoNormals: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {ArrayBuffer} [params.data] IFC file data.\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Boolean} [params.autoNormals=true] When true, the parser will ignore the IFC geometry normals, and the IFC\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the IFC model. This is ````true```` by default, because IFC models tend to look acceptable with flat-shading,\n * and we always want to minimize IFC model size wherever possible.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {String} params.wasmPath Path to ````web-ifc.wasm````, required by this function.\n * @param {Object} [params.stats={}] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when IFC has been parsed.\n */\nfunction parseIFCIntoXKTModel({\n WebIFC,\n data,\n xktModel,\n autoNormals = true,\n includeTypes,\n excludeTypes,\n wasmPath,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseIFCIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n if (!wasmPath) {\n reject(\"Argument expected: wasmPath\");\n return;\n }\n\n const ifcAPI = new WebIFC.IfcAPI();\n\n if (wasmPath) {\n ifcAPI.SetWasmPath(wasmPath);\n }\n\n ifcAPI.Init().then(() => {\n\n const dataArray = new Uint8Array(data);\n\n const modelID = ifcAPI.OpenModel(dataArray);\n\n stats.sourceFormat = \"IFC\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n\n const ctx = {\n WebIFC,\n modelID,\n ifcAPI,\n xktModel,\n autoNormals,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n if (includeTypes) {\n ctx.includeTypes = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n ctx.includeTypes[includeTypes[i]] = true;\n }\n }\n\n if (excludeTypes) {\n ctx.excludeTypes = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n ctx.excludeTypes[excludeTypes[i]] = true;\n }\n }\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(modelID, WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(modelID, ifcProjectId);\n\n ctx.xktModel.schema = \"\";\n ctx.xktModel.modelId = \"\" + modelID;\n ctx.xktModel.projectId = \"\" + ifcProjectId;\n\n parseMetadata(ctx);\n parseGeometry(ctx);\n parsePropertySets(ctx);\n\n resolve();\n\n }).catch((e) => {\n\n reject(e);\n })\n });\n}\n\nfunction parsePropertySets(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCRELDEFINESBYPROPERTIES);\n\n for (let i = 0; i < lines.size(); i++) {\n\n let relID = lines.get(i);\n\n let rel = ctx.ifcAPI.GetLine(ctx.modelID, relID, true);\n\n if (rel) {\n\n const relatingPropertyDefinition = rel.RelatingPropertyDefinition;\n if (!relatingPropertyDefinition) {\n continue;\n }\n\n const propertySetId = relatingPropertyDefinition.GlobalId.value;\n\n const relatedObjects = rel.RelatedObjects;\n if (relatedObjects) {\n for (let i = 0, len = relatedObjects.length; i < len; i++) {\n const relatedObject = relatedObjects[i];\n const metaObjectId = relatedObject.GlobalId.value;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n if (metaObject) {\n if (!metaObject.propertySetIds) {\n metaObject.propertySetIds = [];\n }\n metaObject.propertySetIds.push(propertySetId);\n }\n }\n }\n\n const props = relatingPropertyDefinition.HasProperties;\n if (props && props.length > 0) {\n const propertySetType = \"Default\";\n const propertySetName = relatingPropertyDefinition.Name.value;\n const properties = [];\n for (let i = 0, len = props.length; i < len; i++) {\n const prop = props[i];\n const name = prop.Name;\n const nominalValue = prop.NominalValue;\n if (name && nominalValue) {\n const property = {\n name: name.value,\n type: nominalValue.type,\n value: nominalValue.value,\n valueType: nominalValue.valueType\n };\n if (prop.Description) {\n property.description = prop.Description.value;\n } else if (nominalValue.description) {\n property.description = nominalValue.description;\n }\n properties.push(property);\n }\n }\n ctx.xktModel.createPropertySet({propertySetId, propertySetType, propertySetName, properties});\n ctx.stats.numPropertySets++;\n }\n }\n }\n}\n\nfunction parseMetadata(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(ctx.modelID, ifcProjectId);\n\n parseSpatialChildren(ctx, ifcProject);\n}\n\nfunction parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectType = ifcElement.__proto__.constructor.name;\n\n if (ctx.includeTypes && (!ctx.includeTypes[metaObjectType])) {\n return;\n }\n\n if (ctx.excludeTypes && ctx.excludeTypes[metaObjectType]) {\n return;\n }\n\n createMetaObject(ctx, ifcElement, parentMetaObjectId);\n\n const metaObjectId = ifcElement.GlobalId.value;\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingObject',\n 'RelatedObjects',\n ctx.WebIFC.IFCRELAGGREGATES,\n metaObjectId);\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingStructure',\n 'RelatedElements',\n ctx.WebIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,\n metaObjectId);\n}\n\nfunction createMetaObject(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectId = ifcElement.GlobalId.value;\n const propertySetIds = null;\n const metaObjectType = ifcElement.__proto__.constructor.name;\n const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== \"\") ? ifcElement.Name.value : metaObjectType;\n\n ctx.xktModel.createMetaObject({metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId});\n ctx.stats.numMetaObjects++;\n}\n\nfunction parseRelatedItemsOfType(ctx, id, relation, related, type, parentMetaObjectId) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, type);\n\n for (let i = 0; i < lines.size(); i++) {\n\n const relID = lines.get(i);\n const rel = ctx.ifcAPI.GetLine(ctx.modelID, relID);\n const relatedItems = rel[relation];\n\n let foundElement = false;\n\n if (Array.isArray(relatedItems)) {\n const values = relatedItems.map((item) => item.value);\n foundElement = values.includes(id);\n\n } else {\n foundElement = (relatedItems.value === id);\n }\n\n if (foundElement) {\n\n const element = rel[related];\n\n if (!Array.isArray(element)) {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n\n } else {\n\n element.forEach((element2) => {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element2.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n });\n }\n }\n }\n}\n\nfunction parseGeometry(ctx) {\n\n // Parses the geometry and materials in the IFC, creates\n // XKTEntity, XKTMesh and XKTGeometry components within the XKTModel.\n\n const flatMeshes = ctx.ifcAPI.LoadAllGeometry(ctx.modelID);\n\n for (let i = 0, len = flatMeshes.size(); i < len; i++) {\n const flatMesh = flatMeshes.get(i);\n createObject(ctx, flatMesh);\n }\n\n // LoadAllGeometry does not return IFCSpace meshes\n // here is a workaround\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCSPACE);\n for (let j = 0, len = lines.size(); j < len; j++) {\n const ifcSpaceId = lines.get(j);\n const flatMesh = ctx.ifcAPI.GetFlatMesh(ctx.modelID, ifcSpaceId);\n createObject(ctx, flatMesh);\n }\n}\n\nfunction createObject(ctx, flatMesh) {\n\n const flatMeshExpressID = flatMesh.expressID;\n const placedGeometries = flatMesh.geometries;\n\n const meshIds = [];\n\n const properties = ctx.ifcAPI.GetLine(ctx.modelID, flatMeshExpressID);\n const entityId = properties.GlobalId.value;\n\n const metaObjectId = entityId;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n\n if (ctx.includeTypes && (!metaObject || (!ctx.includeTypes[metaObject.metaObjectType]))) {\n return;\n }\n\n if (ctx.excludeTypes && (!metaObject || ctx.excludeTypes[metaObject.metaObjectType])) {\n console.log(\"excluding: \" + metaObjectId)\n return;\n }\n\n for (let j = 0, lenj = placedGeometries.size(); j < lenj; j++) {\n\n const placedGeometry = placedGeometries.get(j);\n const geometryId = \"\" + placedGeometry.geometryExpressID;\n\n if (!ctx.xktModel.geometries[geometryId]) {\n\n const geometry = ctx.ifcAPI.GetGeometry(ctx.modelID, placedGeometry.geometryExpressID);\n const vertexData = ctx.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());\n const indices = ctx.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());\n\n // De-interleave vertex arrays\n\n const positions = [];\n const normals = [];\n\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n positions.push(vertexData[k * 6 + 0]);\n positions.push(vertexData[k * 6 + 1]);\n positions.push(vertexData[k * 6 + 2]);\n }\n\n if (!ctx.autoNormals) {\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n normals.push(vertexData[k * 6 + 3]);\n normals.push(vertexData[k * 6 + 4]);\n normals.push(vertexData[k * 6 + 5]);\n }\n }\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: ctx.autoNormals ? null : normals,\n indices: indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += (positions.length / 3);\n ctx.stats.numTriangles += (indices.length / 3);\n }\n\n const meshId = (\"mesh\" + ctx.nextId++);\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n matrix: placedGeometry.flatTransformation,\n color: [placedGeometry.color.x, placedGeometry.color.y, placedGeometry.color.z],\n opacity: placedGeometry.color.w\n });\n\n meshIds.push(meshId);\n }\n\n if (meshIds.length > 0) {\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: meshIds\n });\n ctx.stats.numObjects++;\n }\n}\n\nexport {parseIFCIntoXKTModel};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/las\");","import {parse} from '@loaders.gl/core';\nimport {LASLoader} from '@loaders.gl/las';\n\nimport {math} from \"../lib/math.js\";\n\nconst MAX_VERTICES = 500000; // TODO: Rough estimate\n\n/**\n * @desc Parses LAS and LAZ point cloud data into an {@link XKTModel}.\n *\n * This parser handles both the LASER file format (LAS) and its compressed version (LAZ),\n * a public format for the interchange of 3-dimensional point cloud data data, developed\n * for LIDAR mapping purposes.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/laz/autzen.laz\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parseLASIntoXKTModel({\n * data,\n * xktModel,\n * rotateX: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data LAS/LAZ file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the LAS point positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform point positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Number|String} [params.colorDepth=8] Whether colors encoded using 8 or 16 bits. Can be set to 'auto'. LAS specification recommends 16 bits.\n * @param {Boolean} [params.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.\n * @param {Number} [params.skip=1] Read one from every n points.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when LAS has been parsed.\n */\nfunction parseLASIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n colorDepth = \"auto\",\n fp64 = false,\n skip = 1,\n stats,\n log = () => {\n }\n }) {\n\n if (log) {\n log(\"Using parser: parseLASIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n log(\"Converting LAZ/LAS\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n log(`colorDepth: ${colorDepth}`);\n log(`fp64: ${fp64}`);\n log(`skip: ${skip}`);\n\n parse(data, LASLoader, {\n las: {\n colorDepth,\n fp64\n }\n }).then((parsedData) => {\n\n const attributes = parsedData.attributes;\n\n const loaderData = parsedData.loaderData;\n const pointsFormatId = loaderData.pointsFormatId !== undefined ? loaderData.pointsFormatId : -1;\n\n if (!attributes.POSITION) {\n log(\"No positions found in file (expected for all LAS point formats)\");\n return;\n }\n\n let readAttributes = {};\n\n switch (pointsFormatId) {\n case 0:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 0)\");\n return;\n }\n\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 1:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 1)\");\n return;\n }\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 2:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 2)\");\n return;\n }\n\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n case 3:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 3)\");\n return;\n }\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n }\n\n const pointsChunks = chunkArray(readPositions(readAttributes.positions), MAX_VERTICES * 3);\n const colorsChunks = chunkArray(readAttributes.colors, MAX_VERTICES * 4);\n\n const meshIds = [];\n\n for (let j = 0, lenj = pointsChunks.length; j < lenj; j++) {\n\n const geometryId = `geometry-${j}`;\n const meshId = `mesh-${j}`;\n\n meshIds.push(meshId);\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"points\",\n positions: pointsChunks[j],\n colorsCompressed: colorsChunks[j]\n });\n\n xktModel.createMesh({\n meshId,\n geometryId\n });\n }\n\n const entityId = math.createUUID();\n\n xktModel.createEntity({\n entityId,\n meshIds\n });\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"PointCloud\",\n metaObjectName: \"PointCloud (LAZ)\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n if (stats) {\n stats.sourceFormat = \"LAS\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = readAttributes.positions.length / 3;\n }\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n\n function readPositions(positionsValue) {\n if (positionsValue) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = positionsValue.length;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n centerPos[0] += positionsValue[i + 0];\n centerPos[1] += positionsValue[i + 1];\n centerPos[2] += positionsValue[i + 2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n positionsValue[i + 0] -= centerPos[0];\n positionsValue[i + 1] -= centerPos[1];\n positionsValue[i + 2] -= centerPos[2];\n }\n }\n if (transform) {\n const mat = math.mat4(transform);\n const pos = math.vec3();\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n pos[0] = positionsValue[i + 0];\n pos[1] = positionsValue[i + 1];\n pos[2] = positionsValue[i + 2];\n math.transformPoint3(mat, pos, pos);\n positionsValue[i + 0] = pos[0];\n positionsValue[i + 1] = pos[1];\n positionsValue[i + 2] = pos[2];\n }\n }\n }\n return positionsValue;\n }\n\n function readColorsAndIntensities(attributesPosition, attributesColor, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const colors = attributesColor.value;\n const colorSize = attributesColor.size;\n const intensities = attributesIntensity.value;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n=0,len = intensities.length; i < len; i++, k += colorSize, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = colors[k + 0];\n colorsCompressed[m++] = colors[k + 1];\n colorsCompressed[m++] = colors[k + 2];\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function readIntensities(attributesPosition, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const intensities = attributesIntensity.intensity;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, len = intensities.length; i < len; i++, k += 3, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function chunkArray(array, chunkSize) {\n if (chunkSize >= array.length) {\n return [array]; // One chunk\n }\n let result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n }\n\n}\n\nexport {parseLASIntoXKTModel};","/**\n * @desc Parses JSON metamodel into an {@link XKTModel}.\n *\n * @param {Object} params Parsing parameters.\n * @param {JSON} params.metaModelData Metamodel data.\n * @param {String[]} [params.excludeTypes] Types to exclude from parsing.\n * @param {String[]} [params.includeTypes] Types to include in parsing.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when JSON has been parsed.\n */\nfunction parseMetaModelIntoXKTModel({metaModelData, xktModel, includeTypes, excludeTypes, log}) {\n\n if (log) {\n log(\"Using parser: parseMetaModelIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n const metaObjects = metaModelData.metaObjects || [];\n const propertySets = metaModelData.propertySets || [];\n\n xktModel.modelId = metaModelData.revisionId || \"\"; // HACK\n xktModel.projectId = metaModelData.projectId || \"\";\n xktModel.revisionId = metaModelData.revisionId || \"\";\n xktModel.author = metaModelData.author || \"\";\n xktModel.createdAt = metaModelData.createdAt || \"\";\n xktModel.creatingApplication = metaModelData.creatingApplication || \"\";\n xktModel.schema = metaModelData.schema || \"\";\n\n for (let i = 0, len = propertySets.length; i < len; i++) {\n\n const propertySet = propertySets[i];\n\n xktModel.createPropertySet({\n propertySetId: propertySet.id,\n propertySetName: propertySet.name,\n propertySetType: propertySet.type,\n properties: propertySet.properties\n });\n }\n\n let includeTypesMap;\n if (includeTypes) {\n includeTypesMap = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n includeTypesMap[includeTypes[i]] = true;\n }\n }\n\n let excludeTypesMap;\n if (excludeTypes) {\n excludeTypesMap = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n excludeTypesMap[excludeTypes[i]] = true;\n }\n }\n\n const metaObjectsMap = {};\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const newObject = metaObjects[i];\n metaObjectsMap[newObject.id] = newObject;\n }\n\n let countMetaObjects = 0;\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n\n const metaObject = metaObjects[i];\n const type = metaObject.type;\n\n if (excludeTypesMap && excludeTypesMap[type]) {\n continue;\n }\n\n if (includeTypesMap && !includeTypesMap[type]) {\n continue;\n }\n\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) { // Don't create redundant sub-objects\n continue\n }\n }\n\n const propertySetIds = [];\n if (metaObject.propertySetIds) {\n for (let j = 0, lenj = metaObject.propertySetIds.length; j < lenj; j++) {\n const propertySetId = metaObject.propertySetIds[j];\n if (propertySetId !== undefined && propertySetId !== null && propertySetId !== \"\") {\n propertySetIds.push(propertySetId);\n }\n }\n }\n if (metaObject.propertySetId !== undefined && metaObject.propertySetId !== null && metaObject.propertySetId !== \"\") {\n propertySetIds.push(metaObject.propertySetId);\n }\n\n xktModel.createMetaObject({\n metaObjectId: metaObject.id,\n metaObjectType: metaObject.type,\n metaObjectName: metaObject.name,\n parentMetaObjectId: metaObject.parent,\n propertySetIds: propertySetIds.length > 0 ? propertySetIds : null\n });\n\n countMetaObjects++;\n }\n\n if (log) {\n log(\"Converted meta objects: \" + countMetaObjects);\n }\n\n resolve();\n });\n}\n\nexport {parseMetaModelIntoXKTModel};\n","/**\n * @desc Parses PCD point cloud data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"\"./models/pcd/ism_test_cat.pcd\"\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parsePCDIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PCD file data.\n * @param {Boolean} [params.littleEndian=true] Whether PCD binary data is Little-Endian or Big-Endian.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PCD has been parsed.\n */\nfunction parsePCDIntoXKTModel({data, xktModel, littleEndian = true, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePCDIntoXKTModel\");\n }\n\n return new Promise(function(resolve, reject) {\n\n const textData = decodeText(new Uint8Array(data));\n\n const header = parseHeader(textData);\n\n const positions = [];\n const normals = [];\n const colors = [];\n\n if (header.data === 'ascii') {\n\n const offset = header.offset;\n const data = textData.substr(header.headerLen);\n const lines = data.split('\\n');\n\n for (let i = 0, l = lines.length; i < l; i++) {\n\n if (lines[i] === '') {\n continue;\n }\n\n const line = lines[i].split(' ');\n\n if (offset.x !== undefined) {\n positions.push(parseFloat(line[offset.x]));\n positions.push(parseFloat(line[offset.y]));\n positions.push(parseFloat(line[offset.z]));\n }\n\n if (offset.rgb !== undefined) {\n const rgb = parseFloat(line[offset.rgb]);\n const r = (rgb >> 16) & 0x0000ff;\n const g = (rgb >> 8) & 0x0000ff;\n const b = (rgb >> 0) & 0x0000ff;\n colors.push(r, g, b, 255);\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n if (header.data === 'binary_compressed') {\n\n const sizes = new Uint32Array(data.slice(header.headerLen, header.headerLen + 8));\n const compressedSize = sizes[0];\n const decompressedSize = sizes[1];\n const decompressed = decompressLZF(new Uint8Array(data, header.headerLen + 8, compressedSize), decompressedSize);\n const dataview = new DataView(decompressed.buffer);\n const offset = header.offset;\n\n for (let i = 0; i < header.points; i++) {\n\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32((header.points * offset.x) + header.size[0] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.y) + header.size[1] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.z) + header.size[2] * i, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 0));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 1));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 2));\n // colors.push(255);\n } else {\n colors.push(1);\n colors.push(1);\n colors.push(1);\n }\n }\n }\n\n if (header.data === 'binary') {\n\n const dataview = new DataView(data, header.headerLen);\n const offset = header.offset;\n\n for (let i = 0, row = 0; i < header.points; i++, row += header.rowSize) {\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32(row + offset.x, littleEndian));\n positions.push(dataview.getFloat32(row + offset.y, littleEndian));\n positions.push(dataview.getFloat32(row + offset.z, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8(row + offset.rgb + 2));\n colors.push(dataview.getUint8(row + offset.rgb + 1));\n colors.push(dataview.getUint8(row + offset.rgb + 0));\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n xktModel.createGeometry({\n geometryId: \"pointsGeometry\",\n primitiveType: \"points\",\n positions: positions,\n colors: colors && colors.length > 0 ? colors : null\n });\n\n xktModel.createMesh({\n meshId: \"pointsMesh\",\n geometryId: \"pointsGeometry\"\n });\n\n xktModel.createEntity({\n entityId: \"geometries\",\n meshIds: [\"pointsMesh\"]\n });\n\n if (log) {\n log(\"Converted drawable objects: 1\");\n log(\"Converted geometries: 1\");\n log(\"Converted vertices: \" + positions.length / 3);\n }\n\n if (stats) {\n stats.sourceFormat = \"PCD\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = positions.length / 3;\n }\n\n resolve();\n });\n}\n\nfunction parseHeader(data) {\n const header = {};\n const result1 = data.search(/[\\r\\n]DATA\\s(\\S*)\\s/i);\n const result2 = /[\\r\\n]DATA\\s(\\S*)\\s/i.exec(data.substr(result1 - 1));\n header.data = result2[1];\n header.headerLen = result2[0].length + result1;\n header.str = data.substr(0, header.headerLen);\n header.str = header.str.replace(/\\#.*/gi, ''); // Strip comments\n header.version = /VERSION (.*)/i.exec(header.str); // Parse\n header.fields = /FIELDS (.*)/i.exec(header.str);\n header.size = /SIZE (.*)/i.exec(header.str);\n header.type = /TYPE (.*)/i.exec(header.str);\n header.count = /COUNT (.*)/i.exec(header.str);\n header.width = /WIDTH (.*)/i.exec(header.str);\n header.height = /HEIGHT (.*)/i.exec(header.str);\n header.viewpoint = /VIEWPOINT (.*)/i.exec(header.str);\n header.points = /POINTS (.*)/i.exec(header.str);\n if (header.version !== null) {\n header.version = parseFloat(header.version[1]);\n }\n if (header.fields !== null) {\n header.fields = header.fields[1].split(' ');\n }\n if (header.type !== null) {\n header.type = header.type[1].split(' ');\n }\n if (header.width !== null) {\n header.width = parseInt(header.width[1]);\n }\n if (header.height !== null) {\n header.height = parseInt(header.height[1]);\n }\n if (header.viewpoint !== null) {\n header.viewpoint = header.viewpoint[1];\n }\n if (header.points !== null) {\n header.points = parseInt(header.points[1], 10);\n }\n if (header.points === null) {\n header.points = header.width * header.height;\n }\n if (header.size !== null) {\n header.size = header.size[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (header.count !== null) {\n header.count = header.count[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n } else {\n header.count = [];\n for (let i = 0, l = header.fields.length; i < l; i++) {\n header.count.push(1);\n }\n }\n header.offset = {};\n let sizeSum = 0;\n for (let i = 0, l = header.fields.length; i < l; i++) {\n if (header.data === 'ascii') {\n header.offset[header.fields[i]] = i;\n } else {\n header.offset[header.fields[i]] = sizeSum;\n sizeSum += header.size[i] * header.count[i];\n }\n }\n header.rowSize = sizeSum; // For binary only\n return header;\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]);\n }\n try {\n return decodeURIComponent(escape(s));\n } catch (e) {\n return s;\n }\n}\n\nfunction decompressLZF(inData, outLength) { // https://gitlab.com/taketwo/three-pcd-loader/blob/master/decompress-lzf.js\n const inLength = inData.length;\n const outData = new Uint8Array(outLength);\n let inPtr = 0;\n let outPtr = 0;\n let ctrl;\n let len;\n let ref;\n do {\n ctrl = inData[inPtr++];\n if (ctrl < (1 << 5)) {\n ctrl++;\n if (outPtr + ctrl > outLength) throw new Error('Output buffer is not large enough');\n if (inPtr + ctrl > inLength) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = inData[inPtr++];\n } while (--ctrl);\n } else {\n len = ctrl >> 5;\n ref = outPtr - ((ctrl & 0x1f) << 8) - 1;\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n if (len === 7) {\n len += inData[inPtr++];\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n }\n ref -= inData[inPtr++];\n if (outPtr + len + 2 > outLength) throw new Error('Output buffer is not large enough');\n if (ref < 0) throw new Error('Invalid compressed data');\n if (ref >= outPtr) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = outData[ref++];\n } while (--len + 2);\n }\n } while (inPtr < inLength);\n return outData;\n}\n\nexport {parsePCDIntoXKTModel};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/ply\");","import {parse} from '@loaders.gl/core';\nimport {PLYLoader} from '@loaders.gl/ply';\n\n/**\n * @desc Parses PLY file data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a PLY model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/ply/test.ply\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parsePLYIntoXKTModel({data, xktModel}).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PLY file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PLY has been parsed.\n */\nasync function parsePLYIntoXKTModel({data, xktModel, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePLYIntoXKTModel\");\n }\n\n if (!data) {\n throw \"Argument expected: data\";\n }\n\n if (!xktModel) {\n throw \"Argument expected: xktModel\";\n }\n\n let parsedData;\n try {\n parsedData = await parse(data, PLYLoader);\n } catch (e) {\n if (log) {\n log(\"Error: \" + e);\n }\n return;\n }\n\n const attributes = parsedData.attributes;\n const hasColors = !!attributes.COLOR_0;\n\n if (hasColors) {\n const colorsValue = hasColors ? attributes.COLOR_0.value : null;\n const colorsCompressed = [];\n for (let i = 0, len = colorsValue.length; i < len; i += 4) {\n colorsCompressed.push(colorsValue[i]);\n colorsCompressed.push(colorsValue[i + 1]);\n colorsCompressed.push(colorsValue[i + 2]);\n }\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : [],\n colorsCompressed: colorsCompressed\n });\n } else {\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : []\n });\n }\n\n xktModel.createMesh({\n meshId: \"plyMesh\",\n geometryId: \"plyGeometry\",\n color: (!hasColors) ? [1, 1, 1] : null\n });\n\n xktModel.createEntity({\n entityId: \"ply\",\n meshIds: [\"plyMesh\"]\n });\n\n if (stats) {\n stats.sourceFormat = \"PLY\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = attributes.POSITION.value.length / 3;\n }\n}\n\nexport {parsePLYIntoXKTModel};\n","import {faceToVertexNormals} from \"../lib/faceToVertexNormals.js\";\nimport {math} from \"../lib/math.js\";\n\n/**\n * @desc Parses STL file data into an {@link XKTModel}.\n *\n * * Supports binary and ASCII STL formats.\n * * Option to create a separate {@link XKTEntity} for each group of faces that share the same vertex colors.\n * * Option to smooth face-aligned normals loaded from STL.\n * * Option to reduce XKT file size by ignoring STL normals and relying on xeokit to auto-generate them.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an STL model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/stl/binary/spurGear.stl\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseSTLIntoXKTModel({data, xktModel});\n *\n * xktModel.finalize();\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer|String} [params.data] STL file data. Can be binary or string.\n * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the STL geometry normals, and the STL\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the STL.\n * Overrides ````smoothNormals```` when ````true````. This ignores the normals in the STL, and loads no\n * normals from the STL into the {@link XKTModel}, resulting in the XKT file storing no normals for the STL model. The\n * xeokit-sdk will then automatically generate the normals within its shaders. The disadvantages are that auto-normals\n * may slow rendering down a little bit, and that the normals can only be face-aligned (and thus rendered using flat\n * shading). The advantages, however, are a smaller XKT file size, and the ability to apply certain geometry optimizations\n * during parsing, such as removing duplicated STL vertex positions, that are not possible when normals are loaded\n * for the STL vertices.\n * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented STL normals to vertex normals, for a smooth appearance. Ignored if ````autoNormals```` is ````true````.\n * @param {Number} [params.smoothNormalsAngleThreshold=20] This is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.\n * @param {Boolean} [params.splitMeshes=true] When true, creates a separate {@link XKTEntity} for each group of faces that share the same vertex colors. Only works with binary STL (ie. when ````data```` is an ArrayBuffer).\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when STL has been parsed.\n */\nasync function parseSTLIntoXKTModel({\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n stats,\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseSTLIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n const rootMetaObjectId = math.createUUID();\n\n const rootMetaObject = xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n const ctx = {\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n rootMetaObject,\n nextId: 0,\n log: (log || function (msg) {\n }),\n stats: {\n numObjects: 0,\n numGeometries: 0,\n numTriangles: 0,\n numVertices: 0\n }\n };\n\n const binData = ensureBinary(data);\n\n if (isBinary(binData)) {\n parseBinary(ctx, binData);\n } else {\n parseASCII(ctx, ensureString(data));\n }\n\n if (stats) {\n stats.sourceFormat = \"STL\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numTriangles = ctx.stats.numTriangles;\n stats.numVertices = ctx.stats.numVertices;\n }\n\n resolve();\n });\n}\n\nfunction isBinary(data) {\n const reader = new DataView(data);\n const numFaces = reader.getUint32(80, true);\n const faceSize = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);\n const numExpectedBytes = 80 + (32 / 8) + (numFaces * faceSize);\n if (numExpectedBytes === reader.byteLength) {\n return true;\n }\n const solid = [115, 111, 108, 105, 100];\n for (let i = 0; i < 5; i++) {\n if (solid[i] !== reader.getUint8(i, false)) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseBinary(ctx, data) {\n const reader = new DataView(data);\n const faces = reader.getUint32(80, true);\n let r;\n let g;\n let b;\n let hasColors = false;\n let colors;\n let defaultR;\n let defaultG;\n let defaultB;\n let lastR = null;\n let lastG = null;\n let lastB = null;\n let newMesh = false;\n let alpha;\n for (let index = 0; index < 80 - 10; index++) {\n if ((reader.getUint32(index, false) === 0x434F4C4F /*COLO*/) &&\n (reader.getUint8(index + 4) === 0x52 /*'R'*/) &&\n (reader.getUint8(index + 5) === 0x3D /*'='*/)) {\n hasColors = true;\n colors = [];\n defaultR = reader.getUint8(index + 6) / 255;\n defaultG = reader.getUint8(index + 7) / 255;\n defaultB = reader.getUint8(index + 8) / 255;\n alpha = reader.getUint8(index + 9) / 255;\n }\n }\n let dataOffset = 84;\n let faceLength = 12 * 4 + 2;\n let positions = [];\n let normals = [];\n let splitMeshes = ctx.splitMeshes;\n for (let face = 0; face < faces; face++) {\n let start = dataOffset + face * faceLength;\n let normalX = reader.getFloat32(start, true);\n let normalY = reader.getFloat32(start + 4, true);\n let normalZ = reader.getFloat32(start + 8, true);\n if (hasColors) {\n let packedColor = reader.getUint16(start + 48, true);\n if ((packedColor & 0x8000) === 0) {\n r = (packedColor & 0x1F) / 31;\n g = ((packedColor >> 5) & 0x1F) / 31;\n b = ((packedColor >> 10) & 0x1F) / 31;\n } else {\n r = defaultR;\n g = defaultG;\n b = defaultB;\n }\n if (splitMeshes && r !== lastR || g !== lastG || b !== lastB) {\n if (lastR !== null) {\n newMesh = true;\n }\n lastR = r;\n lastG = g;\n lastB = b;\n }\n }\n for (let i = 1; i <= 3; i++) {\n let vertexstart = start + i * 12;\n positions.push(reader.getFloat32(vertexstart, true));\n positions.push(reader.getFloat32(vertexstart + 4, true));\n positions.push(reader.getFloat32(vertexstart + 8, true));\n if (!ctx.autoNormals) {\n normals.push(normalX, normalY, normalZ);\n }\n if (hasColors) {\n colors.push(r, g, b, 1); // TODO: handle alpha\n }\n }\n if (splitMeshes && newMesh) {\n addMesh(ctx, positions, normals, colors);\n positions = [];\n normals = [];\n colors = colors ? [] : null;\n newMesh = false;\n }\n }\n if (positions.length > 0) {\n addMesh(ctx, positions, normals, colors);\n }\n}\n\nfunction parseASCII(ctx, data) {\n const faceRegex = /facet([\\s\\S]*?)endfacet/g;\n let faceCounter = 0;\n const floatRegex = /[\\s]+([+-]?(?:\\d+.\\d+|\\d+.|\\d+|.\\d+)(?:[eE][+-]?\\d+)?)/.source;\n const vertexRegex = new RegExp('vertex' + floatRegex + floatRegex + floatRegex, 'g');\n const normalRegex = new RegExp('normal' + floatRegex + floatRegex + floatRegex, 'g');\n const positions = [];\n const normals = [];\n const colors = null;\n let normalx;\n let normaly;\n let normalz;\n let result;\n let verticesPerFace;\n let normalsPerFace;\n let text;\n while ((result = faceRegex.exec(data)) !== null) {\n verticesPerFace = 0;\n normalsPerFace = 0;\n text = result[0];\n while ((result = normalRegex.exec(text)) !== null) {\n normalx = parseFloat(result[1]);\n normaly = parseFloat(result[2]);\n normalz = parseFloat(result[3]);\n normalsPerFace++;\n }\n while ((result = vertexRegex.exec(text)) !== null) {\n positions.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n normals.push(normalx, normaly, normalz);\n verticesPerFace++;\n }\n if (normalsPerFace !== 1) {\n ctx.log(\"Error in normal of face \" + faceCounter);\n return -1;\n }\n if (verticesPerFace !== 3) {\n ctx.log(\"Error in positions of face \" + faceCounter);\n return -1;\n }\n faceCounter++;\n }\n addMesh(ctx, positions, normals, colors);\n}\n\nlet nextGeometryId = 0;\n\nfunction addMesh(ctx, positions, normals, colors) {\n\n const indices = new Int32Array(positions.length / 3);\n for (let ni = 0, len = indices.length; ni < len; ni++) {\n indices[ni] = ni;\n }\n\n normals = normals && normals.length > 0 ? normals : null;\n colors = colors && colors.length > 0 ? colors : null;\n\n if (!ctx.autoNormals && ctx.smoothNormals) {\n faceToVertexNormals(positions, normals, {smoothNormalsAngleThreshold: ctx.smoothNormalsAngleThreshold});\n }\n\n const geometryId = \"\" + nextGeometryId++;\n const meshId = \"\" + nextGeometryId++;\n const entityId = \"\" + nextGeometryId++;\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: (!ctx.autoNormals) ? normals : null,\n colors: colors,\n indices: indices\n });\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: colors ? null : [1, 1, 1],\n metallic: 0.9,\n roughness: 0.1\n });\n\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: [meshId]\n });\n\n ctx.xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"Default\",\n metaObjectName: \"STL Mesh\",\n parentMetaObjectId: ctx.rootMetaObject.metaObjectId\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numObjects++;\n ctx.stats.numVertices += positions.length / 3;\n ctx.stats.numTriangles += indices.length / 3;\n}\n\nfunction ensureString(buffer) {\n if (typeof buffer !== 'string') {\n return decodeText(new Uint8Array(buffer));\n }\n return buffer;\n}\n\nfunction ensureBinary(buffer) {\n if (typeof buffer === 'string') {\n const arrayBuffer = new Uint8Array(buffer.length);\n for (let i = 0; i < buffer.length; i++) {\n arrayBuffer[i] = buffer.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n }\n return arrayBuffer.buffer || arrayBuffer;\n } else {\n return buffer;\n }\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]); // Implicitly assumes little-endian.\n }\n return decodeURIComponent(escape(s));\n}\n\nexport {parseSTLIntoXKTModel};\n","import {math} from \"./math.js\";\n\n/**\n * Converts surface-perpendicular face normals to vertex normals. Assumes that the mesh contains disjoint triangles\n * that don't share vertex array elements. Works by finding groups of vertices that have the same location and\n * averaging their normal vectors.\n *\n * @returns {{positions: Array, normals: *}}\n * @private\n */\nfunction faceToVertexNormals(positions, normals, options = {}) {\n const smoothNormalsAngleThreshold = options.smoothNormalsAngleThreshold || 20;\n const vertexMap = {};\n const vertexNormals = [];\n const vertexNormalAccum = {};\n let acc;\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let posi;\n let i;\n let j;\n let len;\n let a;\n let b;\n let c;\n\n for (i = 0, len = positions.length; i < len; i += 3) {\n\n posi = i / 3;\n\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n\n key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n\n if (vertexMap[key] === undefined) {\n vertexMap[key] = [posi];\n } else {\n vertexMap[key].push(posi);\n }\n\n const normal = math.normalizeVec3([normals[i], normals[i + 1], normals[i + 2]]);\n\n vertexNormals[posi] = normal;\n\n acc = math.vec4([normal[0], normal[1], normal[2], 1]);\n\n vertexNormalAccum[posi] = acc;\n }\n\n for (key in vertexMap) {\n\n if (vertexMap.hasOwnProperty(key)) {\n\n const vertices = vertexMap[key];\n const numVerts = vertices.length;\n\n for (i = 0; i < numVerts; i++) {\n\n const ii = vertices[i];\n\n acc = vertexNormalAccum[ii];\n\n for (j = 0; j < numVerts; j++) {\n\n if (i === j) {\n continue;\n }\n\n const jj = vertices[j];\n\n a = vertexNormals[ii];\n b = vertexNormals[jj];\n\n const angle = Math.abs(math.angleVec3(a, b) / math.DEGTORAD);\n\n if (angle < smoothNormalsAngleThreshold) {\n\n acc[0] += b[0];\n acc[1] += b[1];\n acc[2] += b[2];\n acc[3] += 1.0;\n }\n }\n }\n }\n }\n\n for (i = 0, len = normals.length; i < len; i += 3) {\n\n acc = vertexNormalAccum[i / 3];\n\n normals[i + 0] = acc[0] / acc[3];\n normals[i + 1] = acc[1] / acc[3];\n normals[i + 2] = acc[2] / acc[3];\n\n }\n}\n\nexport {faceToVertexNormals};","/**\n * @desc Creates box-shaped triangle mesh geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxGeometry({\n * primitiveType: \"triangles\" // or \"lines\"\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType,\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n\n primitiveType: \"triangles\",\n\n // The vertices - eight for our cube, each\n // one spanning three array elements for X,Y and Z\n\n positions: [\n\n // v0-v1-v2-v3 front\n xmax, ymax, zmax,\n xmin, ymax, zmax,\n xmin, ymin, zmax,\n xmax, ymin, zmax,\n\n // v0-v3-v4-v1 right\n xmax, ymax, zmax,\n xmax, ymin, zmax,\n xmax, ymin, zmin,\n xmax, ymax, zmin,\n\n // v0-v1-v6-v1 top\n xmax, ymax, zmax,\n xmax, ymax, zmin,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n\n // v1-v6-v7-v2 left\n xmin, ymax, zmax,\n xmin, ymax, zmin,\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n\n // v7-v4-v3-v2 bottom\n xmin, ymin, zmin,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmin, ymin, zmax,\n\n // v4-v7-v6-v1 back\n xmax, ymin, zmin,\n xmin, ymin, zmin,\n xmin, ymax, zmin,\n xmax, ymax, zmin\n ],\n\n // Normal vectors, one for each vertex\n normals: [\n\n // v0-v1-v2-v3 front\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n\n // v0-v3-v4-v5 right\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n\n // v0-v5-v6-v1 top\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n\n // v1-v6-v7-v2 left\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n\n // v7-v4-v3-v2 bottom\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n\n // v4-v7-v6-v5 back\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1\n ],\n\n // UV coords\n uv: [\n\n // v0-v1-v2-v3 front\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v0-v3-v4-v1 right\n 0, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n // v0-v1-v6-v1 top\n 1, 1,\n 1, 0,\n 0, 0,\n 0, 1,\n\n // v1-v6-v7-v2 left\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v7-v4-v3-v2 bottom\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0,\n\n // v4-v7-v6-v1 back\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0\n ],\n\n // Indices - these organise the\n // positions and uv texture coordinates\n // into geometric primitives in accordance\n // with the \"primitive\" parameter,\n // in this case a set of three indices\n // for each triangle.\n //\n // Note that each triangle is specified\n // in counter-clockwise winding order.\n //\n // You can specify them in clockwise\n // order if you configure the Modes\n // node's frontFace flag as \"cw\", instead of\n // the default \"ccw\".\n indices: [\n 0, 1, 2,\n 0, 2, 3,\n // front\n 4, 5, 6,\n 4, 6, 7,\n // right\n 8, 9, 10,\n 8, 10, 11,\n // top\n 12, 13, 14,\n 12, 14, 15,\n // left\n 16, 17, 18,\n 16, 18, 19,\n // bottom\n 20, 21, 22,\n 20, 22, 23\n ]\n };\n}\n\nexport {buildBoxGeometry};\n","/**\n * @desc Creates box-shaped line segment geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxLinesGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxLinesGeometry({\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType, // \"lines\"\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxLinesGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxLinesGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n primitiveType: \"lines\",\n positions: [\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmax, ymax, zmin,\n xmax, ymax, zmax\n ],\n indices: [\n 0, 1,\n 1, 3,\n 3, 2,\n 2, 0,\n 4, 5,\n 5, 7,\n 7, 6,\n 6, 4,\n 0, 4,\n 1, 5,\n 2, 6,\n 3, 7\n ]\n }\n}\n\nexport {buildBoxLinesGeometry};\n","/**\n * @desc Creates cylinder-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a cylinder-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildCylinderGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const cylinder = buildCylinderGeometry({\n * center: [0,0,0],\n * radiusTop: 2.0,\n * radiusBottom: 2.0,\n * height: 5.0,\n * radialSegments: 20,\n * heightSegments: 1,\n * openEnded: false\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"cylinderGeometry\",\n * primitiveType: cylinder.primitiveType,\n * positions: cylinder.positions,\n * normals: cylinder.normals,\n * indices: cylinder.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redCylinderMesh\",\n * geometryId: \"cylinderGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redCylinder\",\n * meshIds: [\"redCylinderMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildCylinderGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radiusTop=1] Radius of top.\n * @param {Number} [cfg.radiusBottom=1] Radius of bottom.\n * @param {Number} [cfg.height=1] Height.\n * @param {Number} [cfg.radialSegments=60] Number of horizontal segments.\n * @param {Number} [cfg.heightSegments=1] Number of vertical segments.\n * @param {Boolean} [cfg.openEnded=false] Whether or not the cylinder has solid caps on the ends.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildCylinderGeometry(cfg = {}) {\n\n let radiusTop = cfg.radiusTop || 1;\n if (radiusTop < 0) {\n console.error(\"negative radiusTop not allowed - will invert\");\n radiusTop *= -1;\n }\n\n let radiusBottom = cfg.radiusBottom || 1;\n if (radiusBottom < 0) {\n console.error(\"negative radiusBottom not allowed - will invert\");\n radiusBottom *= -1;\n }\n\n let height = cfg.height || 1;\n if (height < 0) {\n console.error(\"negative height not allowed - will invert\");\n height *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 3) {\n radialSegments = 3;\n }\n\n let heightSegments = cfg.heightSegments || 1;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n if (heightSegments < 1) {\n heightSegments = 1;\n }\n\n const openEnded = !!cfg.openEnded;\n\n let center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const heightHalf = height / 2;\n const heightLength = height / heightSegments;\n const radialAngle = (2.0 * Math.PI / radialSegments);\n const radialLength = 1.0 / radialSegments;\n //var nextRadius = this._radiusBottom;\n const radiusChange = (radiusTop - radiusBottom) / heightSegments;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let h;\n let i;\n\n let x;\n let z;\n\n let currentRadius;\n let currentHeight;\n\n let first;\n let second;\n\n let startIndex;\n let tu;\n let tv;\n\n // create vertices\n const normalY = (90.0 - (Math.atan(height / (radiusBottom - radiusTop))) * 180 / Math.PI) / 90.0;\n\n for (h = 0; h <= heightSegments; h++) {\n currentRadius = radiusTop - h * radiusChange;\n currentHeight = heightHalf - h * heightLength;\n\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n normals.push(currentRadius * x);\n normals.push(normalY); //todo\n normals.push(currentRadius * z);\n\n uvs.push((i * radialLength));\n uvs.push(h * 1 / heightSegments);\n\n positions.push((currentRadius * x) + centerX);\n positions.push((currentHeight) + centerY);\n positions.push((currentRadius * z) + centerZ);\n }\n }\n\n // create faces\n for (h = 0; h < heightSegments; h++) {\n for (i = 0; i <= radialSegments; i++) {\n\n first = h * (radialSegments + 1) + i;\n second = first + radialSegments;\n\n indices.push(first);\n indices.push(second);\n indices.push(second + 1);\n\n indices.push(first);\n indices.push(second + 1);\n indices.push(first + 1);\n }\n }\n\n // create top cap\n if (!openEnded && radiusTop > 0) {\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusTop * x);\n normals.push(1.0);\n normals.push(radiusTop * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusTop * x) + centerX);\n positions.push((heightHalf) + centerY);\n positions.push((radiusTop * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(first);\n indices.push(first + 1);\n indices.push(center);\n }\n }\n\n // create bottom cap\n if (!openEnded && radiusBottom > 0) {\n\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(-1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(0 - heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusBottom * x);\n normals.push(-1.0);\n normals.push(radiusBottom * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusBottom * x) + centerX);\n positions.push((0 - heightHalf) + centerY);\n positions.push((radiusBottom * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(center);\n indices.push(first + 1);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\n\nexport {buildCylinderGeometry};\n","/**\n * @desc Creates grid-shaped geometry arrays..\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a grid-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildGridGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const grid = buildGridGeometry({\n * size: 1000,\n * divisions: 500\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"gridGeometry\",\n * primitiveType: grid.primitiveType, // Will be \"lines\"\n * positions: grid.positions,\n * indices: grid.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redGridMesh\",\n * geometryId: \"gridGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redGrid\",\n * meshIds: [\"redGridMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildGridGeometry\n * @param {*} [cfg] Configs\n * @param {Number} [cfg.size=1] Dimension on the X and Z-axis.\n * @param {Number} [cfg.divisions=1] Number of divisions on X and Z axis..\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildGridGeometry(cfg = {}) {\n\n let size = cfg.size || 1;\n if (size < 0) {\n console.error(\"negative size not allowed - will invert\");\n size *= -1;\n }\n\n let divisions = cfg.divisions || 1;\n if (divisions < 0) {\n console.error(\"negative divisions not allowed - will invert\");\n divisions *= -1;\n }\n if (divisions < 1) {\n divisions = 1;\n }\n\n size = size || 10;\n divisions = divisions || 10;\n\n const step = size / divisions;\n const halfSize = size / 2;\n\n const positions = [];\n const indices = [];\n let l = 0;\n\n for (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) {\n\n positions.push(-halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(k);\n positions.push(0);\n positions.push(-halfSize);\n\n positions.push(k);\n positions.push(0);\n positions.push(halfSize);\n\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildGridGeometry};\n","/**\n * @desc Creates plane-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a plane-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildPlaneGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const plane = buildPlaneGeometry({\n * center: [0,0,0],\n * xSize: 2,\n * zSize: 2,\n * xSegments: 10,\n * zSegments: 10\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"planeGeometry\",\n * primitiveType: plane.primitiveType, // Will be \"triangles\"\n * positions: plane.positions,\n * normals: plane.normals,\n * indices: plane.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redPlaneMesh\",\n * geometryId: \"planeGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redPlane\",\n * meshIds: [\"redPlaneMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildPlaneGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1] Dimension on the X-axis.\n * @param {Number} [cfg.zSize=1] Dimension on the Z-axis.\n * @param {Number} [cfg.xSegments=1] Number of segments on the X-axis.\n * @param {Number} [cfg.zSegments=1] Number of segments on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildPlaneGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n let xSegments = cfg.xSegments || 1;\n if (xSegments < 0) {\n console.error(\"negative xSegments not allowed - will invert\");\n xSegments *= -1;\n }\n if (xSegments < 1) {\n xSegments = 1;\n }\n\n let zSegments = cfg.xSegments || 1;\n if (zSegments < 0) {\n console.error(\"negative zSegments not allowed - will invert\");\n zSegments *= -1;\n }\n if (zSegments < 1) {\n zSegments = 1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const halfWidth = xSize / 2;\n const halfHeight = zSize / 2;\n\n const planeX = Math.floor(xSegments) || 1;\n const planeZ = Math.floor(zSegments) || 1;\n\n const planeX1 = planeX + 1;\n const planeZ1 = planeZ + 1;\n\n const segmentWidth = xSize / planeX;\n const segmentHeight = zSize / planeZ;\n\n const positions = new Float32Array(planeX1 * planeZ1 * 3);\n const normals = new Float32Array(planeX1 * planeZ1 * 3);\n const uvs = new Float32Array(planeX1 * planeZ1 * 2);\n\n let offset = 0;\n let offset2 = 0;\n\n let iz;\n let ix;\n let x;\n let a;\n let b;\n let c;\n let d;\n\n for (iz = 0; iz < planeZ1; iz++) {\n\n const z = iz * segmentHeight - halfHeight;\n\n for (ix = 0; ix < planeX1; ix++) {\n\n x = ix * segmentWidth - halfWidth;\n\n positions[offset] = x + centerX;\n positions[offset + 1] = centerY;\n positions[offset + 2] = -z + centerZ;\n\n normals[offset + 2] = -1;\n\n uvs[offset2] = (ix) / planeX;\n uvs[offset2 + 1] = ((planeZ - iz) / planeZ);\n\n offset += 3;\n offset2 += 2;\n }\n }\n\n offset = 0;\n\n const indices = new ((positions.length / 3) > 65535 ? Uint32Array : Uint16Array)(planeX * planeZ * 6);\n\n for (iz = 0; iz < planeZ; iz++) {\n\n for (ix = 0; ix < planeX; ix++) {\n\n a = ix + planeX1 * iz;\n b = ix + planeX1 * (iz + 1);\n c = (ix + 1) + planeX1 * (iz + 1);\n d = (ix + 1) + planeX1 * iz;\n\n indices[offset] = d;\n indices[offset + 1] = b;\n indices[offset + 2] = a;\n\n indices[offset + 3] = d;\n indices[offset + 4] = c;\n indices[offset + 5] = b;\n\n offset += 6;\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildPlaneGeometry};\n","/**\n * @desc Creates sphere-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a sphere-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildSphereGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const sphere = buildSphereGeometry({\n * center: [0,0,0],\n * radius: 1.5,\n * heightSegments: 60,\n * widthSegments: 60\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"sphereGeometry\",\n * primitiveType: sphere.primitiveType, // Will be \"triangles\"\n * positions: sphere.positions,\n * normals: sphere.normals,\n * indices: sphere.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redSphereMesh\",\n * geometryId: \"sphereGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n *const xktEntity = xktModel.createEntity({\n * entityId: \"redSphere\",\n * meshIds: [\"redSphereMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildSphereGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] Radius.\n * @param {Number} [cfg.heightSegments=24] Number of latitudinal bands.\n * @param {Number} [cfg.widthSegments=18] Number of longitudinal bands.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildSphereGeometry(cfg = {}) {\n\n const lod = cfg.lod || 1;\n\n const centerX = cfg.center ? cfg.center[0] : 0;\n const centerY = cfg.center ? cfg.center[1] : 0;\n const centerZ = cfg.center ? cfg.center[2] : 0;\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n\n let heightSegments = cfg.heightSegments || 18;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n heightSegments = Math.floor(lod * heightSegments);\n if (heightSegments < 18) {\n heightSegments = 18;\n }\n\n let widthSegments = cfg.widthSegments || 18;\n if (widthSegments < 0) {\n console.error(\"negative widthSegments not allowed - will invert\");\n widthSegments *= -1;\n }\n widthSegments = Math.floor(lod * widthSegments);\n if (widthSegments < 18) {\n widthSegments = 18;\n }\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let i;\n let j;\n\n let theta;\n let sinTheta;\n let cosTheta;\n\n let phi;\n let sinPhi;\n let cosPhi;\n\n let x;\n let y;\n let z;\n\n let u;\n let v;\n\n let first;\n let second;\n\n for (i = 0; i <= heightSegments; i++) {\n\n theta = i * Math.PI / heightSegments;\n sinTheta = Math.sin(theta);\n cosTheta = Math.cos(theta);\n\n for (j = 0; j <= widthSegments; j++) {\n\n phi = j * 2 * Math.PI / widthSegments;\n sinPhi = Math.sin(phi);\n cosPhi = Math.cos(phi);\n\n x = cosPhi * sinTheta;\n y = cosTheta;\n z = sinPhi * sinTheta;\n u = 1.0 - j / widthSegments;\n v = i / heightSegments;\n\n normals.push(x);\n normals.push(y);\n normals.push(z);\n\n uvs.push(u);\n uvs.push(v);\n\n positions.push(centerX + radius * x);\n positions.push(centerY + radius * y);\n positions.push(centerZ + radius * z);\n }\n }\n\n for (i = 0; i < heightSegments; i++) {\n for (j = 0; j < widthSegments; j++) {\n\n first = (i * (widthSegments + 1)) + j;\n second = first + widthSegments + 1;\n\n indices.push(first + 1);\n indices.push(second + 1);\n indices.push(second);\n indices.push(first + 1);\n indices.push(second);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildSphereGeometry};\n","import {math} from '../lib/math.js';\n\n/**\n * @desc Creates torus-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a torus-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildTorusGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const torus = buildTorusGeometry({\n * center: [0,0,0],\n * radius: 1.0,\n * tube: 0.5,\n * radialSegments: 32,\n * tubeSegments: 24,\n * arc: Math.PI * 2.0\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"torusGeometry\",\n * primitiveType: torus.primitiveType, // Will be \"triangles\"\n * positions: torus.positions,\n * normals: torus.normals,\n * indices: torus.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTorusMesh\",\n * geometryId: \"torusGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redTorus\",\n * meshIds: [\"redTorusMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildTorusGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] The overall radius.\n * @param {Number} [cfg.tube=0.3] The tube radius.\n * @param {Number} [cfg.radialSegments=32] The number of radial segments.\n * @param {Number} [cfg.tubeSegments=24] The number of tubular segments.\n * @param {Number} [cfg.arc=Math.PI*0.5] The length of the arc in radians, where Math.PI*2 is a closed torus.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildTorusGeometry(cfg = {}) {\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n radius *= 0.5;\n\n let tube = cfg.tube || 0.3;\n if (tube < 0) {\n console.error(\"negative tube not allowed - will invert\");\n tube *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 4) {\n radialSegments = 4;\n }\n\n let tubeSegments = cfg.tubeSegments || 24;\n if (tubeSegments < 0) {\n console.error(\"negative tubeSegments not allowed - will invert\");\n tubeSegments *= -1;\n }\n if (tubeSegments < 4) {\n tubeSegments = 4;\n }\n\n let arc = cfg.arc || Math.PI * 2;\n if (arc < 0) {\n console.warn(\"negative arc not allowed - will invert\");\n arc *= -1;\n }\n if (arc > 360) {\n arc = 360;\n }\n\n const center = cfg.center;\n let centerX = center ? center[0] : 0;\n let centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let u;\n let v;\n let x;\n let y;\n let z;\n let vec;\n\n let i;\n let j;\n\n for (j = 0; j <= tubeSegments; j++) {\n for (i = 0; i <= radialSegments; i++) {\n\n u = i / radialSegments * arc;\n v = 0.785398 + (j / tubeSegments * Math.PI * 2);\n\n centerX = radius * Math.cos(u);\n centerY = radius * Math.sin(u);\n\n x = (radius + tube * Math.cos(v)) * Math.cos(u);\n y = (radius + tube * Math.cos(v)) * Math.sin(u);\n z = tube * Math.sin(v);\n\n positions.push(x + centerX);\n positions.push(y + centerY);\n positions.push(z + centerZ);\n\n uvs.push(1 - (i / radialSegments));\n uvs.push((j / tubeSegments));\n\n vec = math.normalizeVec3(math.subVec3([x, y, z], [centerX, centerY, centerZ], []), []);\n\n normals.push(vec[0]);\n normals.push(vec[1]);\n normals.push(vec[2]);\n }\n }\n\n let a;\n let b;\n let c;\n let d;\n\n for (j = 1; j <= tubeSegments; j++) {\n for (i = 1; i <= radialSegments; i++) {\n\n a = (radialSegments + 1) * j + i - 1;\n b = (radialSegments + 1) * (j - 1) + i - 1;\n c = (radialSegments + 1) * (j - 1) + i;\n d = (radialSegments + 1) * j + i;\n\n indices.push(a);\n indices.push(b);\n indices.push(c);\n\n indices.push(c);\n indices.push(d);\n indices.push(a);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildTorusGeometry};\n","const letters = {\n ' ': {width: 16, points: []},\n '!': {\n width: 10, points: [\n [5, 21],\n [5, 7],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '\"': {\n width: 16, points: [\n [4, 21],\n [4, 14],\n [-1, -1],\n [12, 21],\n [12, 14]\n ]\n },\n '#': {\n width: 21, points: [\n [11, 25],\n [4, -7],\n [-1, -1],\n [17, 25],\n [10, -7],\n [-1, -1],\n [4, 12],\n [18, 12],\n [-1, -1],\n [3, 6],\n [17, 6]\n ]\n },\n '$': {\n width: 20, points: [\n [8, 25],\n [8, -4],\n [-1, -1],\n [12, 25],\n [12, -4],\n [-1, -1],\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n '%': {\n width: 24, points: [\n [21, 21],\n [3, 0],\n [-1, -1],\n [8, 21],\n [10, 19],\n [10, 17],\n [9, 15],\n [7, 14],\n [5, 14],\n [3, 16],\n [3, 18],\n [4, 20],\n [6, 21],\n [8, 21],\n [10, 20],\n [13, 19],\n [16, 19],\n [19, 20],\n [21, 21],\n [-1, -1],\n [17, 7],\n [15, 6],\n [14, 4],\n [14, 2],\n [16, 0],\n [18, 0],\n [20, 1],\n [21, 3],\n [21, 5],\n [19, 7],\n [17, 7]\n ]\n },\n '&': {\n width: 26, points: [\n [23, 12],\n [23, 13],\n [22, 14],\n [21, 14],\n [20, 13],\n [19, 11],\n [17, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [7, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 6],\n [4, 8],\n [5, 9],\n [12, 13],\n [13, 14],\n [14, 16],\n [14, 18],\n [13, 20],\n [11, 21],\n [9, 20],\n [8, 18],\n [8, 16],\n [9, 13],\n [11, 10],\n [16, 3],\n [18, 1],\n [20, 0],\n [22, 0],\n [23, 1],\n [23, 2]\n ]\n },\n '\\'': {\n width: 10, points: [\n [5, 19],\n [4, 20],\n [5, 21],\n [6, 20],\n [6, 18],\n [5, 16],\n [4, 15]\n ]\n },\n '(': {\n width: 14, points: [\n [11, 25],\n [9, 23],\n [7, 20],\n [5, 16],\n [4, 11],\n [4, 7],\n [5, 2],\n [7, -2],\n [9, -5],\n [11, -7]\n ]\n },\n ')': {\n width: 14, points: [\n [3, 25],\n [5, 23],\n [7, 20],\n [9, 16],\n [10, 11],\n [10, 7],\n [9, 2],\n [7, -2],\n [5, -5],\n [3, -7]\n ]\n },\n '*': {\n width: 16, points: [\n [8, 21],\n [8, 9],\n [-1, -1],\n [3, 18],\n [13, 12],\n [-1, -1],\n [13, 18],\n [3, 12]\n ]\n },\n '+': {\n width: 26, points: [\n [13, 18],\n [13, 0],\n [-1, -1],\n [4, 9],\n [22, 9]\n ]\n },\n ',': {\n width: 10, points: [\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '-': {\n width: 26, points: [\n [4, 9],\n [22, 9]\n ]\n },\n '.': {\n width: 10, points: [\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '/': {\n width: 22, points: [\n [20, 25],\n [2, -7]\n ]\n },\n '0': {\n width: 20, points: [\n [9, 21],\n [6, 20],\n [4, 17],\n [3, 12],\n [3, 9],\n [4, 4],\n [6, 1],\n [9, 0],\n [11, 0],\n [14, 1],\n [16, 4],\n [17, 9],\n [17, 12],\n [16, 17],\n [14, 20],\n [11, 21],\n [9, 21]\n ]\n },\n '1': {\n width: 20, points: [\n [6, 17],\n [8, 18],\n [11, 21],\n [11, 0]\n ]\n },\n '2': {\n width: 20, points: [\n [4, 16],\n [4, 17],\n [5, 19],\n [6, 20],\n [8, 21],\n [12, 21],\n [14, 20],\n [15, 19],\n [16, 17],\n [16, 15],\n [15, 13],\n [13, 10],\n [3, 0],\n [17, 0]\n ]\n },\n '3': {\n width: 20, points: [\n [5, 21],\n [16, 21],\n [10, 13],\n [13, 13],\n [15, 12],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '4': {\n width: 20, points: [\n [13, 21],\n [3, 7],\n [18, 7],\n [-1, -1],\n [13, 21],\n [13, 0]\n ]\n },\n '5': {\n width: 20, points: [\n [15, 21],\n [5, 21],\n [4, 12],\n [5, 13],\n [8, 14],\n [11, 14],\n [14, 13],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '6': {\n width: 20, points: [\n [16, 18],\n [15, 20],\n [12, 21],\n [10, 21],\n [7, 20],\n [5, 17],\n [4, 12],\n [4, 7],\n [5, 3],\n [7, 1],\n [10, 0],\n [11, 0],\n [14, 1],\n [16, 3],\n [17, 6],\n [17, 7],\n [16, 10],\n [14, 12],\n [11, 13],\n [10, 13],\n [7, 12],\n [5, 10],\n [4, 7]\n ]\n },\n '7': {\n width: 20, points: [\n [17, 21],\n [7, 0],\n [-1, -1],\n [3, 21],\n [17, 21]\n ]\n },\n '8': {\n width: 20, points: [\n [8, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 14],\n [7, 13],\n [11, 12],\n [14, 11],\n [16, 9],\n [17, 7],\n [17, 4],\n [16, 2],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 7],\n [4, 9],\n [6, 11],\n [9, 12],\n [13, 13],\n [15, 14],\n [16, 16],\n [16, 18],\n [15, 20],\n [12, 21],\n [8, 21]\n ]\n },\n '9': {\n width: 20, points: [\n [16, 14],\n [15, 11],\n [13, 9],\n [10, 8],\n [9, 8],\n [6, 9],\n [4, 11],\n [3, 14],\n [3, 15],\n [4, 18],\n [6, 20],\n [9, 21],\n [10, 21],\n [13, 20],\n [15, 18],\n [16, 14],\n [16, 9],\n [15, 4],\n [13, 1],\n [10, 0],\n [8, 0],\n [5, 1],\n [4, 3]\n ]\n },\n ':': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n ';': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '<': {\n width: 24, points: [\n [20, 18],\n [4, 9],\n [20, 0]\n ]\n },\n '=': {\n width: 26, points: [\n [4, 12],\n [22, 12],\n [-1, -1],\n [4, 6],\n [22, 6]\n ]\n },\n '>': {\n width: 24, points: [\n [4, 18],\n [20, 9],\n [4, 0]\n ]\n },\n '?': {\n width: 18, points: [\n [3, 16],\n [3, 17],\n [4, 19],\n [5, 20],\n [7, 21],\n [11, 21],\n [13, 20],\n [14, 19],\n [15, 17],\n [15, 15],\n [14, 13],\n [13, 12],\n [9, 10],\n [9, 7],\n [-1, -1],\n [9, 2],\n [8, 1],\n [9, 0],\n [10, 1],\n [9, 2]\n ]\n },\n '@': {\n width: 27, points: [\n [18, 13],\n [17, 15],\n [15, 16],\n [12, 16],\n [10, 15],\n [9, 14],\n [8, 11],\n [8, 8],\n [9, 6],\n [11, 5],\n [14, 5],\n [16, 6],\n [17, 8],\n [-1, -1],\n [12, 16],\n [10, 14],\n [9, 11],\n [9, 8],\n [10, 6],\n [11, 5],\n [-1, -1],\n [18, 16],\n [17, 8],\n [17, 6],\n [19, 5],\n [21, 5],\n [23, 7],\n [24, 10],\n [24, 12],\n [23, 15],\n [22, 17],\n [20, 19],\n [18, 20],\n [15, 21],\n [12, 21],\n [9, 20],\n [7, 19],\n [5, 17],\n [4, 15],\n [3, 12],\n [3, 9],\n [4, 6],\n [5, 4],\n [7, 2],\n [9, 1],\n [12, 0],\n [15, 0],\n [18, 1],\n [20, 2],\n [21, 3],\n [-1, -1],\n [19, 16],\n [18, 8],\n [18, 6],\n [19, 5]\n ]\n },\n 'A': {\n width: 18, points: [\n [9, 21],\n [1, 0],\n [-1, -1],\n [9, 21],\n [17, 0],\n [-1, -1],\n [4, 7],\n [14, 7]\n ]\n },\n 'B': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [-1, -1],\n [4, 11],\n [13, 11],\n [16, 10],\n [17, 9],\n [18, 7],\n [18, 4],\n [17, 2],\n [16, 1],\n [13, 0],\n [4, 0]\n ]\n },\n 'C': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5]\n ]\n },\n 'D': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [11, 21],\n [14, 20],\n [16, 18],\n [17, 16],\n [18, 13],\n [18, 8],\n [17, 5],\n [16, 3],\n [14, 1],\n [11, 0],\n [4, 0]\n ]\n },\n 'E': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11],\n [-1, -1],\n [4, 0],\n [17, 0]\n ]\n },\n 'F': {\n width: 18, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11]\n ]\n },\n 'G': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [18, 8],\n [-1, -1],\n [13, 8],\n [18, 8]\n ]\n },\n 'H': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [18, 0],\n [-1, -1],\n [4, 11],\n [18, 11]\n ]\n },\n 'I': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'J': {\n width: 16, points: [\n [12, 21],\n [12, 5],\n [11, 2],\n [10, 1],\n [8, 0],\n [6, 0],\n [4, 1],\n [3, 2],\n [2, 5],\n [2, 7]\n ]\n },\n 'K': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [4, 7],\n [-1, -1],\n [9, 12],\n [18, 0]\n ]\n },\n 'L': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 0],\n [16, 0]\n ]\n },\n 'M': {\n width: 24, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [20, 0]\n ]\n },\n 'N': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [18, 0],\n [-1, -1],\n [18, 21],\n [18, 0]\n ]\n },\n 'O': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21]\n ]\n },\n 'P': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 14],\n [17, 12],\n [16, 11],\n [13, 10],\n [4, 10]\n ]\n },\n 'Q': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [-1, -1],\n [12, 4],\n [18, -2]\n ]\n },\n 'R': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [4, 11],\n [-1, -1],\n [11, 11],\n [18, 0]\n ]\n },\n 'S': {\n width: 20, points: [\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n 'T': {\n width: 16, points: [\n [8, 21],\n [8, 0],\n [-1, -1],\n [1, 21],\n [15, 21]\n ]\n },\n 'U': {\n width: 22, points: [\n [4, 21],\n [4, 6],\n [5, 3],\n [7, 1],\n [10, 0],\n [12, 0],\n [15, 1],\n [17, 3],\n [18, 6],\n [18, 21]\n ]\n },\n 'V': {\n width: 18, points: [\n [1, 21],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 0]\n ]\n },\n 'W': {\n width: 24, points: [\n [2, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [17, 0],\n [-1, -1],\n [22, 21],\n [17, 0]\n ]\n },\n 'X': {\n width: 20, points: [\n [3, 21],\n [17, 0],\n [-1, -1],\n [17, 21],\n [3, 0]\n ]\n },\n 'Y': {\n width: 18, points: [\n [1, 21],\n [9, 11],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 11]\n ]\n },\n 'Z': {\n width: 20, points: [\n [17, 21],\n [3, 0],\n [-1, -1],\n [3, 21],\n [17, 21],\n [-1, -1],\n [3, 0],\n [17, 0]\n ]\n },\n '[': {\n width: 14, points: [\n [4, 25],\n [4, -7],\n [-1, -1],\n [5, 25],\n [5, -7],\n [-1, -1],\n [4, 25],\n [11, 25],\n [-1, -1],\n [4, -7],\n [11, -7]\n ]\n },\n '\\\\': {\n width: 14, points: [\n [0, 21],\n [14, -3]\n ]\n },\n ']': {\n width: 14, points: [\n [9, 25],\n [9, -7],\n [-1, -1],\n [10, 25],\n [10, -7],\n [-1, -1],\n [3, 25],\n [10, 25],\n [-1, -1],\n [3, -7],\n [10, -7]\n ]\n },\n '^': {\n width: 16, points: [\n [6, 15],\n [8, 18],\n [10, 15],\n [-1, -1],\n [3, 12],\n [8, 17],\n [13, 12],\n [-1, -1],\n [8, 17],\n [8, 0]\n ]\n },\n '_': {\n width: 16, points: [\n [0, -2],\n [16, -2]\n ]\n },\n '`': {\n width: 10, points: [\n [6, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 15],\n [6, 16],\n [5, 17]\n ]\n },\n 'a': {\n width: 19, points: [\n [15, 14],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'b': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'c': {\n width: 18, points: [\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'd': {\n width: 19, points: [\n [15, 21],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'e': {\n width: 18, points: [\n [3, 8],\n [15, 8],\n [15, 10],\n [14, 12],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'f': {\n width: 12, points: [\n [10, 21],\n [8, 21],\n [6, 20],\n [5, 17],\n [5, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'g': {\n width: 19, points: [\n [15, 14],\n [15, -2],\n [14, -5],\n [13, -6],\n [11, -7],\n [8, -7],\n [6, -6],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'h': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'i': {\n width: 8, points: [\n [3, 21],\n [4, 20],\n [5, 21],\n [4, 22],\n [3, 21],\n [-1, -1],\n [4, 14],\n [4, 0]\n ]\n },\n 'j': {\n width: 10, points: [\n [5, 21],\n [6, 20],\n [7, 21],\n [6, 22],\n [5, 21],\n [-1, -1],\n [6, 14],\n [6, -3],\n [5, -6],\n [3, -7],\n [1, -7]\n ]\n },\n 'k': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [14, 14],\n [4, 4],\n [-1, -1],\n [8, 8],\n [15, 0]\n ]\n },\n 'l': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'm': {\n width: 30, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0],\n [-1, -1],\n [15, 10],\n [18, 13],\n [20, 14],\n [23, 14],\n [25, 13],\n [26, 10],\n [26, 0]\n ]\n },\n 'n': {\n width: 19, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'o': {\n width: 19, points: [\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3],\n [16, 6],\n [16, 8],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14]\n ]\n },\n 'p': {\n width: 19, points: [\n [4, 14],\n [4, -7],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'q': {\n width: 19, points: [\n [15, 14],\n [15, -7],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'r': {\n width: 13, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 8],\n [5, 11],\n [7, 13],\n [9, 14],\n [12, 14]\n ]\n },\n 's': {\n width: 17, points: [\n [14, 11],\n [13, 13],\n [10, 14],\n [7, 14],\n [4, 13],\n [3, 11],\n [4, 9],\n [6, 8],\n [11, 7],\n [13, 6],\n [14, 4],\n [14, 3],\n [13, 1],\n [10, 0],\n [7, 0],\n [4, 1],\n [3, 3]\n ]\n },\n 't': {\n width: 12, points: [\n [5, 21],\n [5, 4],\n [6, 1],\n [8, 0],\n [10, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'u': {\n width: 19, points: [\n [4, 14],\n [4, 4],\n [5, 1],\n [7, 0],\n [10, 0],\n [12, 1],\n [15, 4],\n [-1, -1],\n [15, 14],\n [15, 0]\n ]\n },\n 'v': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0]\n ]\n },\n 'w': {\n width: 22, points: [\n [3, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [15, 0],\n [-1, -1],\n [19, 14],\n [15, 0]\n ]\n },\n 'x': {\n width: 17, points: [\n [3, 14],\n [14, 0],\n [-1, -1],\n [14, 14],\n [3, 0]\n ]\n },\n 'y': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0],\n [6, -4],\n [4, -6],\n [2, -7],\n [1, -7]\n ]\n },\n 'z': {\n width: 17, points: [\n [14, 14],\n [3, 0],\n [-1, -1],\n [3, 14],\n [14, 14],\n [-1, -1],\n [3, 0],\n [14, 0]\n ]\n },\n '{': {\n width: 14, points: [\n [9, 25],\n [7, 24],\n [6, 23],\n [5, 21],\n [5, 19],\n [6, 17],\n [7, 16],\n [8, 14],\n [8, 12],\n [6, 10],\n [-1, -1],\n [7, 24],\n [6, 22],\n [6, 20],\n [7, 18],\n [8, 17],\n [9, 15],\n [9, 13],\n [8, 11],\n [4, 9],\n [8, 7],\n [9, 5],\n [9, 3],\n [8, 1],\n [7, 0],\n [6, -2],\n [6, -4],\n [7, -6],\n [-1, -1],\n [6, 8],\n [8, 6],\n [8, 4],\n [7, 2],\n [6, 1],\n [5, -1],\n [5, -3],\n [6, -5],\n [7, -6],\n [9, -7]\n ]\n },\n '|': {\n width: 8, points: [\n [4, 25],\n [4, -7]\n ]\n },\n '}': {\n width: 14, points: [\n [5, 25],\n [7, 24],\n [8, 23],\n [9, 21],\n [9, 19],\n [8, 17],\n [7, 16],\n [6, 14],\n [6, 12],\n [8, 10],\n [-1, -1],\n [7, 24],\n [8, 22],\n [8, 20],\n [7, 18],\n [6, 17],\n [5, 15],\n [5, 13],\n [6, 11],\n [10, 9],\n [6, 7],\n [5, 5],\n [5, 3],\n [6, 1],\n [7, 0],\n [8, -2],\n [8, -4],\n [7, -6],\n [-1, -1],\n [8, 8],\n [6, 6],\n [6, 4],\n [7, 2],\n [8, 1],\n [9, -1],\n [9, -3],\n [8, -5],\n [7, -6],\n [5, -7]\n ]\n },\n '~': {\n width: 24, points: [\n [3, 6],\n [3, 8],\n [4, 11],\n [6, 12],\n [8, 12],\n [10, 11],\n [14, 8],\n [16, 7],\n [18, 7],\n [20, 8],\n [21, 10],\n [-1, -1],\n [3, 8],\n [4, 10],\n [6, 11],\n [8, 11],\n [10, 10],\n [14, 7],\n [16, 6],\n [18, 6],\n [20, 7],\n [21, 10],\n [21, 12]\n ]\n }\n};\n\n/**\n * @desc Creates wireframe text-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a text-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildVectorTextGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const text = buildVectorTextGeometry({\n * origin: [0,0,0],\n * text: \"On the other side of the screen, it all looked so easy\"\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"textGeometry\",\n * primitiveType: text.primitiveType, // Will be \"lines\"\n * positions: text.positions,\n * indices: text.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTextMesh\",\n * geometryId: \"textGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redText\",\n * meshIds: [\"redTextMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildVectorTextGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number[]} [cfg.origin] 3D point indicating the top left corner.\n * @param {Number} [cfg.size=1] Size of each character.\n * @param {String} [cfg.text=\"\"] The text.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildVectorTextGeometry(cfg = {}) {\n\n var origin = cfg.origin || [0, 0, 0];\n var xOrigin = origin[0];\n var yOrigin = origin[1];\n var zOrigin = origin[2];\n var size = cfg.size || 1;\n\n var positions = [];\n var indices = [];\n var text = (\"\" + cfg.text).trim();\n var lines = (text || \"\").split(\"\\n\");\n var countVerts = 0;\n var y = 0;\n var x;\n var str;\n var len;\n var c;\n var mag = 1.0 / 25.0;\n var penUp;\n var p1;\n var p2;\n var needLine;\n var pointsLen;\n var a;\n\n for (var iLine = 0; iLine < lines.length; iLine++) {\n\n x = 0;\n str = lines[iLine];\n len = str.length;\n\n for (var i = 0; i < len; i++) {\n\n c = letters[str.charAt(i)];\n\n if (c === '\\n') {\n //alert(\"newline\");\n }\n\n if (!c) {\n continue;\n }\n\n penUp = 1;\n p1 = -1;\n p2 = -1;\n needLine = false;\n\n pointsLen = c.points.length;\n\n for (var j = 0; j < pointsLen; j++) {\n a = c.points[j];\n\n if (a[0] === -1 && a[1] === -1) {\n penUp = 1;\n needLine = false;\n continue;\n }\n\n positions.push((x + (a[0] * size) * mag) + xOrigin);\n positions.push((y + (a[1] * size) * mag) + yOrigin);\n positions.push(0 + zOrigin);\n\n if (p1 === -1) {\n p1 = countVerts;\n } else if (p2 === -1) {\n p2 = countVerts;\n } else {\n p1 = p2;\n p2 = countVerts;\n }\n countVerts++;\n\n if (penUp) {\n penUp = false;\n\n } else {\n indices.push(p1);\n indices.push(p2);\n }\n\n needLine = true;\n }\n x += c.width * mag * size;\n\n }\n y -= 35 * mag * size;\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildVectorTextGeometry}\n","/**\n * @private\n * @param buf\n * @returns {ArrayBuffer}\n */\nexport function toArrayBuffer(buf) {\n const ab = new ArrayBuffer(buf.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buf.length; ++i) {\n view[i] = buf[i];\n }\n return ab;\n}","import {XKT_INFO} from \"./XKT_INFO.js\";\nimport {XKTModel} from \"./XKTModel/XKTModel.js\";\nimport {parseCityJSONIntoXKTModel} from \"./parsers/parseCityJSONIntoXKTModel.js\";\nimport {parseGLTFIntoXKTModel} from \"./parsers/parseGLTFIntoXKTModel.js\";\nimport {parseIFCIntoXKTModel} from \"./parsers/parseIFCIntoXKTModel.js\";\nimport {parseLASIntoXKTModel} from \"./parsers/parseLASIntoXKTModel.js\";\nimport {parsePCDIntoXKTModel} from \"./parsers/parsePCDIntoXKTModel.js\";\nimport {parsePLYIntoXKTModel} from \"./parsers/parsePLYIntoXKTModel.js\";\nimport {parseSTLIntoXKTModel} from \"./parsers/parseSTLIntoXKTModel.js\";\nimport {writeXKTModelToArrayBuffer} from \"./XKTModel/writeXKTModelToArrayBuffer.js\";\n\nimport {toArrayBuffer} from \"./XKTModel/lib/toArraybuffer\";\n\nconst fs = require('fs');\nconst path = require(\"path\");\n\n/**\n * Converts model files into xeokit's native XKT format.\n *\n * Supported source formats are: IFC, CityJSON, glTF, LAZ and LAS.\n *\n * **Only bundled in xeokit-convert.cjs.js.**\n *\n * ## Usage\n *\n * ````javascript\n * const convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\n * const fs = require('fs');\n *\n * convert2xkt({\n * sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n * outputXKT: (xtkArrayBuffer) => {\n * fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n * }\n * }).then(() => {\n * console.log(\"Converted.\");\n * }, (errMsg) => {\n * console.error(\"Conversion failed: \" + errMsg)\n * });\n ````\n * @param {Object} params Conversion parameters.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {*} [params.configs] Configurations.\n * @param {String} [params.source] Path to source file. Alternative to ````sourceData````.\n * @param {ArrayBuffer|JSON} [params.sourceData] Source file data. Alternative to ````source````.\n * @param {String} [params.sourceFormat] Format of source file/data. Always needed with ````sourceData````, but not normally needed with ````source````, because convert2xkt will determine the format automatically from the file extension of ````source````.\n * @param {String} [params.metaModelDataStr] Source file data. Overrides metadata from ````metaModelSource````, ````sourceData```` and ````source````.\n * @param {String} [params.metaModelSource] Path to source metaModel file. Overrides metadata from ````sourceData```` and ````source````. Overridden by ````metaModelData````.\n * @param {String} [params.output] Path to destination XKT file. Directories on this path are automatically created if not existing.\n * @param {Function} [params.outputXKTModel] Callback to collect the ````XKTModel```` that is internally build by this method.\n * @param {Function} [params.outputXKT] Callback to collect XKT file data.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {Object} [stats] Collects conversion statistics. Statistics are attached to this object if provided.\n * @param {Function} [params.outputStats] Callback to collect statistics.\n * @param {Boolean} [params.rotateX=false] Whether to rotate the model 90 degrees about the X axis to make the Y axis \"up\", if necessary. Applies to CityJSON and LAS/LAZ models.\n * @param {Boolean} [params.reuseGeometries=true] When true, will enable geometry reuse within the XKT. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be when a model (eg. glTF) has 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {Boolean} [params.includeTextures=true] Whether to convert textures. Only works for ````glTF```` models.\n * @param {Boolean} [params.includeNormals=true] Whether to convert normals. When false, the parser will ignore\n * geometry normals, and the modelwill rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the model.\n * @param {Number} [params.minTileSize=200] Minimum RTC coordinate tile size. Set this to a value between 100 and 10000,\n * depending on how far from the coordinate origin the model's vertex positions are; specify larger tile sizes when close\n * to the origin, and smaller sizes when distant. This compensates for decreasing precision as floats get bigger.\n * @param {Function} [params.log] Logging callback.\n * @return {Promise}\n */\nfunction convert2xkt({\n WebIFC,\n configs,\n source,\n sourceData,\n sourceFormat,\n metaModelSource,\n metaModelDataStr,\n modelAABB,\n output,\n outputXKTModel,\n outputXKT,\n includeTypes,\n excludeTypes,\n reuseGeometries = true,\n minTileSize = 200,\n stats = {},\n outputStats,\n rotateX = false,\n includeTextures = true,\n includeNormals = true,\n log = function (msg) {\n }\n }) {\n\n stats.sourceFormat = \"\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numTextureSets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.sourceSize = 0;\n stats.xktSize = 0;\n stats.texturesSize = 0;\n stats.xktVersion = \"\";\n stats.compressionRatio = 0;\n stats.conversionTime = 0;\n stats.aabb = null;\n\n return new Promise(function (resolve, reject) {\n const _log = log;\n log = (msg) => {\n _log(`[convert2xkt] ${msg}`)\n }\n\n if (!source && !sourceData) {\n reject(\"Argument expected: source or sourceData\");\n return;\n }\n\n if (!sourceFormat && sourceData) {\n reject(\"Argument expected: sourceFormat is required with sourceData\");\n return;\n }\n\n if (!output && !outputXKTModel && !outputXKT) {\n reject(\"Argument expected: output, outputXKTModel or outputXKT\");\n return;\n }\n\n if (source) {\n log('Reading input file: ' + source);\n }\n\n const startTime = new Date();\n\n const sourceConfigs = configs.sourceConfigs || {};\n const ext = sourceFormat || path.extname(source);\n let fileTypeConfigs = sourceConfigs[ext];\n\n if (!fileTypeConfigs) {\n log(`[WARNING] Could not find configs sourceConfigs entry for source format \"${ext}\". This is derived from the source file name extension. Will use internal default configs.`);\n fileTypeConfigs = {};\n }\n function overrideOption(option1, option2) {\n if (option1 !== undefined) {\n return option1;\n }\n return option2;\n }\n\n if (!sourceData) {\n try {\n sourceData = fs.readFileSync(source);\n } catch (err) {\n reject(err);\n return;\n }\n }\n\n const sourceFileSizeBytes = sourceData.byteLength;\n\n log(\"Input file size: \" + (sourceFileSizeBytes / 1000).toFixed(2) + \" kB\");\n\n if (!metaModelDataStr && metaModelSource) {\n log('Reading input metadata file: ' + metaModelSource);\n try {\n metaModelDataStr = fs.readFileSync(metaModelSource);\n } catch (err) {\n reject(err);\n return;\n }\n } else {\n log(`Not embedding metadata in XKT`);\n }\n\n let metaModelJSON;\n\n if (metaModelDataStr) {\n try {\n metaModelJSON = JSON.parse(metaModelDataStr);\n } catch (e) {\n metaModelJSON = {};\n log(`Error parsing metadata JSON: ${e}`);\n }\n }\n\n minTileSize = overrideOption(fileTypeConfigs.minTileSize, minTileSize);\n rotateX = overrideOption(fileTypeConfigs.rotateX, rotateX);\n reuseGeometries = overrideOption(fileTypeConfigs.reuseGeometries, reuseGeometries);\n includeTextures = overrideOption(fileTypeConfigs.includeTextures, includeTextures);\n includeNormals = overrideOption(fileTypeConfigs.includeNormals, includeNormals);\n includeTypes = overrideOption(fileTypeConfigs.includeTypes, includeTypes);\n excludeTypes = overrideOption(fileTypeConfigs.excludeTypes, excludeTypes);\n\n if (reuseGeometries === false) {\n log(\"Geometry reuse is disabled\");\n }\n\n const xktModel = new XKTModel({\n minTileSize,\n modelAABB\n });\n\n switch (ext) {\n case \"json\":\n convert(parseCityJSONIntoXKTModel, {\n data: JSON.parse(sourceData),\n xktModel,\n stats,\n rotateX,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n log\n });\n break;\n\n case \"glb\":\n sourceData = toArrayBuffer(sourceData);\n convert(parseGLTFIntoXKTModel, {\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"gltf\":\n sourceData = toArrayBuffer(sourceData);\n const gltfBasePath = source ? path.dirname(source) : \"\";\n convert(parseGLTFIntoXKTModel, {\n baseUri: gltfBasePath,\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n // case \"gltf\":\n // const gltfJSON = JSON.parse(sourceData);\n // const gltfBasePath = source ? getBasePath(source) : \"\";\n // convert(parseGLTFIntoXKTModel, {\n // baseUri: gltfBasePath,\n // data: gltfJSON,\n // reuseGeometries,\n // includeTextures,\n // includeNormals,\n // metaModelData: metaModelJSON,\n // xktModel,\n // getAttachment: async (name) => {\n // const filePath = gltfBasePath + name;\n // log(`Reading attachment file: ${filePath}`);\n // const buffer = fs.readFileSync(filePath);\n // const arrayBuf = toArrayBuffer(buffer);\n // return arrayBuf;\n // },\n // stats,\n // log\n // });\n // break;\n\n case \"ifc\":\n convert(parseIFCIntoXKTModel, {\n WebIFC,\n data: sourceData,\n xktModel,\n wasmPath: \"./\",\n includeTypes,\n excludeTypes,\n stats,\n log\n });\n break;\n\n case \"laz\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"las\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"pcd\":\n convert(parsePCDIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"ply\":\n convert(parsePLYIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"stl\":\n convert(parseSTLIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n default:\n reject(`Error: unsupported source format: \"${ext}\".`);\n return;\n }\n\n function convert(parser, converterParams) {\n\n parser(converterParams).then(() => {\n\n if (!metaModelJSON) {\n log(\"Creating default metamodel in XKT\");\n xktModel.createDefaultMetaObjects();\n }\n\n log(\"Input file parsed OK. Building XKT document...\");\n\n xktModel.finalize().then(() => {\n\n log(\"XKT document built OK. Writing to XKT file...\");\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, {zip: true});\n\n const xktContent = Buffer.from(xktArrayBuffer);\n\n const targetFileSizeBytes = xktArrayBuffer.byteLength;\n\n stats.minTileSize = minTileSize || 200;\n stats.sourceSize = (sourceFileSizeBytes / 1000).toFixed(2);\n stats.xktSize = (targetFileSizeBytes / 1000).toFixed(2);\n stats.xktVersion = XKT_INFO.xktVersion;\n stats.compressionRatio = (sourceFileSizeBytes / targetFileSizeBytes).toFixed(2);\n stats.conversionTime = ((new Date() - startTime) / 1000.0).toFixed(2);\n stats.aabb = xktModel.aabb;\n log(`Converted to: XKT v${stats.xktVersion}`);\n if (includeTypes) {\n log(\"Include types: \" + (includeTypes ? includeTypes : \"(include all)\"));\n }\n if (excludeTypes) {\n log(\"Exclude types: \" + (excludeTypes ? excludeTypes : \"(exclude none)\"));\n }\n log(\"XKT size: \" + stats.xktSize + \" kB\");\n log(\"XKT textures size: \" + (stats.texturesSize / 1000).toFixed(2) + \"kB\");\n log(\"Compression ratio: \" + stats.compressionRatio);\n log(\"Conversion time: \" + stats.conversionTime + \" s\");\n log(\"Converted metaobjects: \" + stats.numMetaObjects);\n log(\"Converted property sets: \" + stats.numPropertySets);\n log(\"Converted drawable objects: \" + stats.numObjects);\n log(\"Converted geometries: \" + stats.numGeometries);\n log(\"Converted textures: \" + stats.numTextures);\n log(\"Converted textureSets: \" + stats.numTextureSets);\n log(\"Converted triangles: \" + stats.numTriangles);\n log(\"Converted vertices: \" + stats.numVertices);\n log(\"Converted UVs: \" + stats.numUVs);\n log(\"Converted normals: \" + stats.numNormals);\n log(\"Converted tiles: \" + xktModel.tilesList.length);\n log(\"minTileSize: \" + stats.minTileSize);\n\n if (output) {\n const outputDir = path.dirname(output);\n if (outputDir !== \"\" && !fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {recursive: true});\n }\n log('Writing XKT file: ' + output);\n fs.writeFileSync(output, xktContent);\n }\n\n if (outputXKTModel) {\n outputXKTModel(xktModel);\n }\n\n if (outputXKT) {\n outputXKT(xktContent);\n }\n\n if (outputStats) {\n outputStats(stats);\n }\n\n resolve();\n });\n }, (err) => {\n reject(err);\n });\n }\n });\n}\n\nexport {convert2xkt};","import '@loaders.gl/polyfills';\nimport {installFilePolyfills} from '@loaders.gl/polyfills';\n\ninstallFilePolyfills();\n\nexport * from \"./src/index.js\";\nexport {convert2xkt} from \"./src/convert2xkt.js\"; // convert2xkt is only bundled for Node.js\n"],"names":["root","factory","exports","module","define","amd","global","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","p","mat","mat2","mat3","xyz","tempVec3","vec","translate","scale","XKT_INFO","xktVersion","RepeatWrapping","ClampToEdgeWrapping","MirroredRepeatWrapping","NearestFilter","NearestMipMapNearestFilter","NearestMipmapNearestFilter","NearestMipmapLinearFilter","NearestMipMapLinearFilter","LinearFilter","LinearMipmapNearestFilter","LinearMipMapNearestFilter","LinearMipmapLinearFilter","LinearMipMapLinearFilter","GIFMediaType","JPEGMediaType","PNGMediaType","FloatArrayType","Float64Array","tempMat1","tempMat2","tempVec4","math","MIN_DOUBLE","Number","MAX_SAFE_INTEGER","MAX_DOUBLE","DEGTORAD","RADTODEG","vec2","values","vec3","vec4","mat3ToMat4","mat4","arguments","length","mat4ToMat3","createUUID","lut","i","toString","d0","Math","random","d1","d2","d3","concat","clamp","min","max","fmod","a","b","console","error","negateVec4","v","dest","addVec4","u","addVec4Scalar","s","addVec3","addVec3Scalar","subVec4","subVec3","subVec2","subVec4Scalar","subScalarVec4","mulVec4","mulVec4Scalar","mulVec3Scalar","mulVec2Scalar","divVec3","divVec4","divScalarVec3","divVec3Scalar","divVec4Scalar","divScalarVec4","dotVec4","cross3Vec4","u0","u1","u2","v0","v1","v2","cross3Vec3","x","y","z","x2","y2","z2","sqLenVec4","lenVec4","sqrt","dotVec3","dotVec2","sqLenVec3","sqLenVec2","lenVec3","distVec3","w","lenVec2","distVec2","rcpVec3","normalizeVec4","f","normalizeVec3","normalizeVec2","angleVec3","theta","acos","vec3FromMat4Scale","m","vecToArray","trunc","round","len","Array","slice","xyzArrayToObject","arr","xyzObjectToArray","arry","dupMat4","mat4To3","m4s","setMat4ToZeroes","setMat4ToOnes","diagonalMat4v","diagonalMat4c","diagonalMat4s","identityMat4","identityMat3","isIdentityMat4","negateMat4","addMat4","addMat4Scalar","addScalarMat4","subMat4","subMat4Scalar","subScalarMat4","mulMat4","a00","a01","a02","a03","a10","a11","a12","a13","a20","a21","a22","a23","a30","a31","a32","a33","b00","b01","b02","b03","b10","b11","b12","b13","b20","b21","b22","b23","b30","b31","b32","b33","mulMat3","mulMat4Scalar","mulMat4v4","v3","transposeMat4","m4","m14","m8","m13","m12","m9","transposeMat3","determinantMat4","inverseMat4","b04","b05","b06","b07","b08","b09","invDet","traceMat4","translationMat4v","translationMat3v","translationMat4c","translationMat4s","translateMat4v","translateMat4c","OLDtranslateMat4c","m15","m3","m7","m11","rotationMat4v","anglerad","axis","xy","yz","zx","xs","ys","zs","ax","sin","c","cos","q","rotationMat4c","scalingMat4v","scalingMat3v","scalingMat4c","scaleMat4c","scaleMat4v","scalingMat4s","rotationTranslationMat4","xx","xz","yy","zz","wx","wy","wz","mat4ToEuler","order","m21","m22","m23","m31","m32","m33","asin","abs","atan2","composeMat4","position","quaternion","quaternionToRotationMat4","decomposeMat4","matrix","sx","sy","sz","set","invSX","invSY","invSZ","mat4ToQuaternion","this","lookAtMat4v","pos","target","up","z0","z1","x0","x1","y0","y1","posx","posy","posz","upx","upy","upz","targetx","targety","targetz","lookAtMat4c","orthoMat4c","left","right","bottom","top","near","far","rl","tb","fn","frustumMat4v","fmin","fmax","fmin4","fmax4","t","tempMat20","tempMat21","tempMat22","frustumMat4","perspectiveMat4","fovyrad","aspectratio","znear","zfar","pmin","pmax","tan","transformPoint3","transformPoint4","transformPoints3","points","points2","p0","p1","p2","pi","result","m0","m1","m2","m5","m6","m10","transformPositions3","transformPositions4","transformVec3","transformVec4","rotateVec3X","rotateVec3Y","rotateVec3Z","projectVec4","unprojectVec3","viewMat","projMat","lerpVec3","t1","t2","flatten","leni","j","lenj","item","push","identityQuaternion","eulerToQuaternion","euler","c1","c2","c3","s1","s2","s3","trace","vec3PairToQuaternion","norm_u_norm_v","real_part","normalizeQuaternion","angleAxisToQuaternion","angleAxis","halfAngle","fsin","quaternionToEuler","mulQuaternions","p3","q0","q1","q2","q3","vec3ApplyQuaternion","qx","qy","qz","qw","ix","iy","iz","iw","quaternionToMat4","tx","ty","tz","twx","twy","twz","txx","txy","txz","tyy","tyz","tzz","conjugateQuaternion","inverseQuaternion","quaternionToAngleAxis","angle","AABB3","AABB2","OBB3","OBB2","Sphere3","transformOBB3","containsAABB3","aabb1","aabb2","getAABB3Diag","aabb","getAABB3DiagPoint","diagVec","xneg","xpos","yneg","ypos","zneg","zpos","getAABB3Center","getAABB2Center","collapseAABB3","AABB3ToOBB3","obb","positions3ToAABB3","positions","positionsDecodeMatrix","xmin","ymin","zmin","xmax","ymax","zmax","decompressPosition","OBB3ToAABB3","points3ToAABB3","points3ToSphere3","sphere","numPoints","dist","radius","positions3ToSphere3","tempVec3a","tempVec3b","lenPositions","numPositions","OBB3ToSphere3","point","lenPoints","getSphere3Center","expandAABB3","expandAABB3Point3","triangleNormal","normal","p1x","p1y","p1z","p2x","p2y","p2z","p3x","p3y","p3z","mag","octEncodeVec3","array","xfunc","yfunc","tempx","tempy","Int8Array","octDecodeVec2","oct","dot","uniquePositions","indicesLookup","indicesReverseLookup","weldedIndices","faces","numFaces","compa","compb","compc","cb","ab","cross","inverseNormal","geometryCompression","quantizePositions","quantizedPositions","maxInt","xMultiplier","yMultiplier","zMultiplier","verify","num","floor","compressPosition","multiplier","Float32Array","createPositionsDecodeMatrix","xwid","ywid","zwid","transformAndOctEncodeNormals","modelNormalMatrix","normals","lenNormals","compressedNormals","lenCompressedNormals","best","currentCos","bestCos","localNormal","worldNormal","octEncodeNormals","buildEdgeIndices","Uint16Array","indices","edgeThreshold","vx","vy","vz","positionsMap","precision","pow","lenUniquePositions","weldVertices","numIndices","ia","ib","ic","face","buildFaces","edge1","edge2","index1","index2","edge","normal1","normal2","edgeIndices","thresholdDot","edges","largeIndex","faceIndex","face1","face2","dot2","Uint32Array","isTriangleMeshSolid","vertexIndexMapping","compareIndexPositions","posA","posB","newIndices","sort","uniqueVertexIndex","a2","b2","temp","compareEdges","e1","e2","sameEdgeCount","XKTMesh","_createClass","cfg","_classCallCheck","meshId","meshIndex","geometry","color","metallic","roughness","opacity","textureSet","entity","XKTGeometry","geometryId","primitiveType","geometryIndex","numInstances","positionsQuantized","normalsOctEncoded","colorsCompressed","uvs","uvsCompressed","solid","XKTEntity","entityId","meshes","entityIndex","hasReusedGeometries","XKTTile","entities","KDNode","XKTMetaObject","metaObjectId","propertySetIds","metaObjectType","metaObjectName","parentMetaObjectId","XKTPropertySet","propertySetId","propertySetType","propertySetName","properties","XKTTexture","textureId","textureIndex","imageData","channel","width","height","src","compressed","mediaType","minFilter","magFilter","wrapS","wrapT","wrapR","XKTTextureSet","textureSetId","textureSetIndex","materialType","materialIndex","colorTexture","metallicRoughnessTexture","normalsTexture","emissiveTexture","occlusionTexture","_regeneratorRuntime","Op","hasOwn","desc","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","_typeof","__await","then","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","Error","done","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_defineProperties","props","descriptor","input","hint","prim","toPrimitive","res","String","_toPrimitive","tempVec4a","tempVec4b","tempMat4","tempMat4b","kdTreeDimLength","TEXTURE_ENCODING_OPTIONS","useSRGB","qualityLevel","encodeUASTC","mipmaps","XKTModel","instance","Constructor","modelId","projectId","revisionId","author","createdAt","creatingApplication","schema","minTileSize","modelAABB","propertySets","propertySetsList","metaObjects","metaObjectsList","reusedGeometriesDecodeMatrix","geometries","geometriesList","textures","texturesList","textureSets","textureSetsList","meshesList","entitiesList","tilesList","finalized","protoProps","_finalize","params","propertySet","metaObject","_rootMetaObject","fileExt","split","texture","colorTextureId","metallicRoughnessTextureId","normalsTextureId","emissiveTextureId","occlusionTextureId","triangles","lines","line_strip","_createDefaultIndices","colors","xktGeometryCfg","uv","Uint8Array","mergedPositions","mergedIndices","mergeVertices","rotation","mesh","meshIds","meshIdIdx","meshIdLen","warn","createMetaObject","_callee","rootKDNode","_context","log","_removeUnusedTextures","_compressTextures","_bakeSingleUseGeometryPositions","_bakeAndOctEncodeNormals","_createEntityAABBs","_createKDTree","_createTilesFromKDTree","_createReusedGeometriesDecodeMatrix","_flagSolidGeometries","args","apply","_this","countTextures","_loop","encodingOptions","load","ImageLoader","image","encode","KTX2BasisWriter","encodedData","encodedImageData","entityAABB","_insertEntityIntoKDTree","kdNode","nodeAABB","dim","aabbLeft","aabbRight","_createTilesFromKDNode","_createTileFromEntities","tileAABB","tileCenter","tileCenterNeg","rtcAABB","reused","k","lenk","tile","reusedGeometriesAABB","countReusedGeometries","numGeometries","maxNumPositions","maxNumIndices","XKT_VERSION","NUM_TEXTURE_ATTRIBUTES","NUM_MATERIAL_ATTRIBUTES","writeXKTModelToArrayBuffer","xktModel","metaModelJSON","stats","options","data","metaModelDataStr","numPropertySets","numMetaObjects","numTextures","numTextureSets","numMeshes","numEntities","numTiles","lenColors","lenUVs","lenIndices","lenEdgeIndices","lenMatrices","lenTextures","xktTexture","byteLength","numCompressedTextures","metadata","textureData","eachTextureDataPortion","eachTextureAttributes","eachTextureSetTextures","Int32Array","matrices","eachGeometryPrimitiveType","eachGeometryPositionsPortion","eachGeometryNormalsPortion","eachGeometryColorsPortion","eachGeometryUVsPortion","eachGeometryIndicesPortion","eachGeometryEdgeIndicesPortion","eachMeshGeometriesPortion","eachMeshMatricesPortion","eachMeshTextureSet","eachMeshMaterialAttributes","eachEntityId","eachEntityMeshesPortion","eachTileAABB","eachTileEntitiesPortion","countPositions","countNormals","countColors","countUVs","countIndices","countEdgeIndices","id","propertySetsIndex","propertySetJSON","metaObjectsIndex","metaObjectJSON","parent","external","portionIdx","textureAttrIdx","eachTextureSetTexturesIndex","countEntityMeshesPortion","eachMeshMaterialAttributesIndex","matricesIndex","tileIndex","tileEntities","numTileEntities","entityMeshes","numEntityMeshes","tileAABBIndex","getModelData","deflatedData","deflate","buffer","zip","pako","deflateJSON","JSON","stringify","replace","chr","charCodeAt","substr","deflateData","texturesSize","arrayBuffer","elements","indexData","dataLen","elementsize","indexBuf","dataArray","offset","element","toArrayBuffer","createArrayBuffer","strings","earcut","holeIndices","minX","minY","maxX","maxY","invSize","hasHoles","outerLen","outerNode","linkedList","list","queue","steiner","getLeftmost","compareX","eliminateHole","filterPoints","eliminateHoles","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","again","area","ear","pass","zOrder","prevZ","nextZ","e","tail","numMerges","pSize","qSize","inSize","sortLinked","indexCurve","isEarHashed","isEar","cureLocalIntersections","splitEarcut","pointInTriangle","minTX","minTY","maxTX","maxTY","minZ","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","hole","hx","hy","mx","my","tanMin","Infinity","sectorContainsSector","findHoleBridge","leftmost","ay","bx","by","cx","cy","px","py","intersectsPolygon","inside","middleInside","o1","sign","o2","o3","o4","onSegment","Node","an","bp","sum","deviation","polygonArea","trianglesArea","vertices","holes","dimensions","holeIndex","tempVec2a","tempVec3c","parseCityJSONIntoXKTModel","_ref","_ref$center","center","_ref$transform","transform","_ref$stats","vertices2","copyVertices","cityJSONTransform","vertex","transformVertices","centerVertices","customTransformVertices","sourceFormat","schemaVersion","version","title","created","numTriangles","numVertices","numObjects","rootMetaObjectId","modelMetaObjectId","ctx","msg","nextId","cityObjects","CityObjects","objectId","parseCityObject","parseCityJSON","centerPos","cityObject","parents","objectMaterial","surfaceMaterials","appearance","materials","geometryMaterial","material","themeIds","theme","surfaceMaterial","parseGeometrySurfacesWithOwnMaterials","parseGeometrySurfacesWithSharedMaterial","createEntity","parseSurfacesWithOwnMaterials","boundaries","shells","solids","surfaces","surface","diffuseColor","transparency","sharedIndices","geometryCfg","newFace","extractLocalIndices","_toConsumableArray","pList","getNormalOfPositions","pv","to2D","unshift","tr","createGeometry","createMesh","parseSurfacesWithSharedMaterial","primitiveCfg","boundary","newBoundary","index","includes","vertexIndex","indexOf","nexti","_p","_n","re","x3","tmp2","y3","utils","isString","parseGLTFIntoXKTModel","baseUri","metaModelData","_ref$includeTextures","includeTextures","_ref$includeNormals","includeNormals","getAttachment","numNormals","numUVs","parse","GLTFLoader","gltfData","metaModelCorrections","getMetaModelCorrections","geometryCreated","parseTexture","parseTextures","_textureSetId","parseTextureSet","_attributes","parseMaterialAttributes","parseMaterials","scene","scenes","nodes","countMeshUsage","parseNode","parseScene","parseDefaultScene","errMsg","eachRootStats","eachChildRoot","metaObjectsMap","metaObjectParent","rootMetaObject","numChildren","countChildren","source","sampler","createTexture","flipY","_textureId","textureSetCfg","normalTexture","normalTextureId","metallicPBR","pbrMetallicRoughness","baseColorTexture","extensions","specularPBR","specularTexture","specularColorTexture","createTextureSet","materialAttributes","diffuseFactor","common","technique","blinn","phong","lambert","diffuse","transparent","baseColorFactor","metallicFactor","roughnessFactor","node","instances","children","childNode","deferredMeshIds","depth","localMatrix","translation","numPrimitives","primitives","primitive","_xktGeometryId","xktGeometryId","mode","attributes","POSITION","NORMAL","COLOR_0","TEXCOORD_0","xktMeshId","meshCfg","nodeName","xktEntityId","rootMetaObjectStats","atob2","atob","Buffer","from","WEBGL_COMPONENT_TYPES","Int16Array","WEBGL_TYPE_SIZES","parseGLTFJSONIntoXKTModel","reuseGeometries","gltf","createXKTGeometryIds","nextMeshId","buffers","all","map","bufferInfo","_arrayBuffer","_buffer","uri","dataUriRegexResult","match","isBase64","decodeURIComponent","ArrayBuffer","view","parseArrayBuffer","parseBuffer","parseBuffers","bufferViewsInfo","bufferViews","parseBufferView","parseBufferViews","freeBuffers","materialsInfo","materialInfo","parseMaterial","_materialData","defaultSceneInfo","sceneInfo","glTFNode","bufferViewInfo","_typedArray","byteOffset","gltfMeshId","meshInfo","numPrimitivesInMesh","primitiveInfo","geometryHash","createPrimitiveGeometryHash","geometryArrays","parsePrimitiveGeometry","childNodeIdx","childGLTFNode","join","accessors","indicesIndex","accessorInfo","parseAccessorTypedArray","positionsIndex","normalsIndex","colorsIndex","bufferView","itemSize","TypedArray","componentType","itemBytes","BYTES_PER_ELEMENT","byteStride","count","parseIFCIntoXKTModel","WebIFC","_ref$autoNormals","autoNormals","includeTypes","excludeTypes","wasmPath","ifcAPI","IfcAPI","SetWasmPath","Init","modelID","OpenModel","ifcProjectId","GetLineIDsWithType","IFCPROJECT","GetLine","ifcProject","parseSpatialChildren","parseMetadata","flatMeshes","LoadAllGeometry","size","createObject","IFCSPACE","ifcSpaceId","flatMesh","GetFlatMesh","parseGeometry","IFCRELDEFINESBYPROPERTIES","relID","rel","relatingPropertyDefinition","RelatingPropertyDefinition","GlobalId","relatedObjects","RelatedObjects","HasProperties","Name","nominalValue","NominalValue","property","valueType","Description","description","createPropertySet","parsePropertySets","ifcElement","parseRelatedItemsOfType","expressID","IFCRELAGGREGATES","IFCRELCONTAINEDINSPATIALSTRUCTURE","relation","related","relatedItems","isArray","element2","flatMeshExpressID","placedGeometries","placedGeometry","geometryExpressID","GetGeometry","vertexData","GetVertexArray","GetVertexData","GetVertexDataSize","GetIndexArray","GetIndexData","GetIndexDataSize","flatTransformation","MAX_VERTICES","parseLASIntoXKTModel","_ref$colorDepth","colorDepth","_ref$fp","fp64","_ref$skip","skip","_ref$log","LASLoader","las","parsedData","loaderData","pointsFormatId","readAttributes","intensity","readIntensities","readColorsAndIntensities","pointsChunks","chunkArray","positionsValue","readPositions","colorsChunks","attributesPosition","attributesColor","attributesIntensity","colorSize","intensities","colorsCompressedSize","l","chunkSize","parseMetaModelIntoXKTModel","includeTypesMap","excludeTypesMap","newObject","countMetaObjects","parsePCDIntoXKTModel","_ref$littleEndian","littleEndian","textData","TextDecoder","decode","il","fromCharCode","escape","decodeText","header","result1","search","result2","exec","headerLen","str","fields","viewpoint","parseFloat","parseInt","sizeSum","rowSize","parseHeader","line","rgb","g","sizes","compressedSize","decompressedSize","decompressed","inData","outLength","ctrl","ref","inLength","outData","inPtr","outPtr","decompressLZF","dataview","DataView","getFloat32","getUint8","row","parsePLYIntoXKTModel","_x","_parsePLYIntoXKTModel","hasColors","colorsValue","PLYLoader","t0","parseSTLIntoXKTModel","_parseSTLIntoXKTModel","splitMeshes","smoothNormals","smoothNormalsAngleThreshold","binData","ensureBinary","isBinary","parseBinary","parseASCII","reader","getUint32","defaultR","defaultG","defaultB","lastR","lastG","lastB","newMesh","normalX","normalY","normalZ","packedColor","getUint16","vertexstart","addMesh","normalx","normaly","normalz","verticesPerFace","normalsPerFace","text","faceRegex","faceCounter","floatRegex","vertexRegex","RegExp","normalRegex","nextGeometryId","ni","acc","posi","vertexMap","vertexNormals","vertexNormalAccum","numVerts","ii","jj","faceToVertexNormals","buildBoxGeometry","xSize","ySize","zSize","centerX","centerY","centerZ","buildBoxLinesGeometry","buildCylinderGeometry","radiusTop","radiusBottom","radialSegments","heightSegments","h","currentRadius","currentHeight","first","second","startIndex","tu","tv","openEnded","heightHalf","heightLength","radialAngle","PI","radialLength","radiusChange","atan","buildGridGeometry","divisions","step","halfSize","buildPlaneGeometry","xSegments","zSegments","halfWidth","halfHeight","planeX","planeZ","planeX1","planeZ1","segmentWidth","segmentHeight","offset2","buildSphereGeometry","lod","widthSegments","sinTheta","cosTheta","phi","sinPhi","buildTorusGeometry","tube","tubeSegments","arc","letters","buildVectorTextGeometry","penUp","pointsLen","origin","xOrigin","yOrigin","zOrigin","trim","countVerts","iLine","buf","fs","path","convert2xkt","configs","sourceData","metaModelSource","output","outputXKTModel","outputXKT","_ref$reuseGeometries","_ref$minTileSize","outputStats","_ref$rotateX","rotateX","sourceSize","xktSize","compressionRatio","conversionTime","_log","startTime","Date","sourceConfigs","ext","extname","fileTypeConfigs","readFileSync","sourceFileSizeBytes","toFixed","overrideOption","convert","dirname","option1","option2","parser","converterParams","createDefaultMetaObjects","finalize","xktArrayBuffer","xktContent","targetFileSizeBytes","outputDir","existsSync","mkdirSync","recursive","writeFileSync","installFilePolyfills"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"xeokit-convert.cjs.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,QAAQ,sCCTXH,EAAOD,QAAUK,QAAQ,eCAzBJ,EAAOD,QAAUK,QAAQ,UCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,CCrBAO,EAAoBK,EAAI,CAACZ,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAKzB,IACH,oBAAX0B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAejB,EAAS0B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eA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AQ,GACnEruB,EAAM9d,KAAO4d,EAAS5d,KACtB2a,EAAI,sBAADvxB,OAAuB00B,EAAM13B,aAC5BkzC,GACA3e,EAAI,mBAAqB2e,GAA8B,kBAEvDC,GACA5e,EAAI,mBAAqB4e,GAA8B,mBAE3D5e,EAAI,aAAemD,EAAMstB,QAAU,OACnCzwB,EAAI,uBAAyBmD,EAAMiF,aAAe,KAAMopB,QAAQ,GAAK,MACrExxB,EAAI,sBAAwBmD,EAAMutB,kBAClC1wB,EAAI,oBAAsBmD,EAAMwtB,eAAiB,MACjD3wB,EAAI,0BAA4BmD,EAAMK,gBACtCxD,EAAI,4BAA8BmD,EAAMI,iBACxCvD,EAAI,+BAAiCmD,EAAMqN,YAC3CxQ,EAAI,yBAA2BmD,EAAMT,eACrC1C,EAAI,uBAAyBmD,EAAMM,aACnCzD,EAAI,0BAA4BmD,EAAMO,gBACtC1D,EAAI,wBAA0BmD,EAAMmN,cACpCtQ,EAAI,uBAAyBmD,EAAMoN,aACnCvQ,EAAI,kBAAoBmD,EAAM8R,QAC9BjV,EAAI,sBAAwBmD,EAAM6R,YAClChV,EAAI,oBAAsBiD,EAAStF,UAAU9vB,QAC7CmyB,EAAI,gBAAkBmD,EAAMvG,aAExBozB,EAAQ,CACR,IAAMqC,EAAY1C,GAAKgC,QAAQ3B,GACb,KAAdqC,GAAqB3C,GAAG4C,WAAWD,IACnC3C,GAAG6C,UAAUF,EAAW,CAACG,WAAW,IAExCxyB,EAAI,qBAAuBgwB,GAC3BN,GAAG+C,cAAczC,EAAQmC,EAC7B,CAEIlC,GACAA,EAAehtB,GAGfitB,GACAA,EAAUiC,GAGV9B,GACAA,EAAYltB,GAGhBpN,GACJ,GACJ,IAAG,SAAC/B,GACAgC,EAAOhC,EACX,GACJ,CACJ,GACJ,EC5bA0+B,EAAAA,EAAAA","sources":["webpack://convert2xkt/webpack/universalModuleDefinition","webpack://convert2xkt/external commonjs \"fs\"","webpack://convert2xkt/external commonjs \"path\"","webpack://convert2xkt/webpack/bootstrap","webpack://convert2xkt/webpack/runtime/define property getters","webpack://convert2xkt/webpack/runtime/hasOwnProperty shorthand","webpack://convert2xkt/webpack/runtime/make namespace object","webpack://convert2xkt/external commonjs \"@loaders.gl/polyfills\"","webpack://convert2xkt/./src/XKT_INFO.js","webpack://convert2xkt/./src/lib/math.js","webpack://convert2xkt/./src/XKTModel/lib/geometryCompression.js","webpack://convert2xkt/./src/constants.js","webpack://convert2xkt/./src/XKTModel/lib/buildEdgeIndices.js","webpack://convert2xkt/./src/XKTModel/lib/isTriangleMeshSolid.js","webpack://convert2xkt/./src/XKTModel/XKTMesh.js","webpack://convert2xkt/./src/XKTModel/XKTGeometry.js","webpack://convert2xkt/./src/XKTModel/XKTEntity.js","webpack://convert2xkt/./src/XKTModel/XKTTile.js","webpack://convert2xkt/./src/XKTModel/KDNode.js","webpack://convert2xkt/./src/XKTModel/XKTMetaObject.js","webpack://convert2xkt/./src/XKTModel/XKTPropertySet.js","webpack://convert2xkt/./src/XKTModel/XKTTexture.js","webpack://convert2xkt/./src/XKTModel/XKTTextureSet.js","webpack://convert2xkt/external commonjs \"@loaders.gl/core\"","webpack://convert2xkt/external commonjs \"@loaders.gl/textures\"","webpack://convert2xkt/external commonjs \"@loaders.gl/images\"","webpack://convert2xkt/./src/XKTModel/XKTModel.js","webpack://convert2xkt/./src/lib/mergeVertices.js","webpack://convert2xkt/external commonjs \"pako\"","webpack://convert2xkt/./src/XKTModel/writeXKTModelToArrayBuffer.js","webpack://convert2xkt/./src/lib/earcut.js","webpack://convert2xkt/./src/parsers/parseCityJSONIntoXKTModel.js","webpack://convert2xkt/./src/XKTModel/lib/utils.js","webpack://convert2xkt/external commonjs \"@loaders.gl/gltf\"","webpack://convert2xkt/./src/parsers/parseGLTFIntoXKTModel.js","webpack://convert2xkt/./src/parsers/parseGLTFJSONIntoXKTModel.js","webpack://convert2xkt/./src/parsers/parseIFCIntoXKTModel.js","webpack://convert2xkt/external commonjs \"@loaders.gl/las\"","webpack://convert2xkt/./src/parsers/parseLASIntoXKTModel.js","webpack://convert2xkt/./src/parsers/parseMetaModelIntoXKTModel.js","webpack://convert2xkt/./src/parsers/parsePCDIntoXKTModel.js","webpack://convert2xkt/external commonjs \"@loaders.gl/ply\"","webpack://convert2xkt/./src/parsers/parsePLYIntoXKTModel.js","webpack://convert2xkt/./src/parsers/parseSTLIntoXKTModel.js","webpack://convert2xkt/./src/lib/faceToVertexNormals.js","webpack://convert2xkt/./src/geometryBuilders/buildBoxGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildBoxLinesGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildCylinderGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildGridGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildPlaneGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildSphereGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildTorusGeometry.js","webpack://convert2xkt/./src/geometryBuilders/buildVectorTextGeometry.js","webpack://convert2xkt/./src/XKTModel/lib/toArraybuffer.js","webpack://convert2xkt/./src/convert2xkt.js","webpack://convert2xkt/./index.dist.node.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"convert2xkt\"] = factory();\n\telse\n\t\troot[\"convert2xkt\"] = factory();\n})(global, () => {\nreturn ","module.exports = require(\"fs\");","module.exports = require(\"path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/polyfills\");","/**\n * @desc Provides info on the XKT generated by xeokit-convert.\n */\nconst XKT_INFO = {\n\n /**\n * The XKT version generated by xeokit-convert.\n *\n * This is the XKT version that's modeled by {@link XKTModel}, serialized\n * by {@link writeXKTModelToArrayBuffer}, and written by {@link convert2xkt}.\n *\n * * Current XKT version: **10**\n * * [XKT format specs](https://github.com/xeokit/xeokit-convert/blob/main/specs/index.md)\n *\n * @property xktVersion\n * @type {number}\n */\n xktVersion: 10\n};\n\nexport {XKT_INFO};","// Some temporary vars to help avoid garbage collection\n\nconst doublePrecision = true;\nconst FloatArrayType = doublePrecision ? Float64Array : Float32Array;\n\nconst tempMat1 = new FloatArrayType(16);\nconst tempMat2 = new FloatArrayType(16);\nconst tempVec4 = new FloatArrayType(4);\n\n/**\n * @private\n */\nconst math = {\n\n MIN_DOUBLE: -Number.MAX_SAFE_INTEGER,\n MAX_DOUBLE: Number.MAX_SAFE_INTEGER,\n\n /**\n * The number of radiians in a degree (0.0174532925).\n * @property DEGTORAD\n * @type {Number}\n */\n DEGTORAD: 0.0174532925,\n\n /**\n * The number of degrees in a radian.\n * @property RADTODEG\n * @type {Number}\n */\n RADTODEG: 57.295779513,\n\n /**\n * Returns a new, uninitialized two-element vector.\n * @method vec2\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec2(values) {\n return new FloatArrayType(values || 2);\n },\n\n /**\n * Returns a new, uninitialized three-element vector.\n * @method vec3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec3(values) {\n return new FloatArrayType(values || 3);\n },\n\n /**\n * Returns a new, uninitialized four-element vector.\n * @method vec4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec4(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3x3 matrix.\n * @method mat3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat3(values) {\n return new FloatArrayType(values || 9);\n },\n\n /**\n * Converts a 3x3 matrix to 4x4\n * @method mat3ToMat4\n * @param mat3 3x3 matrix.\n * @param mat4 4x4 matrix\n * @static\n * @returns {Number[]}\n */\n mat3ToMat4(mat3, mat4 = new FloatArrayType(16)) {\n mat4[0] = mat3[0];\n mat4[1] = mat3[1];\n mat4[2] = mat3[2];\n mat4[3] = 0;\n mat4[4] = mat3[3];\n mat4[5] = mat3[4];\n mat4[6] = mat3[5];\n mat4[7] = 0;\n mat4[8] = mat3[6];\n mat4[9] = mat3[7];\n mat4[10] = mat3[8];\n mat4[11] = 0;\n mat4[12] = 0;\n mat4[13] = 0;\n mat4[14] = 0;\n mat4[15] = 1;\n return mat4;\n },\n\n /**\n * Returns a new, uninitialized 4x4 matrix.\n * @method mat4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat4(values) {\n return new FloatArrayType(values || 16);\n },\n\n /**\n * Converts a 4x4 matrix to 3x3\n * @method mat4ToMat3\n * @param mat4 4x4 matrix.\n * @param mat3 3x3 matrix\n * @static\n * @returns {Number[]}\n */\n mat4ToMat3(mat4, mat3) { // TODO\n //return new FloatArrayType(values || 9);\n },\n\n /**\n * Returns a new UUID.\n * @method createUUID\n * @static\n * @return string The new UUID\n */\n createUUID: ((() => {\n const self = {};\n const lut = [];\n for (let i = 0; i < 256; i++) {\n lut[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n return () => {\n const d0 = Math.random() * 0xffffffff | 0;\n const d1 = Math.random() * 0xffffffff | 0;\n const d2 = Math.random() * 0xffffffff | 0;\n const d3 = Math.random() * 0xffffffff | 0;\n return `${lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]}-${lut[d1 & 0xff]}${lut[d1 >> 8 & 0xff]}-${lut[d1 >> 16 & 0x0f | 0x40]}${lut[d1 >> 24 & 0xff]}-${lut[d2 & 0x3f | 0x80]}${lut[d2 >> 8 & 0xff]}-${lut[d2 >> 16 & 0xff]}${lut[d2 >> 24 & 0xff]}${lut[d3 & 0xff]}${lut[d3 >> 8 & 0xff]}${lut[d3 >> 16 & 0xff]}${lut[d3 >> 24 & 0xff]}`;\n };\n }))(),\n\n /**\n * Clamps a value to the given range.\n * @param {Number} value Value to clamp.\n * @param {Number} min Lower bound.\n * @param {Number} max Upper bound.\n * @returns {Number} Clamped result.\n */\n clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n },\n\n /**\n * Floating-point modulus\n * @method fmod\n * @static\n * @param {Number} a\n * @param {Number} b\n * @returns {*}\n */\n fmod(a, b) {\n if (a < b) {\n console.error(\"math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring\");\n return a;\n }\n while (b <= a) {\n a -= b;\n }\n return a;\n },\n\n /**\n * Negates a four-element vector.\n * @method negateVec4\n * @static\n * @param {Array(Number)} v Vector to negate\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n negateVec4(v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = -v[0];\n dest[1] = -v[1];\n dest[2] = -v[2];\n dest[3] = -v[3];\n return dest;\n },\n\n /**\n * Adds one four-element vector to another.\n * @method addVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n dest[3] = u[3] + v[3];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a four-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n dest[3] = v[3] + s;\n return dest;\n },\n\n /**\n * Adds one three-element vector to another.\n * @method addVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a three-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n return dest;\n },\n\n /**\n * Subtracts one four-element vector from another.\n * @method subVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n dest[3] = u[3] - v[3];\n return dest;\n },\n\n /**\n * Subtracts one three-element vector from another.\n * @method subVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n return dest;\n },\n\n /**\n * Subtracts one two-element vector from another.\n * @method subVec2\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec2(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n return dest;\n },\n\n /**\n * Subtracts a scalar value from each element of a four-element vector.\n * @method subVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] - s;\n dest[1] = v[1] - s;\n dest[2] = v[2] - s;\n dest[3] = v[3] - s;\n return dest;\n },\n\n /**\n * Sets each element of a 4-element vector to a scalar value minus the value of that element.\n * @method subScalarVec4\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subScalarVec4(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s - v[0];\n dest[1] = s - v[1];\n dest[2] = s - v[2];\n dest[3] = s - v[3];\n return dest;\n },\n\n /**\n * Multiplies one three-element vector by another.\n * @method mulVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n mulVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] * v[0];\n dest[1] = u[1] * v[1];\n dest[2] = u[2] * v[2];\n dest[3] = u[3] * v[3];\n return dest;\n },\n\n /**\n * Multiplies each element of a four-element vector by a scalar.\n * @method mulVec34calar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n dest[3] = v[3] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a three-element vector by a scalar.\n * @method mulVec3Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a two-element vector by a scalar.\n * @method mulVec2Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec2Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n return dest;\n },\n\n /**\n * Divides one three-element vector by another.\n * @method divVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n return dest;\n },\n\n /**\n * Divides one four-element vector by another.\n * @method divVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n dest[3] = u[3] / v[3];\n return dest;\n },\n\n /**\n * Divides a scalar by a three-element vector, returning a new vector.\n * @method divScalarVec3\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec3(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n return dest;\n },\n\n /**\n * Divides a three-element vector by a scalar.\n * @method divVec3Scalar\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n return dest;\n },\n\n /**\n * Divides a four-element vector by a scalar.\n * @method divVec4Scalar\n * @static\n * @param v vec4\n * @param s scalar\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n dest[3] = v[3] / s;\n return dest;\n },\n\n\n /**\n * Divides a scalar by a four-element vector, returning a new vector.\n * @method divScalarVec4\n * @static\n * @param s scalar\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec4(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n dest[3] = s / v[3];\n return dest;\n },\n\n /**\n * Returns the dot product of two four-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec4(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2] + u[3] * v[3]);\n },\n\n /**\n * Returns the cross product of two four-element vectors.\n * @method cross3Vec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec4(u, v) {\n const u0 = u[0];\n const u1 = u[1];\n const u2 = u[2];\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return [\n u1 * v2 - u2 * v1,\n u2 * v0 - u0 * v2,\n u0 * v1 - u1 * v0,\n 0.0];\n },\n\n /**\n * Returns the cross product of two three-element vectors.\n * @method cross3Vec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n const x = u[0];\n const y = u[1];\n const z = u[2];\n const x2 = v[0];\n const y2 = v[1];\n const z2 = v[2];\n dest[0] = y * z2 - z * y2;\n dest[1] = z * x2 - x * z2;\n dest[2] = x * y2 - y * x2;\n return dest;\n },\n\n\n sqLenVec4(v) { // TODO\n return math.dotVec4(v, v);\n },\n\n /**\n * Returns the length of a four-element vector.\n * @method lenVec4\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec4(v) {\n return Math.sqrt(math.sqLenVec4(v));\n },\n\n /**\n * Returns the dot product of two three-element vectors.\n * @method dotVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec3(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);\n },\n\n /**\n * Returns the dot product of two two-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec2(u, v) {\n return (u[0] * v[0] + u[1] * v[1]);\n },\n\n\n sqLenVec3(v) {\n return math.dotVec3(v, v);\n },\n\n\n sqLenVec2(v) {\n return math.dotVec2(v, v);\n },\n\n /**\n * Returns the length of a three-element vector.\n * @method lenVec3\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec3(v) {\n return Math.sqrt(math.sqLenVec3(v));\n },\n\n distVec3: ((() => {\n const vec = new FloatArrayType(3);\n return (v, w) => math.lenVec3(math.subVec3(v, w, vec));\n }))(),\n\n /**\n * Returns the length of a two-element vector.\n * @method lenVec2\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec2(v) {\n return Math.sqrt(math.sqLenVec2(v));\n },\n\n distVec2: ((() => {\n const vec = new FloatArrayType(2);\n return (v, w) => math.lenVec2(math.subVec2(v, w, vec));\n }))(),\n\n /**\n * @method rcpVec3\n * @static\n * @param v vec3\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n rcpVec3(v, dest) {\n return math.divScalarVec3(1.0, v, dest);\n },\n\n /**\n * Normalizes a four-element vector\n * @method normalizeVec4\n * @static\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n normalizeVec4(v, dest) {\n const f = 1.0 / math.lenVec4(v);\n return math.mulVec4Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a three-element vector\n * @method normalizeVec4\n * @static\n */\n normalizeVec3(v, dest) {\n const f = 1.0 / math.lenVec3(v);\n return math.mulVec3Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a two-element vector\n * @method normalizeVec2\n * @static\n */\n normalizeVec2(v, dest) {\n const f = 1.0 / math.lenVec2(v);\n return math.mulVec2Scalar(v, f, dest);\n },\n\n /**\n * Gets the angle between two vectors\n * @method angleVec3\n * @param v\n * @param w\n * @returns {number}\n */\n angleVec3(v, w) {\n let theta = math.dotVec3(v, w) / (Math.sqrt(math.sqLenVec3(v) * math.sqLenVec3(w)));\n theta = theta < -1 ? -1 : (theta > 1 ? 1 : theta); // Clamp to handle numerical problems\n return Math.acos(theta);\n },\n\n /**\n * Creates a three-element vector from the rotation part of a sixteen-element matrix.\n * @param m\n * @param dest\n */\n vec3FromMat4Scale: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (m, dest) => {\n\n tempVec3[0] = m[0];\n tempVec3[1] = m[1];\n tempVec3[2] = m[2];\n\n dest[0] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[4];\n tempVec3[1] = m[5];\n tempVec3[2] = m[6];\n\n dest[1] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[8];\n tempVec3[1] = m[9];\n tempVec3[2] = m[10];\n\n dest[2] = math.lenVec3(tempVec3);\n\n return dest;\n };\n }))(),\n\n /**\n * Converts an n-element vector to a JSON-serializable\n * array with values rounded to two decimal places.\n */\n vecToArray: ((() => {\n function trunc(v) {\n return Math.round(v * 100000) / 100000\n }\n\n return v => {\n v = Array.prototype.slice.call(v);\n for (let i = 0, len = v.length; i < len; i++) {\n v[i] = trunc(v[i]);\n }\n return v;\n };\n }))(),\n\n /**\n * Converts a 3-element vector from an array to an object of the form ````{x:999, y:999, z:999}````.\n * @param arr\n * @returns {{x: *, y: *, z: *}}\n */\n xyzArrayToObject(arr) {\n return {\"x\": arr[0], \"y\": arr[1], \"z\": arr[2]};\n },\n\n /**\n * Converts a 3-element vector object of the form ````{x:999, y:999, z:999}```` to an array.\n * @param xyz\n * @param [arry]\n * @returns {*[]}\n */\n xyzObjectToArray(xyz, arry) {\n arry = arry || new FloatArrayType(3);\n arry[0] = xyz.x;\n arry[1] = xyz.y;\n arry[2] = xyz.z;\n return arry;\n },\n\n /**\n * Duplicates a 4x4 identity matrix.\n * @method dupMat4\n * @static\n */\n dupMat4(m) {\n return m.slice(0, 16);\n },\n\n /**\n * Extracts a 3x3 matrix from a 4x4 matrix.\n * @method mat4To3\n * @static\n */\n mat4To3(m) {\n return [\n m[0], m[1], m[2],\n m[4], m[5], m[6],\n m[8], m[9], m[10]\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to the given scalar value.\n * @method m4s\n * @static\n */\n m4s(s) {\n return [\n s, s, s, s,\n s, s, s, s,\n s, s, s, s,\n s, s, s, s\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to zero.\n * @method setMat4ToZeroes\n * @static\n */\n setMat4ToZeroes() {\n return math.m4s(0.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n setMat4ToOnes() {\n return math.m4s(1.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n diagonalMat4v(v) {\n return new FloatArrayType([\n v[0], 0.0, 0.0, 0.0,\n 0.0, v[1], 0.0, 0.0,\n 0.0, 0.0, v[2], 0.0,\n 0.0, 0.0, 0.0, v[3]\n ]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given vector.\n * @method diagonalMat4c\n * @static\n */\n diagonalMat4c(x, y, z, w) {\n return math.diagonalMat4v([x, y, z, w]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given scalar.\n * @method diagonalMat4s\n * @static\n */\n diagonalMat4s(s) {\n return math.diagonalMat4c(s, s, s, s);\n },\n\n /**\n * Returns a 4x4 identity matrix.\n * @method identityMat4\n * @static\n */\n identityMat4(mat = new FloatArrayType(16)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n mat[3] = 0.0;\n\n mat[4] = 0.0;\n mat[5] = 1.0;\n mat[6] = 0.0;\n mat[7] = 0.0;\n\n mat[8] = 0.0;\n mat[9] = 0.0;\n mat[10] = 1.0;\n mat[11] = 0.0;\n\n mat[12] = 0.0;\n mat[13] = 0.0;\n mat[14] = 0.0;\n mat[15] = 1.0;\n\n return mat;\n },\n\n /**\n * Returns a 3x3 identity matrix.\n * @method identityMat3\n * @static\n */\n identityMat3(mat = new FloatArrayType(9)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n\n mat[3] = 0.0;\n mat[4] = 1.0;\n mat[5] = 0.0;\n\n mat[6] = 0.0;\n mat[7] = 0.0;\n mat[8] = 1.0;\n\n return mat;\n },\n\n /**\n * Tests if the given 4x4 matrix is the identity matrix.\n * @method isIdentityMat4\n * @static\n */\n isIdentityMat4(m) {\n if (m[0] !== 1.0 || m[1] !== 0.0 || m[2] !== 0.0 || m[3] !== 0.0 ||\n m[4] !== 0.0 || m[5] !== 1.0 || m[6] !== 0.0 || m[7] !== 0.0 ||\n m[8] !== 0.0 || m[9] !== 0.0 || m[10] !== 1.0 || m[11] !== 0.0 ||\n m[12] !== 0.0 || m[13] !== 0.0 || m[14] !== 0.0 || m[15] !== 1.0) {\n return false;\n }\n return true;\n },\n\n /**\n * Negates the given 4x4 matrix.\n * @method negateMat4\n * @static\n */\n negateMat4(m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = -m[0];\n dest[1] = -m[1];\n dest[2] = -m[2];\n dest[3] = -m[3];\n dest[4] = -m[4];\n dest[5] = -m[5];\n dest[6] = -m[6];\n dest[7] = -m[7];\n dest[8] = -m[8];\n dest[9] = -m[9];\n dest[10] = -m[10];\n dest[11] = -m[11];\n dest[12] = -m[12];\n dest[13] = -m[13];\n dest[14] = -m[14];\n dest[15] = -m[15];\n return dest;\n },\n\n /**\n * Adds the given 4x4 matrices together.\n * @method addMat4\n * @static\n */\n addMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] + b[0];\n dest[1] = a[1] + b[1];\n dest[2] = a[2] + b[2];\n dest[3] = a[3] + b[3];\n dest[4] = a[4] + b[4];\n dest[5] = a[5] + b[5];\n dest[6] = a[6] + b[6];\n dest[7] = a[7] + b[7];\n dest[8] = a[8] + b[8];\n dest[9] = a[9] + b[9];\n dest[10] = a[10] + b[10];\n dest[11] = a[11] + b[11];\n dest[12] = a[12] + b[12];\n dest[13] = a[13] + b[13];\n dest[14] = a[14] + b[14];\n dest[15] = a[15] + b[15];\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addMat4Scalar\n * @static\n */\n addMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] + s;\n dest[1] = m[1] + s;\n dest[2] = m[2] + s;\n dest[3] = m[3] + s;\n dest[4] = m[4] + s;\n dest[5] = m[5] + s;\n dest[6] = m[6] + s;\n dest[7] = m[7] + s;\n dest[8] = m[8] + s;\n dest[9] = m[9] + s;\n dest[10] = m[10] + s;\n dest[11] = m[11] + s;\n dest[12] = m[12] + s;\n dest[13] = m[13] + s;\n dest[14] = m[14] + s;\n dest[15] = m[15] + s;\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addScalarMat4\n * @static\n */\n addScalarMat4(s, m, dest) {\n return math.addMat4Scalar(m, s, dest);\n },\n\n /**\n * Subtracts the second 4x4 matrix from the first.\n * @method subMat4\n * @static\n */\n subMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] - b[0];\n dest[1] = a[1] - b[1];\n dest[2] = a[2] - b[2];\n dest[3] = a[3] - b[3];\n dest[4] = a[4] - b[4];\n dest[5] = a[5] - b[5];\n dest[6] = a[6] - b[6];\n dest[7] = a[7] - b[7];\n dest[8] = a[8] - b[8];\n dest[9] = a[9] - b[9];\n dest[10] = a[10] - b[10];\n dest[11] = a[11] - b[11];\n dest[12] = a[12] - b[12];\n dest[13] = a[13] - b[13];\n dest[14] = a[14] - b[14];\n dest[15] = a[15] - b[15];\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subMat4Scalar\n * @static\n */\n subMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] - s;\n dest[1] = m[1] - s;\n dest[2] = m[2] - s;\n dest[3] = m[3] - s;\n dest[4] = m[4] - s;\n dest[5] = m[5] - s;\n dest[6] = m[6] - s;\n dest[7] = m[7] - s;\n dest[8] = m[8] - s;\n dest[9] = m[9] - s;\n dest[10] = m[10] - s;\n dest[11] = m[11] - s;\n dest[12] = m[12] - s;\n dest[13] = m[13] - s;\n dest[14] = m[14] - s;\n dest[15] = m[15] - s;\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subScalarMat4\n * @static\n */\n subScalarMat4(s, m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = s - m[0];\n dest[1] = s - m[1];\n dest[2] = s - m[2];\n dest[3] = s - m[3];\n dest[4] = s - m[4];\n dest[5] = s - m[5];\n dest[6] = s - m[6];\n dest[7] = s - m[7];\n dest[8] = s - m[8];\n dest[9] = s - m[9];\n dest[10] = s - m[10];\n dest[11] = s - m[11];\n dest[12] = s - m[12];\n dest[13] = s - m[13];\n dest[14] = s - m[14];\n dest[15] = s - m[15];\n return dest;\n },\n\n /**\n * Multiplies the two given 4x4 matrix by each other.\n * @method mulMat4\n * @static\n */\n mulMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = a[0];\n\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[4];\n const b11 = b[5];\n const b12 = b[6];\n const b13 = b[7];\n const b20 = b[8];\n const b21 = b[9];\n const b22 = b[10];\n const b23 = b[11];\n const b30 = b[12];\n const b31 = b[13];\n const b32 = b[14];\n const b33 = b[15];\n\n dest[0] = b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30;\n dest[1] = b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31;\n dest[2] = b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32;\n dest[3] = b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33;\n dest[4] = b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30;\n dest[5] = b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31;\n dest[6] = b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32;\n dest[7] = b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33;\n dest[8] = b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30;\n dest[9] = b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31;\n dest[10] = b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32;\n dest[11] = b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33;\n dest[12] = b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30;\n dest[13] = b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31;\n dest[14] = b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32;\n dest[15] = b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33;\n\n return dest;\n },\n\n /**\n * Multiplies the two given 3x3 matrices by each other.\n * @method mulMat4\n * @static\n */\n mulMat3(a, b, dest) {\n if (!dest) {\n dest = new FloatArrayType(9);\n }\n\n const a11 = a[0];\n const a12 = a[3];\n const a13 = a[6];\n const a21 = a[1];\n const a22 = a[4];\n const a23 = a[7];\n const a31 = a[2];\n const a32 = a[5];\n const a33 = a[8];\n const b11 = b[0];\n const b12 = b[3];\n const b13 = b[6];\n const b21 = b[1];\n const b22 = b[4];\n const b23 = b[7];\n const b31 = b[2];\n const b32 = b[5];\n const b33 = b[8];\n\n dest[0] = a11 * b11 + a12 * b21 + a13 * b31;\n dest[3] = a11 * b12 + a12 * b22 + a13 * b32;\n dest[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\n dest[1] = a21 * b11 + a22 * b21 + a23 * b31;\n dest[4] = a21 * b12 + a22 * b22 + a23 * b32;\n dest[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\n dest[2] = a31 * b11 + a32 * b21 + a33 * b31;\n dest[5] = a31 * b12 + a32 * b22 + a33 * b32;\n dest[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\n return dest;\n },\n\n /**\n * Multiplies each element of the given 4x4 matrix by the given scalar.\n * @method mulMat4Scalar\n * @static\n */\n mulMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] * s;\n dest[1] = m[1] * s;\n dest[2] = m[2] * s;\n dest[3] = m[3] * s;\n dest[4] = m[4] * s;\n dest[5] = m[5] * s;\n dest[6] = m[6] * s;\n dest[7] = m[7] * s;\n dest[8] = m[8] * s;\n dest[9] = m[9] * s;\n dest[10] = m[10] * s;\n dest[11] = m[11] * s;\n dest[12] = m[12] * s;\n dest[13] = m[13] * s;\n dest[14] = m[14] * s;\n dest[15] = m[15] * s;\n return dest;\n },\n\n /**\n * Multiplies the given 4x4 matrix by the given four-element vector.\n * @method mulMat4v4\n * @static\n */\n mulMat4v4(m, v, dest = math.vec4()) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Transposes the given 4x4 matrix.\n * @method transposeMat4\n * @static\n */\n transposeMat4(mat, dest) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n const m4 = mat[4];\n\n const m14 = mat[14];\n const m8 = mat[8];\n const m13 = mat[13];\n const m12 = mat[12];\n const m9 = mat[9];\n if (!dest || mat === dest) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a12 = mat[6];\n const a13 = mat[7];\n const a23 = mat[11];\n mat[1] = m4;\n mat[2] = m8;\n mat[3] = m12;\n mat[4] = a01;\n mat[6] = m9;\n mat[7] = m13;\n mat[8] = a02;\n mat[9] = a12;\n mat[11] = m14;\n mat[12] = a03;\n mat[13] = a13;\n mat[14] = a23;\n return mat;\n }\n dest[0] = mat[0];\n dest[1] = m4;\n dest[2] = m8;\n dest[3] = m12;\n dest[4] = mat[1];\n dest[5] = mat[5];\n dest[6] = m9;\n dest[7] = m13;\n dest[8] = mat[2];\n dest[9] = mat[6];\n dest[10] = mat[10];\n dest[11] = m14;\n dest[12] = mat[3];\n dest[13] = mat[7];\n dest[14] = mat[11];\n dest[15] = mat[15];\n return dest;\n },\n\n /**\n * Transposes the given 3x3 matrix.\n *\n * @method transposeMat3\n * @static\n */\n transposeMat3(mat, dest) {\n if (dest === mat) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a12 = mat[5];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = a01;\n dest[5] = mat[7];\n dest[6] = a02;\n dest[7] = a12;\n } else {\n dest[0] = mat[0];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = mat[1];\n dest[4] = mat[4];\n dest[5] = mat[7];\n dest[6] = mat[2];\n dest[7] = mat[5];\n dest[8] = mat[8];\n }\n return dest;\n },\n\n /**\n * Returns the determinant of the given 4x4 matrix.\n * @method determinantMat4\n * @static\n */\n determinantMat4(mat) {\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n return a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 +\n a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 +\n a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 +\n a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 +\n a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 +\n a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33;\n },\n\n /**\n * Returns the inverse of the given 4x4 matrix.\n * @method inverseMat4\n * @static\n */\n inverseMat4(mat, dest) {\n if (!dest) {\n dest = mat;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant (inlined to avoid double-caching)\n const invDet = 1 / (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06);\n\n dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;\n dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;\n dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;\n dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;\n dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;\n dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;\n dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;\n dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;\n dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;\n dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;\n dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;\n dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;\n dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;\n dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;\n dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;\n dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;\n\n return dest;\n },\n\n /**\n * Returns the trace of the given 4x4 matrix.\n * @method traceMat4\n * @static\n */\n traceMat4(m) {\n return (m[0] + m[5] + m[10] + m[15]);\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4\n * @static\n */\n translationMat4v(v, dest) {\n const m = dest || math.identityMat4();\n m[12] = v[0];\n m[13] = v[1];\n m[14] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 translation matrix.\n * @method translationMat3\n * @static\n */\n translationMat3v(v, dest) {\n const m = dest || math.identityMat3();\n m[6] = v[0];\n m[7] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4c\n * @static\n */\n translationMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.translationMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4s\n * @static\n */\n translationMat4s(s, dest) {\n return math.translationMat4c(s, s, s, dest);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param v\n * @param m\n */\n translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param x\n * @param y\n * @param z\n * @param m\n */\n OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n },\n\n translateMat4c(x, y, z, m) {\n\n const m3 = m[3];\n m[0] += m3 * x;\n m[1] += m3 * y;\n m[2] += m3 * z;\n\n const m7 = m[7];\n m[4] += m7 * x;\n m[5] += m7 * y;\n m[6] += m7 * z;\n\n const m11 = m[11];\n m[8] += m11 * x;\n m[9] += m11 * y;\n m[10] += m11 * z;\n\n const m15 = m[15];\n m[12] += m15 * x;\n m[13] += m15 * y;\n m[14] += m15 * z;\n\n return m;\n },\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4v\n * @static\n */\n rotationMat4v(anglerad, axis, m) {\n const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []);\n const s = Math.sin(anglerad);\n const c = Math.cos(anglerad);\n const q = 1.0 - c;\n\n const x = ax[0];\n const y = ax[1];\n const z = ax[2];\n\n let xy;\n let yz;\n let zx;\n let xs;\n let ys;\n let zs;\n\n //xx = x * x; used once\n //yy = y * y; used once\n //zz = z * z; used once\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n m = m || math.mat4();\n\n m[0] = (q * x * x) + c;\n m[1] = (q * xy) + zs;\n m[2] = (q * zx) - ys;\n m[3] = 0.0;\n\n m[4] = (q * xy) - zs;\n m[5] = (q * y * y) + c;\n m[6] = (q * yz) + xs;\n m[7] = 0.0;\n\n m[8] = (q * zx) + ys;\n m[9] = (q * yz) - xs;\n m[10] = (q * z * z) + c;\n m[11] = 0.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n\n return m;\n },\n\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4c\n * @static\n */\n rotationMat4c(anglerad, x, y, z, mat) {\n return math.rotationMat4v(anglerad, [x, y, z], mat);\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4v\n * @static\n */\n scalingMat4v(v, m = math.identityMat4()) {\n m[0] = v[0];\n m[5] = v[1];\n m[10] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 scale matrix.\n * @method scalingMat3v\n * @static\n */\n scalingMat3v(v, m = math.identityMat3()) {\n m[0] = v[0];\n m[4] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4c\n * @static\n */\n scalingMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.scalingMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param x\n * @param y\n * @param z\n * @param m\n */\n scaleMat4c(x, y, z, m) {\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n return m;\n },\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param xyz\n * @param m\n */\n scaleMat4v(xyz, m) {\n\n const x = xyz[0];\n const y = xyz[1];\n const z = xyz[2];\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4s\n * @static\n */\n scalingMat4s(s) {\n return math.scalingMat4c(s, s, s);\n },\n\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n *\n * @param {Number[]} q Rotation quaternion\n * @param {Number[]} v Translation vector\n * @param {Number[]} dest Destination matrix\n * @returns {Number[]} dest\n */\n rotationTranslationMat4(q, v, dest = math.mat4()) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n dest[0] = 1 - (yy + zz);\n dest[1] = xy + wz;\n dest[2] = xz - wy;\n dest[3] = 0;\n dest[4] = xy - wz;\n dest[5] = 1 - (xx + zz);\n dest[6] = yz + wx;\n dest[7] = 0;\n dest[8] = xz + wy;\n dest[9] = yz - wx;\n dest[10] = 1 - (xx + yy);\n dest[11] = 0;\n dest[12] = v[0];\n dest[13] = v[1];\n dest[14] = v[2];\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Gets Euler angles from a 4x4 matrix.\n *\n * @param {Number[]} mat The 4x4 matrix.\n * @param {String} order Desired Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination Euler angles, created by default.\n * @returns {Number[]} The Euler angles.\n */\n mat4ToEuler(mat, order, dest = math.vec4()) {\n const clamp = math.clamp;\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = mat[0];\n\n const m12 = mat[4];\n const m13 = mat[8];\n const m21 = mat[1];\n const m22 = mat[5];\n const m23 = mat[9];\n const m31 = mat[2];\n const m32 = mat[6];\n const m33 = mat[10];\n\n if (order === 'XYZ') {\n\n dest[1] = Math.asin(clamp(m13, -1, 1));\n\n if (Math.abs(m13) < 0.99999) {\n dest[0] = Math.atan2(-m23, m33);\n dest[2] = Math.atan2(-m12, m11);\n } else {\n dest[0] = Math.atan2(m32, m22);\n dest[2] = 0;\n\n }\n\n } else if (order === 'YXZ') {\n\n dest[0] = Math.asin(-clamp(m23, -1, 1));\n\n if (Math.abs(m23) < 0.99999) {\n dest[1] = Math.atan2(m13, m33);\n dest[2] = Math.atan2(m21, m22);\n } else {\n dest[1] = Math.atan2(-m31, m11);\n dest[2] = 0;\n }\n\n } else if (order === 'ZXY') {\n\n dest[0] = Math.asin(clamp(m32, -1, 1));\n\n if (Math.abs(m32) < 0.99999) {\n dest[1] = Math.atan2(-m31, m33);\n dest[2] = Math.atan2(-m12, m22);\n } else {\n dest[1] = 0;\n dest[2] = Math.atan2(m21, m11);\n }\n\n } else if (order === 'ZYX') {\n\n dest[1] = Math.asin(-clamp(m31, -1, 1));\n\n if (Math.abs(m31) < 0.99999) {\n dest[0] = Math.atan2(m32, m33);\n dest[2] = Math.atan2(m21, m11);\n } else {\n dest[0] = 0;\n dest[2] = Math.atan2(-m12, m22);\n }\n\n } else if (order === 'YZX') {\n\n dest[2] = Math.asin(clamp(m21, -1, 1));\n\n if (Math.abs(m21) < 0.99999) {\n dest[0] = Math.atan2(-m23, m22);\n dest[1] = Math.atan2(-m31, m11);\n } else {\n dest[0] = 0;\n dest[1] = Math.atan2(m13, m33);\n }\n\n } else if (order === 'XZY') {\n\n dest[2] = Math.asin(-clamp(m12, -1, 1));\n\n if (Math.abs(m12) < 0.99999) {\n dest[0] = Math.atan2(m32, m22);\n dest[1] = Math.atan2(m13, m11);\n } else {\n dest[0] = Math.atan2(-m23, m33);\n dest[1] = 0;\n }\n }\n\n return dest;\n },\n\n composeMat4(position, quaternion, scale, mat = math.mat4()) {\n math.quaternionToRotationMat4(quaternion, mat);\n math.scaleMat4v(scale, mat);\n math.translateMat4v(position, mat);\n\n return mat;\n },\n\n decomposeMat4: (() => {\n\n const vec = new FloatArrayType(3);\n const matrix = new FloatArrayType(16);\n\n return function decompose(mat, position, quaternion, scale) {\n\n vec[0] = mat[0];\n vec[1] = mat[1];\n vec[2] = mat[2];\n\n let sx = math.lenVec3(vec);\n\n vec[0] = mat[4];\n vec[1] = mat[5];\n vec[2] = mat[6];\n\n const sy = math.lenVec3(vec);\n\n vec[8] = mat[8];\n vec[9] = mat[9];\n vec[10] = mat[10];\n\n const sz = math.lenVec3(vec);\n\n // if determine is negative, we need to invert one scale\n const det = math.determinantMat4(mat);\n\n if (det < 0) {\n sx = -sx;\n }\n\n position[0] = mat[12];\n position[1] = mat[13];\n position[2] = mat[14];\n\n // scale the rotation part\n matrix.set(mat);\n\n const invSX = 1 / sx;\n const invSY = 1 / sy;\n const invSZ = 1 / sz;\n\n matrix[0] *= invSX;\n matrix[1] *= invSX;\n matrix[2] *= invSX;\n\n matrix[4] *= invSY;\n matrix[5] *= invSY;\n matrix[6] *= invSY;\n\n matrix[8] *= invSZ;\n matrix[9] *= invSZ;\n matrix[10] *= invSZ;\n\n math.mat4ToQuaternion(matrix, quaternion);\n\n scale[0] = sx;\n scale[1] = sy;\n scale[2] = sz;\n\n return this;\n\n };\n\n })(),\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4v\n * @param pos vec3 position of the viewer\n * @param target vec3 point the viewer is looking at\n * @param up vec3 pointing \"up\"\n * @param dest mat4 Optional, mat4 matrix will be written into\n *\n * @return {mat4} dest if specified, a new mat4 otherwise\n */\n lookAtMat4v(pos, target, up, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n\n const posx = pos[0];\n const posy = pos[1];\n const posz = pos[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const targetx = target[0];\n const targety = target[1];\n const targetz = target[2];\n\n if (posx === targetx && posy === targety && posz === targetz) {\n return math.identityMat4();\n }\n\n let z0;\n let z1;\n let z2;\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let len;\n\n //vec3.direction(eye, center, z);\n z0 = posx - targetx;\n z1 = posy - targety;\n z2 = posz - targetz;\n\n // normalize (no check needed for 0 because of early return)\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n //vec3.normalize(vec3.cross(up, z, x));\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n //vec3.normalize(vec3.cross(z, x, y));\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n dest[0] = x0;\n dest[1] = y0;\n dest[2] = z0;\n dest[3] = 0;\n dest[4] = x1;\n dest[5] = y1;\n dest[6] = z1;\n dest[7] = 0;\n dest[8] = x2;\n dest[9] = y2;\n dest[10] = z2;\n dest[11] = 0;\n dest[12] = -(x0 * posx + x1 * posy + x2 * posz);\n dest[13] = -(y0 * posx + y1 * posy + y2 * posz);\n dest[14] = -(z0 * posx + z1 * posy + z2 * posz);\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4c\n * @static\n */\n lookAtMat4c(posx, posy, posz, targetx, targety, targetz, upx, upy, upz) {\n return math.lookAtMat4v([posx, posy, posz], [targetx, targety, targetz], [upx, upy, upz], []);\n },\n\n /**\n * Returns a 4x4 orthographic projection matrix.\n * @method orthoMat4c\n * @static\n */\n orthoMat4c(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n\n dest[0] = 2.0 / rl;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 0.0;\n\n dest[4] = 0.0;\n dest[5] = 2.0 / tb;\n dest[6] = 0.0;\n dest[7] = 0.0;\n\n dest[8] = 0.0;\n dest[9] = 0.0;\n dest[10] = -2.0 / fn;\n dest[11] = 0.0;\n\n dest[12] = -(left + right) / rl;\n dest[13] = -(top + bottom) / tb;\n dest[14] = -(far + near) / fn;\n dest[15] = 1.0;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4v(fmin, fmax, m) {\n if (!m) {\n m = math.mat4();\n }\n\n const fmin4 = [fmin[0], fmin[1], fmin[2], 0.0];\n const fmax4 = [fmax[0], fmax[1], fmax[2], 0.0];\n\n math.addVec4(fmax4, fmin4, tempMat1);\n math.subVec4(fmax4, fmin4, tempMat2);\n\n const t = 2.0 * fmin4[2];\n\n const tempMat20 = tempMat2[0];\n const tempMat21 = tempMat2[1];\n const tempMat22 = tempMat2[2];\n\n m[0] = t / tempMat20;\n m[1] = 0.0;\n m[2] = 0.0;\n m[3] = 0.0;\n\n m[4] = 0.0;\n m[5] = t / tempMat21;\n m[6] = 0.0;\n m[7] = 0.0;\n\n m[8] = tempMat1[0] / tempMat20;\n m[9] = tempMat1[1] / tempMat21;\n m[10] = -tempMat1[2] / tempMat22;\n m[11] = -1.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = -t * fmax4[2] / tempMat22;\n m[15] = 0.0;\n\n return m;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n dest[0] = (near * 2) / rl;\n dest[1] = 0;\n dest[2] = 0;\n dest[3] = 0;\n dest[4] = 0;\n dest[5] = (near * 2) / tb;\n dest[6] = 0;\n dest[7] = 0;\n dest[8] = (right + left) / rl;\n dest[9] = (top + bottom) / tb;\n dest[10] = -(far + near) / fn;\n dest[11] = -1;\n dest[12] = 0;\n dest[13] = 0;\n dest[14] = -(far * near * 2) / fn;\n dest[15] = 0;\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method perspectiveMat4v\n * @static\n */\n perspectiveMat4(fovyrad, aspectratio, znear, zfar, m) {\n const pmin = [];\n const pmax = [];\n\n pmin[2] = znear;\n pmax[2] = zfar;\n\n pmax[1] = pmin[2] * Math.tan(fovyrad / 2.0);\n pmin[1] = -pmax[1];\n\n pmax[0] = pmax[1] * aspectratio;\n pmin[0] = -pmax[0];\n\n return math.frustumMat4v(pmin, pmax, m);\n },\n\n /**\n * Transforms a three-element position by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint3(m, p, dest = math.vec3()) {\n\n const x = p[0];\n const y = p[1];\n const z = p[2];\n\n dest[0] = (m[0] * x) + (m[4] * y) + (m[8] * z) + m[12];\n dest[1] = (m[1] * x) + (m[5] * y) + (m[9] * z) + m[13];\n dest[2] = (m[2] * x) + (m[6] * y) + (m[10] * z) + m[14];\n\n return dest;\n },\n\n /**\n * Transforms a homogeneous coordinate by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint4(m, v, dest = math.vec4()) {\n dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];\n dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];\n dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3];\n dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3];\n\n return dest;\n },\n\n\n /**\n * Transforms an array of three-element positions by a 4x4 matrix.\n * @method transformPoints3\n * @static\n */\n transformPoints3(m, points, points2) {\n const result = points2 || [];\n const len = points.length;\n let p0;\n let p1;\n let p2;\n let pi;\n\n // cache values\n const m0 = m[0];\n\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n let r;\n\n for (let i = 0; i < len; ++i) {\n\n // cache values\n pi = points[i];\n\n p0 = pi[0];\n p1 = pi[1];\n p2 = pi[2];\n\n r = result[i] || (result[i] = [0, 0, 0]);\n\n r[0] = (m0 * p0) + (m4 * p1) + (m8 * p2) + m12;\n r[1] = (m1 * p0) + (m5 * p1) + (m9 * p2) + m13;\n r[2] = (m2 * p0) + (m6 * p1) + (m10 * p2) + m14;\n r[3] = (m3 * p0) + (m7 * p1) + (m11 * p2) + m15;\n }\n\n result.length = len;\n\n return result;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions3\n * @static\n */\n transformPositions3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 3) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions4\n * @static\n */\n transformPositions4(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms a three-element vector by a 4x4 matrix.\n * @method transformVec3\n * @static\n */\n transformVec3(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n dest = dest || this.vec3();\n dest[0] = (m[0] * v0) + (m[4] * v1) + (m[8] * v2);\n dest[1] = (m[1] * v0) + (m[5] * v1) + (m[9] * v2);\n dest[2] = (m[2] * v0) + (m[6] * v1) + (m[10] * v2);\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 matrix.\n * @method transformVec4\n * @static\n */\n transformVec4(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest = dest || math.vec4();\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the x-axis\n *\n * @method rotateVec3X\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3X(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);\n r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the y-axis\n *\n * @method rotateVec3Y\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Y(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the z-axis\n *\n * @method rotateVec3Z\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Z(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);\n r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);\n r[2] = p[2];\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 projection matrix.\n *\n * @method projectVec4\n * @param {Number[]} p 3D View-space coordinate\n * @param {Number[]} q 2D Projected coordinate\n * @returns {Number[]} 2D Projected coordinate\n * @static\n */\n projectVec4(p, q) {\n const f = 1.0 / p[3];\n q = q || math.vec2();\n q[0] = v[0] * f;\n q[1] = v[1] * f;\n return q;\n },\n\n /**\n * Unprojects a three-element vector.\n *\n * @method unprojectVec3\n * @param {Number[]} p 3D Projected coordinate\n * @param {Number[]} viewMat View matrix\n * @returns {Number[]} projMat Projection matrix\n * @static\n */\n unprojectVec3: ((() => {\n const mat = new FloatArrayType(16);\n const mat2 = new FloatArrayType(16);\n const mat3 = new FloatArrayType(16);\n return function (p, viewMat, projMat, q) {\n return this.transformVec3(this.mulMat4(this.inverseMat4(viewMat, mat), this.inverseMat4(projMat, mat2), mat3), p, q)\n };\n }))(),\n\n /**\n * Linearly interpolates between two 3D vectors.\n * @method lerpVec3\n * @static\n */\n lerpVec3(t, t1, t2, p1, p2, dest) {\n const result = dest || math.vec3();\n const f = (t - t1) / (t2 - t1);\n result[0] = p1[0] + (f * (p2[0] - p1[0]));\n result[1] = p1[1] + (f * (p2[1] - p1[1]));\n result[2] = p1[2] + (f * (p2[2] - p1[2]));\n return result;\n },\n\n\n /**\n * Flattens a two-dimensional array into a one-dimensional array.\n *\n * @method flatten\n * @static\n * @param {Array of Arrays} a A 2D array\n * @returns Flattened 1D array\n */\n flatten(a) {\n\n const result = [];\n\n let i;\n let leni;\n let j;\n let lenj;\n let item;\n\n for (i = 0, leni = a.length; i < leni; i++) {\n item = a[i];\n for (j = 0, lenj = item.length; j < lenj; j++) {\n result.push(item[j]);\n }\n }\n\n return result;\n },\n\n\n identityQuaternion(dest = math.vec4()) {\n dest[0] = 0.0;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 1.0;\n return dest;\n },\n\n /**\n * Initializes a quaternion from Euler angles.\n *\n * @param {Number[]} euler The Euler angles.\n * @param {String} order Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination quaternion, created by default.\n * @returns {Number[]} The quaternion.\n */\n eulerToQuaternion(euler, order, dest = math.vec4()) {\n // http://www.mathworks.com/matlabcentral/fileexchange/\n // \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n //\tcontent/SpinCalc.m\n\n const a = (euler[0] * math.DEGTORAD) / 2;\n const b = (euler[1] * math.DEGTORAD) / 2;\n const c = (euler[2] * math.DEGTORAD) / 2;\n\n const c1 = Math.cos(a);\n const c2 = Math.cos(b);\n const c3 = Math.cos(c);\n const s1 = Math.sin(a);\n const s2 = Math.sin(b);\n const s3 = Math.sin(c);\n\n if (order === 'XYZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'YXZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'ZXY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'ZYX') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'YZX') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'XZY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n }\n\n return dest;\n },\n\n mat4ToQuaternion(m, dest = math.vec4()) {\n // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = m[0];\n const m12 = m[4];\n const m13 = m[8];\n const m21 = m[1];\n const m22 = m[5];\n const m23 = m[9];\n const m31 = m[2];\n const m32 = m[6];\n const m33 = m[10];\n let s;\n\n const trace = m11 + m22 + m33;\n\n if (trace > 0) {\n\n s = 0.5 / Math.sqrt(trace + 1.0);\n\n dest[3] = 0.25 / s;\n dest[0] = (m32 - m23) * s;\n dest[1] = (m13 - m31) * s;\n dest[2] = (m21 - m12) * s;\n\n } else if (m11 > m22 && m11 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n dest[3] = (m32 - m23) / s;\n dest[0] = 0.25 * s;\n dest[1] = (m12 + m21) / s;\n dest[2] = (m13 + m31) / s;\n\n } else if (m22 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n dest[3] = (m13 - m31) / s;\n dest[0] = (m12 + m21) / s;\n dest[1] = 0.25 * s;\n dest[2] = (m23 + m32) / s;\n\n } else {\n\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n dest[3] = (m21 - m12) / s;\n dest[0] = (m13 + m31) / s;\n dest[1] = (m23 + m32) / s;\n dest[2] = 0.25 * s;\n }\n\n return dest;\n },\n\n vec3PairToQuaternion(u, v, dest = math.vec4()) {\n const norm_u_norm_v = Math.sqrt(math.dotVec3(u, u) * math.dotVec3(v, v));\n let real_part = norm_u_norm_v + math.dotVec3(u, v);\n\n if (real_part < 0.00000001 * norm_u_norm_v) {\n\n // If u and v are exactly opposite, rotate 180 degrees\n // around an arbitrary orthogonal axis. Axis normalisation\n // can happen later, when we normalise the quaternion.\n\n real_part = 0.0;\n\n if (Math.abs(u[0]) > Math.abs(u[2])) {\n\n dest[0] = -u[1];\n dest[1] = u[0];\n dest[2] = 0;\n\n } else {\n dest[0] = 0;\n dest[1] = -u[2];\n dest[2] = u[1]\n }\n\n } else {\n\n // Otherwise, build quaternion the standard way.\n math.cross3Vec3(u, v, dest);\n }\n\n dest[3] = real_part;\n\n return math.normalizeQuaternion(dest);\n },\n\n angleAxisToQuaternion(angleAxis, dest = math.vec4()) {\n const halfAngle = angleAxis[3] / 2.0;\n const fsin = Math.sin(halfAngle);\n dest[0] = fsin * angleAxis[0];\n dest[1] = fsin * angleAxis[1];\n dest[2] = fsin * angleAxis[2];\n dest[3] = Math.cos(halfAngle);\n return dest;\n },\n\n quaternionToEuler: ((() => {\n const mat = new FloatArrayType(16);\n return (q, order, dest) => {\n dest = dest || math.vec3();\n math.quaternionToRotationMat4(q, mat);\n math.mat4ToEuler(mat, order, dest);\n return dest;\n };\n }))(),\n\n mulQuaternions(p, q, dest = math.vec4()) {\n const p0 = p[0];\n const p1 = p[1];\n const p2 = p[2];\n const p3 = p[3];\n const q0 = q[0];\n const q1 = q[1];\n const q2 = q[2];\n const q3 = q[3];\n dest[0] = p3 * q0 + p0 * q3 + p1 * q2 - p2 * q1;\n dest[1] = p3 * q1 + p1 * q3 + p2 * q0 - p0 * q2;\n dest[2] = p3 * q2 + p2 * q3 + p0 * q1 - p1 * q0;\n dest[3] = p3 * q3 - p0 * q0 - p1 * q1 - p2 * q2;\n return dest;\n },\n\n vec3ApplyQuaternion(q, vec, dest = math.vec3()) {\n const x = vec[0];\n const y = vec[1];\n const z = vec[2];\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n // calculate quat * vector\n\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n\n dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return dest;\n },\n\n quaternionToMat4(q, dest) {\n\n dest = math.identityMat4(dest);\n\n const q0 = q[0]; //x\n const q1 = q[1]; //y\n const q2 = q[2]; //z\n const q3 = q[3]; //w\n\n const tx = 2.0 * q0;\n const ty = 2.0 * q1;\n const tz = 2.0 * q2;\n\n const twx = tx * q3;\n const twy = ty * q3;\n const twz = tz * q3;\n\n const txx = tx * q0;\n const txy = ty * q0;\n const txz = tz * q0;\n\n const tyy = ty * q1;\n const tyz = tz * q1;\n const tzz = tz * q2;\n\n dest[0] = 1.0 - (tyy + tzz);\n dest[1] = txy + twz;\n dest[2] = txz - twy;\n\n dest[4] = txy - twz;\n dest[5] = 1.0 - (txx + tzz);\n dest[6] = tyz + twx;\n\n dest[8] = txz + twy;\n dest[9] = tyz - twx;\n\n dest[10] = 1.0 - (txx + tyy);\n\n return dest;\n },\n\n quaternionToRotationMat4(q, m) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n m[0] = 1 - (yy + zz);\n m[4] = xy - wz;\n m[8] = xz + wy;\n\n m[1] = xy + wz;\n m[5] = 1 - (xx + zz);\n m[9] = yz - wx;\n\n m[2] = xz - wy;\n m[6] = yz + wx;\n m[10] = 1 - (xx + yy);\n\n // last column\n m[3] = 0;\n m[7] = 0;\n m[11] = 0;\n\n // bottom row\n m[12] = 0;\n m[13] = 0;\n m[14] = 0;\n m[15] = 1;\n\n return m;\n },\n\n normalizeQuaternion(q, dest = q) {\n const len = math.lenVec4([q[0], q[1], q[2], q[3]]);\n dest[0] = q[0] / len;\n dest[1] = q[1] / len;\n dest[2] = q[2] / len;\n dest[3] = q[3] / len;\n return dest;\n },\n\n conjugateQuaternion(q, dest = q) {\n dest[0] = -q[0];\n dest[1] = -q[1];\n dest[2] = -q[2];\n dest[3] = q[3];\n return dest;\n },\n\n inverseQuaternion(q, dest) {\n return math.normalizeQuaternion(math.conjugateQuaternion(q, dest));\n },\n\n quaternionToAngleAxis(q, angleAxis = math.vec4()) {\n q = math.normalizeQuaternion(q, tempVec4);\n const q3 = q[3];\n const angle = 2 * Math.acos(q3);\n const s = Math.sqrt(1 - q3 * q3);\n if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt\n angleAxis[0] = q[0];\n angleAxis[1] = q[1];\n angleAxis[2] = q[2];\n } else {\n angleAxis[0] = q[0] / s;\n angleAxis[1] = q[1] / s;\n angleAxis[2] = q[2] / s;\n }\n angleAxis[3] = angle; // * 57.295779579;\n return angleAxis;\n },\n\n //------------------------------------------------------------------------------------------------------------------\n // Boundaries\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Returns a new, uninitialized 3D axis-aligned bounding box.\n *\n * @private\n */\n AABB3(values) {\n return new FloatArrayType(values || 6);\n },\n\n /**\n * Returns a new, uninitialized 2D axis-aligned bounding box.\n *\n * @private\n */\n AABB2(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3D oriented bounding box (OBB).\n *\n * @private\n */\n OBB3(values) {\n return new FloatArrayType(values || 32);\n },\n\n /**\n * Returns a new, uninitialized 2D oriented bounding box (OBB).\n *\n * @private\n */\n OBB2(values) {\n return new FloatArrayType(values || 16);\n },\n\n /** Returns a new 3D bounding sphere */\n Sphere3(x, y, z, r) {\n return new FloatArrayType([x, y, z, r]);\n },\n\n /**\n * Transforms an OBB3 by a 4x4 matrix.\n *\n * @private\n */\n transformOBB3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /** Returns true if the first AABB contains the second AABB.\n * @param aabb1\n * @param aabb2\n * @returns {boolean}\n */\n containsAABB3: function (aabb1, aabb2) {\n const result = (\n aabb1[0] <= aabb2[0] && aabb2[3] <= aabb1[3] &&\n aabb1[1] <= aabb2[1] && aabb2[4] <= aabb1[4] &&\n aabb1[2] <= aabb2[2] && aabb2[5] <= aabb1[5]);\n return result;\n },\n\n /**\n * Gets the diagonal size of an AABB3 given as minima and maxima.\n *\n * @private\n */\n getAABB3Diag: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return aabb => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n math.subVec3(max, min, tempVec3);\n\n return Math.abs(math.lenVec3(tempVec3));\n };\n }))(),\n\n /**\n * Get a diagonal boundary size that is symmetrical about the given point.\n *\n * @private\n */\n getAABB3DiagPoint: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (aabb, p) => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n const diagVec = math.subVec3(max, min, tempVec3);\n\n const xneg = p[0] - aabb[0];\n const xpos = aabb[3] - p[0];\n const yneg = p[1] - aabb[1];\n const ypos = aabb[4] - p[1];\n const zneg = p[2] - aabb[2];\n const zpos = aabb[5] - p[2];\n\n diagVec[0] += (xneg > xpos) ? xneg : xpos;\n diagVec[1] += (yneg > ypos) ? yneg : ypos;\n diagVec[2] += (zneg > zpos) ? zneg : zpos;\n\n return Math.abs(math.lenVec3(diagVec));\n };\n }))(),\n\n /**\n * Gets the center of an AABB.\n *\n * @private\n */\n getAABB3Center(aabb, dest) {\n const r = dest || math.vec3();\n\n r[0] = (aabb[0] + aabb[3]) / 2;\n r[1] = (aabb[1] + aabb[4]) / 2;\n r[2] = (aabb[2] + aabb[5]) / 2;\n\n return r;\n },\n\n /**\n * Gets the center of a 2D AABB.\n *\n * @private\n */\n getAABB2Center(aabb, dest) {\n const r = dest || math.vec2();\n\n r[0] = (aabb[2] + aabb[0]) / 2;\n r[1] = (aabb[3] + aabb[1]) / 2;\n\n return r;\n },\n\n /**\n * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points.\n * Creates new AABB if none supplied.\n *\n * @private\n */\n collapseAABB3(aabb = math.AABB3()) {\n aabb[0] = math.MAX_DOUBLE;\n aabb[1] = math.MAX_DOUBLE;\n aabb[2] = math.MAX_DOUBLE;\n aabb[3] = -math.MAX_DOUBLE;\n aabb[4] = -math.MAX_DOUBLE;\n aabb[5] = -math.MAX_DOUBLE;\n\n return aabb;\n },\n\n /**\n * Converts an axis-aligned 3D boundary into an oriented boundary consisting of\n * an array of eight 3D positions, one for each corner of the boundary.\n *\n * @private\n */\n AABB3ToOBB3(aabb, obb = math.OBB3()) {\n obb[0] = aabb[0];\n obb[1] = aabb[1];\n obb[2] = aabb[2];\n obb[3] = 1;\n\n obb[4] = aabb[3];\n obb[5] = aabb[1];\n obb[6] = aabb[2];\n obb[7] = 1;\n\n obb[8] = aabb[3];\n obb[9] = aabb[4];\n obb[10] = aabb[2];\n obb[11] = 1;\n\n obb[12] = aabb[0];\n obb[13] = aabb[4];\n obb[14] = aabb[2];\n obb[15] = 1;\n\n obb[16] = aabb[0];\n obb[17] = aabb[1];\n obb[18] = aabb[5];\n obb[19] = 1;\n\n obb[20] = aabb[3];\n obb[21] = aabb[1];\n obb[22] = aabb[5];\n obb[23] = 1;\n\n obb[24] = aabb[3];\n obb[25] = aabb[4];\n obb[26] = aabb[5];\n obb[27] = 1;\n\n obb[28] = aabb[0];\n obb[29] = aabb[4];\n obb[30] = aabb[5];\n obb[31] = 1;\n\n return obb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n positions3ToAABB3: ((() => {\n\n const p = new FloatArrayType(3);\n\n return (positions, aabb, positionsDecodeMatrix) => {\n aabb = aabb || math.AABB3();\n\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n if (positionsDecodeMatrix) {\n\n p[0] = positions[i + 0];\n p[1] = positions[i + 1];\n p[2] = positions[i + 2];\n\n math.decompressPosition(p, positionsDecodeMatrix, p);\n\n x = p[0];\n y = p[1];\n z = p[2];\n\n } else {\n x = positions[i + 0];\n y = positions[i + 1];\n z = positions[i + 2];\n }\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n };\n }))(),\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n OBB3ToAABB3(obb, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = obb.length; i < len; i += 4) {\n\n x = obb[i + 0];\n y = obb[i + 1];\n z = obb[i + 2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the given 3D points.\n *\n * @private\n */\n points3ToAABB3(points, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = points.length; i < len; i++) {\n\n x = points[i][0];\n y = points[i][1];\n z = points[i][2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n points3ToSphere3: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const numPoints = points.length;\n\n for (i = 0; i < numPoints; i++) {\n x += points[i][0];\n y += points[i][1];\n z += points[i][2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < numPoints; i++) {\n\n dist = Math.abs(math.lenVec3(math.subVec3(points[i], sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D positions.\n *\n * @private\n */\n positions3ToSphere3: ((() => {\n\n const tempVec3a = new FloatArrayType(3);\n const tempVec3b = new FloatArrayType(3);\n\n return (positions, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPositions = positions.length;\n let radius = 0;\n\n for (i = 0; i < lenPositions; i += 3) {\n x += positions[i];\n y += positions[i + 1];\n z += positions[i + 2];\n }\n\n const numPositions = lenPositions / 3;\n\n sphere[0] = x / numPositions;\n sphere[1] = y / numPositions;\n sphere[2] = z / numPositions;\n\n let dist;\n\n for (i = 0; i < lenPositions; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(tempVec3a, sphere, tempVec3b)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n OBB3ToSphere3: ((() => {\n\n const point = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPoints = points.length;\n const numPoints = lenPoints / 4;\n\n for (i = 0; i < lenPoints; i += 4) {\n x += points[i + 0];\n y += points[i + 1];\n z += points[i + 2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < lenPoints; i += 4) {\n\n point[0] = points[i + 0];\n point[1] = points[i + 1];\n point[2] = points[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(point, sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Gets the center of a bounding sphere.\n *\n * @private\n */\n getSphere3Center(sphere, dest = math.vec3()) {\n dest[0] = sphere[0];\n dest[1] = sphere[1];\n dest[2] = sphere[2];\n\n return dest;\n },\n\n /**\n * Expands the first axis-aligned 3D boundary to enclose the second, if required.\n *\n * @private\n */\n expandAABB3(aabb1, aabb2) {\n\n if (aabb1[0] > aabb2[0]) {\n aabb1[0] = aabb2[0];\n }\n\n if (aabb1[1] > aabb2[1]) {\n aabb1[1] = aabb2[1];\n }\n\n if (aabb1[2] > aabb2[2]) {\n aabb1[2] = aabb2[2];\n }\n\n if (aabb1[3] < aabb2[3]) {\n aabb1[3] = aabb2[3];\n }\n\n if (aabb1[4] < aabb2[4]) {\n aabb1[4] = aabb2[4];\n }\n\n if (aabb1[5] < aabb2[5]) {\n aabb1[5] = aabb2[5];\n }\n\n return aabb1;\n },\n\n /**\n * Expands an axis-aligned 3D boundary to enclose the given point, if needed.\n *\n * @private\n */\n expandAABB3Point3(aabb, p) {\n\n if (aabb[0] > p[0]) {\n aabb[0] = p[0];\n }\n\n if (aabb[1] > p[1]) {\n aabb[1] = p[1];\n }\n\n if (aabb[2] > p[2]) {\n aabb[2] = p[2];\n }\n\n if (aabb[3] < p[0]) {\n aabb[3] = p[0];\n }\n\n if (aabb[4] < p[1]) {\n aabb[4] = p[1];\n }\n\n if (aabb[5] < p[2]) {\n aabb[5] = p[2];\n }\n\n return aabb;\n },\n\n /**\n * Calculates the normal vector of a triangle.\n *\n * @private\n */\n triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n }\n};\n\nexport {math};","import {math} from \"../../lib/math.js\";\n\nfunction quantizePositions (positions, lenPositions, aabb, quantizedPositions) {\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n const xMultiplier = maxInt / xwid;\n const yMultiplier = maxInt / ywid;\n const zMultiplier = maxInt / zwid;\n const verify = (num) => num >= 0 ? num : 0;\n for (let i = 0; i < lenPositions; i += 3) {\n quantizedPositions[i + 0] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 0] - xmin) * xMultiplier)));\n quantizedPositions[i + 1] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 1] - ymin) * yMultiplier)));\n quantizedPositions[i + 2] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 2] - zmin) * zMultiplier)));\n }\n}\n\nfunction compressPosition(p, aabb, q) {\n const multiplier = new Float32Array([\n aabb[3] !== aabb[0] ? 65535 / (aabb[3] - aabb[0]) : 0,\n aabb[4] !== aabb[1] ? 65535 / (aabb[4] - aabb[1]) : 0,\n aabb[5] !== aabb[2] ? 65535 / (aabb[5] - aabb[2]) : 0\n ]);\n q[0] = Math.max(0, Math.min(65535, Math.floor((p[0] - aabb[0]) * multiplier[0])));\n q[1] = Math.max(0, Math.min(65535, Math.floor((p[1] - aabb[1]) * multiplier[1])));\n q[2] = Math.max(0, Math.min(65535, Math.floor((p[2] - aabb[2]) * multiplier[2])));\n}\n\nvar createPositionsDecodeMatrix = (function () {\n const translate = math.mat4();\n const scale = math.mat4();\n return function (aabb, positionsDecodeMatrix) {\n positionsDecodeMatrix = positionsDecodeMatrix || math.mat4();\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n math.identityMat4(translate);\n math.translationMat4v(aabb, translate);\n math.identityMat4(scale);\n math.scalingMat4v([xwid / maxInt, ywid / maxInt, zwid / maxInt], scale);\n math.mulMat4(translate, scale, positionsDecodeMatrix);\n return positionsDecodeMatrix;\n };\n})();\n\nfunction transformAndOctEncodeNormals(modelNormalMatrix, normals, lenNormals, compressedNormals, lenCompressedNormals) {\n // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n let i, ei;\n let localNormal = math.vec3();\n let worldNormal = math.vec3();\n for (i = 0; i < lenNormals; i += 3) {\n localNormal[0] = normals[i];\n localNormal[1] = normals[i + 1];\n localNormal[2] = normals[i + 2];\n\n math.transformVec3(modelNormalMatrix, localNormal, worldNormal);\n math.normalizeVec3(worldNormal, worldNormal);\n\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(worldNormal, 0, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(worldNormal, 0, dec);\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\nfunction octEncodeNormals(normals, lenNormals, compressedNormals, lenCompressedNormals) { // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n for (let i = 0; i < lenNormals; i += 3) {\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(normals, i, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(normals, i, dec);\n oct = octEncodeVec3(normals, i, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\n/**\n * @private\n */\nfunction octEncodeVec3(array, i, xfunc, yfunc) { // Oct-encode single normal vector in 2 bytes\n let x = array[i] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n let y = array[i + 1] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n if (array[i + 2] < 0) {\n let tempx = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n let tempy = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n x = tempx;\n y = tempy;\n }\n return new Int8Array([\n Math[xfunc](x * 127.5 + (x < 0 ? -1 : 0)),\n Math[yfunc](y * 127.5 + (y < 0 ? -1 : 0))\n ]);\n}\n\n/**\n * Decode an oct-encoded normal\n */\nfunction octDecodeVec2(oct) {\n let x = oct[0];\n let y = oct[1];\n x /= x < 0 ? 127 : 128;\n y /= y < 0 ? 127 : 128;\n const z = 1 - Math.abs(x) - Math.abs(y);\n if (z < 0) {\n x = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n y = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n }\n const length = Math.sqrt(x * x + y * y + z * z);\n return [\n x / length,\n y / length,\n z / length\n ];\n}\n\n/**\n * Dot product of a normal in an array against a candidate decoding\n * @private\n */\nfunction dot(array, i, vec3) {\n return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2];\n}\n\n/**\n * @private\n */\nconst geometryCompression = {\n quantizePositions,\n compressPosition,\n createPositionsDecodeMatrix,\n transformAndOctEncodeNormals,\n octEncodeNormals,\n};\n\nexport {geometryCompression}","/*----------------------------------------------------------------------------------------------------------------------\n * NOTE: The values of these constants must match those within xeokit-sdk\n *--------------------------------------------------------------------------------------------------------------------*/\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity.\n */\nexport const RepeatWrapping = 1000;\n\n/**\n * Texture wrapping mode in which the last pixel of the texture stretches to the edge of the mesh.\n */\nexport const ClampToEdgeWrapping = 1001;\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity, mirroring on each repeat.\n */\nexport const MirroredRepeatWrapping = 1002;\n\n/**\n * Texture magnification and minification filter that returns the nearest texel to the given sample coordinates.\n */\nexport const NearestFilter = 1003;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipMapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured\n * and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipmapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipmapLinearFilter = 1005;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipMapLinearFilter = 1005;\n\n/**\n * Texture magnification and minification filter that returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearFilter = 1006;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipmapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipMapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipmapLinearFilter = 1008;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipMapLinearFilter = 1008;\n\n/**\n * Media type for GIF images.\n */\nexport const GIFMediaType = 10000;\n\n/**\n * Media type for JPEG images.\n */\nexport const JPEGMediaType = 10001;\n\n/**\n * Media type for PNG images.\n */\nexport const PNGMediaType = 10002;","import {math} from \"../../lib/math.js\";\n\n/**\n * @private\n */\nconst buildEdgeIndices = (function () {\n\n const uniquePositions = [];\n const indicesLookup = [];\n const indicesReverseLookup = [];\n const weldedIndices = [];\n\n// TODO: Optimize with caching, but need to cater to both compressed and uncompressed positions\n\n const faces = [];\n let numFaces = 0;\n const compa = new Uint16Array(3);\n const compb = new Uint16Array(3);\n const compc = new Uint16Array(3);\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n const cb = math.vec3();\n const ab = math.vec3();\n const cross = math.vec3();\n const normal = math.vec3();\n const inverseNormal = math.vec3();\n\n function weldVertices(positions, indices) {\n const positionsMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique)\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = Math.pow(10, precisionPoints);\n let i;\n let len;\n let lenUniquePositions = 0;\n for (i = 0, len = positions.length; i < len; i += 3) {\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n key = Math.round(vx * precision) + '_' + Math.round(vy * precision) + '_' + Math.round(vz * precision);\n if (positionsMap[key] === undefined) {\n positionsMap[key] = lenUniquePositions / 3;\n uniquePositions[lenUniquePositions++] = vx;\n uniquePositions[lenUniquePositions++] = vy;\n uniquePositions[lenUniquePositions++] = vz;\n }\n indicesLookup[i / 3] = positionsMap[key];\n }\n for (i = 0, len = indices.length; i < len; i++) {\n weldedIndices[i] = indicesLookup[indices[i]];\n indicesReverseLookup[weldedIndices[i]] = indices[i];\n }\n }\n\n function buildFaces(numIndices, positionsDecodeMatrix) {\n numFaces = 0;\n for (let i = 0, len = numIndices; i < len; i += 3) {\n const ia = ((weldedIndices[i]) * 3);\n const ib = ((weldedIndices[i + 1]) * 3);\n const ic = ((weldedIndices[i + 2]) * 3);\n if (positionsDecodeMatrix) {\n compa[0] = uniquePositions[ia];\n compa[1] = uniquePositions[ia + 1];\n compa[2] = uniquePositions[ia + 2];\n compb[0] = uniquePositions[ib];\n compb[1] = uniquePositions[ib + 1];\n compb[2] = uniquePositions[ib + 2];\n compc[0] = uniquePositions[ic];\n compc[1] = uniquePositions[ic + 1];\n compc[2] = uniquePositions[ic + 2];\n // Decode\n math.decompressPosition(compa, positionsDecodeMatrix, a);\n math.decompressPosition(compb, positionsDecodeMatrix, b);\n math.decompressPosition(compc, positionsDecodeMatrix, c);\n } else {\n a[0] = uniquePositions[ia];\n a[1] = uniquePositions[ia + 1];\n a[2] = uniquePositions[ia + 2];\n b[0] = uniquePositions[ib];\n b[1] = uniquePositions[ib + 1];\n b[2] = uniquePositions[ib + 2];\n c[0] = uniquePositions[ic];\n c[1] = uniquePositions[ic + 1];\n c[2] = uniquePositions[ic + 2];\n }\n math.subVec3(c, b, cb);\n math.subVec3(a, b, ab);\n math.cross3Vec3(cb, ab, cross);\n math.normalizeVec3(cross, normal);\n const face = faces[numFaces] || (faces[numFaces] = {normal: math.vec3()});\n face.normal[0] = normal[0];\n face.normal[1] = normal[1];\n face.normal[2] = normal[2];\n numFaces++;\n }\n }\n\n return function (positions, indices, positionsDecodeMatrix, edgeThreshold) {\n weldVertices(positions, indices);\n buildFaces(indices.length, positionsDecodeMatrix);\n const edgeIndices = [];\n const thresholdDot = Math.cos(math.DEGTORAD * edgeThreshold);\n const edges = {};\n let edge1;\n let edge2;\n let index1;\n let index2;\n let key;\n let largeIndex = false;\n let edge;\n let normal1;\n let normal2;\n let dot;\n let ia;\n let ib;\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const faceIndex = i / 3;\n for (let j = 0; j < 3; j++) {\n edge1 = weldedIndices[i + j];\n edge2 = weldedIndices[i + ((j + 1) % 3)];\n index1 = Math.min(edge1, edge2);\n index2 = Math.max(edge1, edge2);\n key = index1 + ',' + index2;\n if (edges[key] === undefined) {\n edges[key] = {\n index1: index1,\n index2: index2,\n face1: faceIndex,\n face2: undefined,\n };\n } else {\n edges[key].face2 = faceIndex;\n }\n }\n }\n for (key in edges) {\n edge = edges[key];\n // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.\n if (edge.face2 !== undefined) {\n normal1 = faces[edge.face1].normal;\n normal2 = faces[edge.face2].normal;\n inverseNormal[0] = -normal2[0];\n inverseNormal[1] = -normal2[1];\n inverseNormal[2] = -normal2[2];\n dot = Math.abs(math.dotVec3(normal1, normal2));\n const dot2 = Math.abs(math.dotVec3(normal1, inverseNormal));\n if (dot > thresholdDot && dot2 > thresholdDot) {\n continue;\n }\n }\n ia = indicesReverseLookup[edge.index1];\n ib = indicesReverseLookup[edge.index2];\n if (!largeIndex && ia > 65535 || ib > 65535) {\n largeIndex = true;\n }\n edgeIndices.push(ia);\n edgeIndices.push(ib);\n }\n return (largeIndex) ? new Uint32Array(edgeIndices) : new Uint16Array(edgeIndices);\n };\n})();\n\n\nexport {buildEdgeIndices};","/**\n * Uses edge adjacency counts to identify if the given triangle mesh can be rendered with backface culling enabled.\n *\n * If all edges are connected to exactly two triangles, then the mesh will likely be a closed solid, and we can safely\n * render it with backface culling enabled.\n *\n * Otherwise, the mesh is a surface, and we must render it with backface culling disabled.\n *\n * @private\n */\nconst isTriangleMeshSolid = (indices, positions, vertexIndexMapping, edges) => {\n\n function compareIndexPositions(a, b)\n {\n let posA, posB;\n\n for (let i = 0; i < 3; i++) {\n posA = positions [a*3+i];\n posB = positions [b*3+i];\n\n if (posA !== posB) {\n return posB - posA;\n }\n }\n\n return 0;\n };\n\n // Group together indices corresponding to same position coordinates\n let newIndices = indices.slice ().sort (compareIndexPositions);\n\n // Calculate the mapping:\n // - from original index in indices array\n // - to indices-for-unique-positions\n let uniqueVertexIndex = null;\n\n for (let i = 0, len = newIndices.length; i < len; i++) {\n if (i == 0 || 0 != compareIndexPositions (\n newIndices[i],\n newIndices[i-1],\n )) {\n // different position\n uniqueVertexIndex = newIndices [i];\n }\n\n vertexIndexMapping [\n newIndices[i]\n ] = uniqueVertexIndex;\n }\n\n // Generate the list of edges\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const a = vertexIndexMapping[indices[i]];\n const b = vertexIndexMapping[indices[i+1]];\n const c = vertexIndexMapping[indices[i+2]];\n\n let a2 = a;\n let b2 = b;\n let c2 = c;\n\n if (a > b && a > c) {\n if (b > c) {\n a2 = a;\n b2 = b;\n c2 = c;\n } else {\n a2 = a;\n b2 = c;\n c2 = b;\n }\n } else if (b > a && b > c) {\n if (a > c) {\n a2 = b;\n b2 = a;\n c2 = c;\n } else {\n a2 = b;\n b2 = c;\n c2 = a;\n }\n } else if (c > a && c > b) {\n if (a > b) {\n a2 = c;\n b2 = a;\n c2 = b;\n } else {\n a2 = c;\n b2 = b;\n c2 = a;\n }\n }\n\n edges[i+0] = [\n a2, b2\n ];\n edges[i+1] = [\n b2, c2\n ];\n\n if (a2 > c2) {\n const temp = c2;\n c2 = a2;\n a2 = temp;\n }\n\n edges[i+2] = [\n c2, a2\n ];\n }\n\n // Group semantically equivalent edgdes together\n function compareEdges (e1, e2) {\n let a, b;\n\n for (let i = 0; i < 2; i++) {\n a = e1[i];\n b = e2[i];\n\n if (b !== a) {\n return b - a;\n }\n }\n\n return 0;\n }\n\n edges = edges.slice(0, indices.length);\n\n edges.sort (compareEdges);\n\n // Make sure each edge is used exactly twice\n let sameEdgeCount = 0;\n\n for (let i = 0; i < edges.length; i++)\n {\n if (i === 0 || 0 !== compareEdges (\n edges[i], edges[i-1]\n )) {\n // different edge\n if (0 !== i && sameEdgeCount !== 2)\n {\n return false;\n }\n\n sameEdgeCount = 1;\n }\n else\n {\n // same edge\n sameEdgeCount++;\n }\n }\n\n if (edges.length > 0 && sameEdgeCount !== 2)\n {\n return false;\n }\n\n // Each edge is used exactly twice, this is a\n // watertight surface and hence a solid geometry.\n return true;\n};\n\nexport {isTriangleMeshSolid};","/**\n * Represents the usage of a {@link XKTGeometry} by an {@link XKTEntity}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTEntity#meshes} and {@link XKTModel#meshesList}\n * * Has an {@link XKTGeometry}, and an optional {@link XKTTextureSet}, both of which it can share with other {@link XKTMesh}es\n * * Has {@link XKTMesh#color}, {@link XKTMesh#opacity}, {@link XKTMesh#metallic} and {@link XKTMesh#roughness} PBR attributes\n * @class XKTMesh\n */\nclass XKTMesh {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTMesh in {@link XKTModel#meshes}.\n *\n * @type {Number}\n */\n this.meshId = cfg.meshId;\n\n /**\n * Index of this XKTMesh in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.meshIndex = cfg.meshIndex;\n\n /**\n * The 4x4 modeling transform matrix.\n *\n * Transform is relative to the center of the {@link XKTTile} that contains this XKTMesh's {@link XKTEntity},\n * which is given in {@link XKTMesh#entity}.\n *\n * When the ````XKTEntity```` shares its {@link XKTGeometry}s with other ````XKTEntity````s, this matrix is used\n * to transform this XKTMesh's XKTGeometry into World-space. When this XKTMesh does not share its ````XKTGeometry````,\n * then this matrix is ignored.\n *\n * @type {Number[]}\n */\n this.matrix = cfg.matrix;\n\n /**\n * The instanced {@link XKTGeometry}.\n *\n * @type {XKTGeometry}\n */\n this.geometry = cfg.geometry;\n\n /**\n * RGB color of this XKTMesh.\n *\n * @type {Float32Array}\n */\n this.color = cfg.color || new Float32Array([1, 1, 1]);\n\n /**\n * PBR metallness of this XKTMesh.\n *\n * @type {Number}\n */\n this.metallic = (cfg.metallic !== null && cfg.metallic !== undefined) ? cfg.metallic : 0;\n\n /**\n * PBR roughness of this XKTMesh.\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {Number}\n * @type {XKTTextureSet}\n */\n this.roughness = (cfg.roughness !== null && cfg.roughness !== undefined) ? cfg.roughness : 1;\n\n /**\n * Opacity of this XKTMesh.\n *\n * @type {Number}\n */\n this.opacity = (cfg.opacity !== undefined && cfg.opacity !== null) ? cfg.opacity : 1.0;\n\n /**\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {XKTTextureSet}\n */\n this.textureSet = cfg.textureSet;\n\n /**\n * The owner {@link XKTEntity}.\n *\n * Set by {@link XKTModel#createEntity}.\n *\n * @type {XKTEntity}\n */\n this.entity = null; // Set after instantiation, when the Entity is known\n }\n}\n\nexport {XKTMesh};","/**\n * An element of reusable geometry within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createGeometry}\n * * Stored in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}\n * * Referenced by {@link XKTMesh}s, which belong to {@link XKTEntity}s\n *\n * @class XKTGeometry\n */\nclass XKTGeometry {\n\n /**\n * @private\n * @param {*} cfg Configuration for the XKTGeometry.\n * @param {Number} cfg.geometryId Unique ID of the geometry in {@link XKTModel#geometries}.\n * @param {String} cfg.primitiveType Type of this geometry - \"triangles\", \"points\" or \"lines\" so far.\n * @param {Number} cfg.geometryIndex Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n * @param {Float64Array} cfg.positions Non-quantized 3D vertex positions.\n * @param {Float32Array} cfg.normals Non-compressed vertex normals.\n * @param {Uint8Array} cfg.colorsCompressed Unsigned 8-bit integer RGBA vertex colors.\n * @param {Float32Array} cfg.uvs Non-compressed vertex UV coordinates.\n * @param {Uint32Array} cfg.indices Indices to organize the vertex positions and normals into triangles.\n * @param {Uint32Array} cfg.edgeIndices Indices to organize the vertex positions into edges.\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTGeometry in {@link XKTModel#geometries}.\n *\n * @type {Number}\n */\n this.geometryId = cfg.geometryId;\n\n /**\n * The type of primitive - \"triangles\" | \"points\" | \"lines\".\n *\n * @type {String}\n */\n this.primitiveType = cfg.primitiveType;\n\n /**\n * Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n *\n * @type {Number}\n */\n this.geometryIndex = cfg.geometryIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTGeometry.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * Non-quantized 3D vertex positions.\n *\n * Defined for all primitive types.\n *\n * @type {Float64Array}\n */\n this.positions = cfg.positions;\n\n /**\n * Quantized vertex positions.\n *\n * Defined for all primitive types.\n *\n * This array is later created from {@link XKTGeometry#positions} by {@link XKTModel#finalize}.\n *\n * @type {Uint16Array}\n */\n this.positionsQuantized = new Uint16Array(cfg.positions.length);\n\n /**\n * Non-compressed 3D vertex normals.\n *\n * Defined only for triangle primitives. Can be null if we want xeokit to auto-generate them. Ignored for points and lines.\n *\n * @type {Float32Array}\n */\n this.normals = cfg.normals;\n\n /**\n * Compressed vertex normals.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * This array is later created from {@link XKTGeometry#normals} by {@link XKTModel#finalize}.\n *\n * Will be null if {@link XKTGeometry#normals} is also null.\n *\n * @type {Int8Array}\n */\n this.normalsOctEncoded = null;\n\n /**\n * Compressed RGBA vertex colors.\n *\n * Defined only for point primitives. Ignored for triangles and lines.\n *\n * @type {Uint8Array}\n */\n this.colorsCompressed = cfg.colorsCompressed;\n\n /**\n * Non-compressed vertex UVs.\n *\n * @type {Float32Array}\n */\n this.uvs = cfg.uvs;\n\n /**\n * Compressed vertex UVs.\n *\n * @type {Uint16Array}\n */\n this.uvsCompressed = cfg.uvsCompressed;\n\n /**\n * Indices that organize the vertex positions and normals as triangles.\n *\n * Defined only for triangle and lines primitives. Ignored for points.\n *\n * @type {Uint32Array}\n */\n this.indices = cfg.indices;\n\n /**\n * Indices that organize the vertex positions as edges.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * @type {Uint32Array}\n */\n this.edgeIndices = cfg.edgeIndices;\n\n /**\n * When {@link XKTGeometry#primitiveType} is \"triangles\", this is ````true```` when this geometry is a watertight mesh.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.solid = false;\n }\n\n /**\n * Convenience property that is ````true```` when {@link XKTGeometry#numInstances} is greater that one.\n * @returns {boolean}\n */\n get reused() {\n return (this.numInstances > 1);\n }\n}\n\nexport {XKTGeometry};","import {math} from \"../lib/math.js\";\n\n/**\n * An object within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTModel#entities} and {@link XKTModel#entitiesList}\n * * Has one or more {@link XKTMesh}s, each having an {@link XKTGeometry}\n *\n * @class XKTEntity\n */\nclass XKTEntity {\n\n /**\n * @private\n * @param entityId\n * @param meshes\n */\n constructor(entityId, meshes) {\n\n /**\n * Unique ID of this ````XKTEntity```` in {@link XKTModel#entities}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * We can also use {@link XKTModel#createMetaObject} to create an {@link XKTMetaObject} to specify metadata for\n * this ````XKTEntity````. To associate the {@link XKTMetaObject} with our {@link XKTEntity}, we give\n * {@link XKTMetaObject#metaObjectId} the same value as {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.entityId = entityId;\n\n /**\n * Index of this ````XKTEntity```` in {@link XKTModel#entitiesList}.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Number}\n */\n this.entityIndex = null;\n\n /**\n * A list of {@link XKTMesh}s that indicate which {@link XKTGeometry}s are used by this Entity.\n *\n * @type {XKTMesh[]}\n */\n this.meshes = meshes;\n\n /**\n * World-space axis-aligned bounding box (AABB) that encloses the {@link XKTGeometry#positions} of\n * the {@link XKTGeometry}s that are used by this ````XKTEntity````.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Float32Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this ````XKTEntity```` shares {@link XKTGeometry}s with other {@link XKTEntity}'s.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * Note that when an ````XKTEntity```` shares ````XKTGeometrys````, it shares **all** of its ````XKTGeometrys````. An ````XKTEntity````\n * never shares only some of its ````XKTGeometrys```` - it always shares either the whole set or none at all.\n *\n * @type {Boolean}\n */\n this.hasReusedGeometries = false;\n }\n}\n\nexport {XKTEntity};","/**\n * @desc A box-shaped 3D region within an {@link XKTModel} that contains {@link XKTEntity}s.\n *\n * * Created by {@link XKTModel#finalize}\n * * Stored in {@link XKTModel#tilesList}\n *\n * @class XKTTile\n */\nclass XKTTile {\n\n /**\n * Creates a new XKTTile.\n *\n * @private\n * @param aabb\n * @param entities\n */\n constructor(aabb, entities) {\n\n /**\n * Axis-aligned World-space bounding box that encloses the {@link XKTEntity}'s within this Tile.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}'s within this XKTTile.\n *\n * @type {XKTEntity[]}\n */\n this.entities = entities;\n }\n}\n\nexport {XKTTile};","/**\n * A kd-Tree node, used internally by {@link XKTModel}.\n *\n * @private\n */\nclass KDNode {\n\n /**\n * Create a KDNode with an axis-aligned 3D World-space boundary.\n */\n constructor(aabb) {\n\n /**\n * The axis-aligned 3D World-space boundary of this KDNode.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}s within this KDNode.\n */\n this.entities = null;\n\n /**\n * The left child KDNode.\n */\n this.left = null;\n\n /**\n * The right child KDNode.\n */\n this.right = null;\n }\n}\n\nexport {KDNode};","/**\n * A meta object within an {@link XKTModel}.\n *\n * These are plugged together into a parent-child hierarchy to represent structural\n * metadata for the {@link XKTModel}.\n *\n * The leaf XKTMetaObjects are usually associated with\n * an {@link XKTEntity}, which they do so by sharing the same ID,\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * * Created by {@link XKTModel#createMetaObject}\n * * Stored in {@link XKTModel#metaObjects} and {@link XKTModel#metaObjectsList}\n * * Has an ID, a type, and a human-readable name\n * * May have a parent {@link XKTMetaObject}\n * * When no children, is usually associated with an {@link XKTEntity}\n *\n * @class XKTMetaObject\n */\nclass XKTMetaObject {\n\n /**\n * @private\n * @param metaObjectId\n * @param propertySetIds\n * @param metaObjectType\n * @param metaObjectName\n * @param parentMetaObjectId\n */\n constructor(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId) {\n\n /**\n * Unique ID of this ````XKTMetaObject```` in {@link XKTModel#metaObjects}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * If this is a leaf XKTMetaObject, where it is not a parent to any other XKTMetaObject,\n * then this will be equal to the ID of an {@link XKTEntity} in {@link XKTModel#entities},\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.metaObjectId = metaObjectId;\n\n /**\n * Unique ID of one or more property sets that contains additional metadata about this\n * {@link XKTMetaObject}. The property sets can be stored in an external system, or\n * within the {@link XKTModel}, as {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n *\n * @type {String[]}\n */\n this.propertySetIds = propertySetIds;\n\n /**\n * Indicates the XKTMetaObject meta object type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.metaObjectType = metaObjectType;\n\n /**\n * Indicates the XKTMetaObject meta object name.\n *\n * This defaults to {@link XKTMetaObject#metaObjectId}.\n *\n * @type {string}\n */\n this.metaObjectName = metaObjectName;\n\n /**\n * The parent XKTMetaObject, if any.\n *\n * Will be null if there is no parent.\n *\n * @type {String}\n */\n this.parentMetaObjectId = parentMetaObjectId;\n }\n}\n\nexport {XKTMetaObject};","/**\n * A property set within an {@link XKTModel}.\n *\n * These are shared among {@link XKTMetaObject}s.\n *\n * * Created by {@link XKTModel#createPropertySet}\n * * Stored in {@link XKTModel#propertySets} and {@link XKTModel#propertySetsList}\n * * Has an ID, a type, and a human-readable name\n *\n * @class XKTPropertySet\n */\nclass XKTPropertySet {\n\n /**\n * @private\n */\n constructor(propertySetId, propertySetType, propertySetName, properties) {\n\n /**\n * Unique ID of this ````XKTPropertySet```` in {@link XKTModel#propertySets}.\n *\n * @type {String}\n */\n this.propertySetId = propertySetId;\n\n /**\n * Indicates the ````XKTPropertySet````'s type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.propertySetType = propertySetType;\n\n /**\n * Indicates the XKTPropertySet meta object name.\n *\n * This defaults to {@link XKTPropertySet#propertySetId}.\n *\n * @type {string}\n */\n this.propertySetName = propertySetName;\n\n /**\n * The properties within this ````XKTPropertySet````.\n *\n * @type {*[]}\n */\n this.properties = properties;\n }\n}\n\nexport {XKTPropertySet};","/**\n * A texture shared by {@link XKTTextureSet}s.\n *\n * * Created by {@link XKTModel#createTexture}\n * * Stored in {@link XKTTextureSet#textures}, {@link XKTModel#textures} and {@link XKTModel#texturesList}\n *\n * @class XKTTexture\n */\nimport {RepeatWrapping, LinearMipMapNearestFilter} from \"../constants\";\n\nclass XKTTexture {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTexture in {@link XKTModel#textures}.\n *\n * @type {Number}\n */\n this.textureId = cfg.textureId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureIndex = cfg.textureIndex;\n\n /**\n * Texture image data.\n *\n * @type {Buffer}\n */\n this.imageData = cfg.imageData;\n\n /**\n * Which material channel this texture is applied to, as determined by its {@link XKTTextureSet}s.\n *\n * @type {Number}\n */\n this.channel = null;\n\n /**\n * Width of this XKTTexture.\n *\n * @type {Number}\n */\n this.width = cfg.width;\n\n /**\n * Height of this XKTTexture.\n *\n * @type {Number}\n */\n this.height = cfg.height;\n\n /**\n * Texture file source.\n *\n * @type {String}\n */\n this.src = cfg.src;\n\n /**\n * Whether this XKTTexture is to be compressed.\n *\n * @type {Boolean}\n */\n this.compressed = (!!cfg.compressed);\n\n /**\n * Media type of this XKTTexture.\n *\n * Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.mediaType = cfg.mediaType;\n\n /**\n * How the texture is sampled when a texel covers less than one pixel. Supported values\n * are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter},\n * {@link NearestMipMapNearestFilter}, {@link NearestMipMapLinearFilter}\n * and {@link LinearMipMapLinearFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.minFilter = cfg.minFilter || LinearMipMapNearestFilter;\n\n /**\n * How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.magFilter = cfg.magFilter || LinearMipMapNearestFilter;\n\n /**\n * S wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapS = cfg.wrapS || RepeatWrapping;\n\n /**\n * T wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapT = cfg.wrapT || RepeatWrapping;\n\n /**\n * R wrapping mode.\n *\n * Ignored for compressed textures.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * @type {*|number}\n */\n this.wrapR = cfg.wrapR || RepeatWrapping\n }\n}\n\nexport {XKTTexture};","/**\n * A set of textures shared by {@link XKTMesh}es.\n *\n * * Created by {@link XKTModel#createTextureSet}\n * * Registered in {@link XKTMesh#material}, {@link XKTModel#materials} and {@link XKTModel#.textureSetsList}\n *\n * @class XKTMetalRoughMaterial\n */\nclass XKTTextureSet {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTextureSet in {@link XKTModel#materials}.\n *\n * @type {Number}\n */\n this.textureSetId = cfg.textureSetId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureSetIndex = cfg.textureSetIndex;\n\n /**\n * Identifies the material type.\n *\n * @type {Number}\n */\n this.materialType = cfg.materialType;\n\n /**\n * Index of this XKTTextureSet in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.materialIndex = cfg.materialIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTTextureSet.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * RGBA {@link XKTTexture} containing base color in RGB and opacity in A.\n *\n * @type {XKTTexture}\n */\n this.colorTexture = cfg.colorTexture;\n\n /**\n * RGBA {@link XKTTexture} containing metallic and roughness factors in R and G.\n *\n * @type {XKTTexture}\n */\n this.metallicRoughnessTexture = cfg.metallicRoughnessTexture;\n\n /**\n * RGBA {@link XKTTexture} with surface normals in RGB.\n *\n * @type {XKTTexture}\n */\n this.normalsTexture = cfg.normalsTexture;\n\n /**\n * RGBA {@link XKTTexture} with emissive color in RGB.\n *\n * @type {XKTTexture}\n */\n this.emissiveTexture = cfg.emissiveTexture;\n\n /**\n * RGBA {@link XKTTexture} with ambient occlusion factors in RGB.\n *\n * @type {XKTTexture}\n */\n this.occlusionTexture = cfg.occlusionTexture;\n }\n}\n\nexport {XKTTextureSet};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/textures\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/images\");","import {math} from \"../lib/math.js\";\nimport {geometryCompression} from \"./lib/geometryCompression.js\";\nimport {buildEdgeIndices} from \"./lib/buildEdgeIndices.js\";\nimport {isTriangleMeshSolid} from \"./lib/isTriangleMeshSolid.js\";\n\nimport {XKTMesh} from './XKTMesh.js';\nimport {XKTGeometry} from './XKTGeometry.js';\nimport {XKTEntity} from './XKTEntity.js';\nimport {XKTTile} from './XKTTile.js';\nimport {KDNode} from \"./KDNode.js\";\nimport {XKTMetaObject} from \"./XKTMetaObject.js\";\nimport {XKTPropertySet} from \"./XKTPropertySet.js\";\nimport {mergeVertices} from \"../lib/mergeVertices.js\";\nimport {XKT_INFO} from \"../XKT_INFO.js\";\nimport {XKTTexture} from \"./XKTTexture\";\nimport {XKTTextureSet} from \"./XKTTextureSet\";\nimport {encode, load} from \"@loaders.gl/core\";\nimport {KTX2BasisWriter} from \"@loaders.gl/textures\";\nimport {ImageLoader} from '@loaders.gl/images';\n\nconst tempVec4a = math.vec4([0, 0, 0, 1]);\nconst tempVec4b = math.vec4([0, 0, 0, 1]);\n\nconst tempMat4 = math.mat4();\nconst tempMat4b = math.mat4();\n\nconst kdTreeDimLength = new Float64Array(3);\n\n// XKT texture types\n\nconst COLOR_TEXTURE = 0;\nconst METALLIC_ROUGHNESS_TEXTURE = 1;\nconst NORMALS_TEXTURE = 2;\nconst EMISSIVE_TEXTURE = 3;\nconst OCCLUSION_TEXTURE = 4;\n\n// KTX2 encoding options for each texture type\n\nconst TEXTURE_ENCODING_OPTIONS = {}\nTEXTURE_ENCODING_OPTIONS[COLOR_TEXTURE] = {\n useSRGB: true,\n qualityLevel: 50,\n encodeUASTC: true,\n mipmaps: true\n};\nTEXTURE_ENCODING_OPTIONS[EMISSIVE_TEXTURE] = {\n useSRGB: true,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[METALLIC_ROUGHNESS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 50,\n mipmaps: true // Needed for GGX roughness shading\n};\nTEXTURE_ENCODING_OPTIONS[NORMALS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[OCCLUSION_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\n\n/**\n * A document model that represents the contents of an .XKT file.\n *\n * * An XKTModel contains {@link XKTTile}s, which spatially subdivide the model into axis-aligned, box-shaped regions.\n * * Each {@link XKTTile} contains {@link XKTEntity}s, which represent the objects within its region.\n * * Each {@link XKTEntity} has {@link XKTMesh}s, which each have a {@link XKTGeometry}. Each {@link XKTGeometry} can be shared by multiple {@link XKTMesh}s.\n * * Import models into an XKTModel using {@link parseGLTFJSONIntoXKTModel}, {@link parseIFCIntoXKTModel}, {@link parseCityJSONIntoXKTModel} etc.\n * * Build an XKTModel programmatically using {@link XKTModel#createGeometry}, {@link XKTModel#createMesh} and {@link XKTModel#createEntity}.\n * * Serialize an XKTModel to an ArrayBuffer using {@link writeXKTModelToArrayBuffer}.\n *\n * ## Usage\n *\n * See [main docs page](/docs/#javascript-api) for usage examples.\n *\n * @class XKTModel\n */\nclass XKTModel {\n\n /**\n * Constructs a new XKTModel.\n *\n * @param {*} [cfg] Configuration\n * @param {Number} [cfg.edgeThreshold=10]\n * @param {Number} [cfg.minTileSize=500]\n */\n constructor(cfg = {}) {\n\n /**\n * The model's ID, if available.\n *\n * Will be \"default\" by default.\n *\n * @type {String}\n */\n this.modelId = cfg.modelId || \"default\";\n\n /**\n * The project ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.projectId = cfg.projectId || \"\";\n\n /**\n * The revision ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.revisionId = cfg.revisionId || \"\";\n\n /**\n * The model author, if available.\n *\n * Will be an empty string by default.\n *\n * @property author\n * @type {String}\n */\n this.author = cfg.author || \"\";\n\n /**\n * The date the model was created, if available.\n *\n * Will be an empty string by default.\n *\n * @property createdAt\n * @type {String}\n */\n this.createdAt = cfg.createdAt || \"\";\n\n /**\n * The application that created the model, if available.\n *\n * Will be an empty string by default.\n *\n * @property creatingApplication\n * @type {String}\n */\n this.creatingApplication = cfg.creatingApplication || \"\";\n\n /**\n * The model schema version, if available.\n *\n * In the case of IFC, this could be \"IFC2x3\" or \"IFC4\", for example.\n *\n * Will be an empty string by default.\n *\n * @property schema\n * @type {String}\n */\n this.schema = cfg.schema || \"\";\n\n /**\n * The XKT format version.\n *\n * @property xktVersion;\n * @type {number}\n */\n this.xktVersion = XKT_INFO.xktVersion;\n\n /**\n *\n * @type {Number|number}\n */\n this.edgeThreshold = cfg.edgeThreshold || 10;\n\n /**\n * Minimum diagonal size of the boundary of an {@link XKTTile}.\n *\n * @type {Number|number}\n */\n this.minTileSize = cfg.minTileSize || 500;\n\n /**\n * Optional overall AABB that contains all the {@link XKTEntity}s we'll create in this model, if previously known.\n *\n * This is the AABB of a complete set of input files that are provided as a split-model set for conversion.\n *\n * This is used to help the {@link XKTTile.aabb}s within split models align neatly with each other, as we\n * build them with a k-d tree in {@link XKTModel#finalize}. Without this, the AABBs of the different parts\n * tend to misalign slightly, resulting in excess number of {@link XKTTile}s, which degrades memory and rendering\n * performance when the XKT is viewer in the xeokit Viewer.\n */\n this.modelAABB = cfg.modelAABB;\n\n /**\n * Map of {@link XKTPropertySet}s within this XKTModel, each mapped to {@link XKTPropertySet#propertySetId}.\n *\n * Created by {@link XKTModel#createPropertySet}.\n *\n * @type {{String:XKTPropertySet}}\n */\n this.propertySets = {};\n\n /**\n * {@link XKTPropertySet}s within this XKTModel.\n *\n * Each XKTPropertySet holds its position in this list in {@link XKTPropertySet#propertySetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTPropertySet[]}\n */\n this.propertySetsList = [];\n\n /**\n * Map of {@link XKTMetaObject}s within this XKTModel, each mapped to {@link XKTMetaObject#metaObjectId}.\n *\n * Created by {@link XKTModel#createMetaObject}.\n *\n * @type {{String:XKTMetaObject}}\n */\n this.metaObjects = {};\n\n /**\n * {@link XKTMetaObject}s within this XKTModel.\n *\n * Each XKTMetaObject holds its position in this list in {@link XKTMetaObject#metaObjectIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMetaObject[]}\n */\n this.metaObjectsList = [];\n\n /**\n * The positions of all shared {@link XKTGeometry}s are de-quantized using this singular\n * de-quantization matrix.\n *\n * This de-quantization matrix is generated from the collective Local-space boundary of the\n * positions of all shared {@link XKTGeometry}s.\n *\n * @type {Float32Array}\n */\n this.reusedGeometriesDecodeMatrix = new Float32Array(16);\n\n /**\n * Map of {@link XKTGeometry}s within this XKTModel, each mapped to {@link XKTGeometry#geometryId}.\n *\n * Created by {@link XKTModel#createGeometry}.\n *\n * @type {{Number:XKTGeometry}}\n */\n this.geometries = {};\n\n /**\n * List of {@link XKTGeometry}s within this XKTModel, in the order they were created.\n *\n * Each XKTGeometry holds its position in this list in {@link XKTGeometry#geometryIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTGeometry[]}\n */\n this.geometriesList = [];\n\n /**\n * Map of {@link XKTTexture}s within this XKTModel, each mapped to {@link XKTTexture#textureId}.\n *\n * Created by {@link XKTModel#createTexture}.\n *\n * @type {{Number:XKTTexture}}\n */\n this.textures = {};\n\n /**\n * List of {@link XKTTexture}s within this XKTModel, in the order they were created.\n *\n * Each XKTTexture holds its position in this list in {@link XKTTexture#textureIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTexture[]}\n */\n this.texturesList = [];\n\n /**\n * Map of {@link XKTTextureSet}s within this XKTModel, each mapped to {@link XKTTextureSet#textureSetId}.\n *\n * Created by {@link XKTModel#createTextureSet}.\n *\n * @type {{Number:XKTTextureSet}}\n */\n this.textureSets = {};\n\n /**\n * List of {@link XKTTextureSet}s within this XKTModel, in the order they were created.\n *\n * Each XKTTextureSet holds its position in this list in {@link XKTTextureSet#textureSetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTextureSet[]}\n */\n this.textureSetsList = [];\n\n /**\n * Map of {@link XKTMesh}s within this XKTModel, each mapped to {@link XKTMesh#meshId}.\n *\n * Created by {@link XKTModel#createMesh}.\n *\n * @type {{Number:XKTMesh}}\n */\n this.meshes = {};\n\n /**\n * List of {@link XKTMesh}s within this XKTModel, in the order they were created.\n *\n * Each XKTMesh holds its position in this list in {@link XKTMesh#meshIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMesh[]}\n */\n this.meshesList = [];\n\n /**\n * Map of {@link XKTEntity}s within this XKTModel, each mapped to {@link XKTEntity#entityId}.\n *\n * Created by {@link XKTModel#createEntity}.\n *\n * @type {{String:XKTEntity}}\n */\n this.entities = {};\n\n /**\n * {@link XKTEntity}s within this XKTModel.\n *\n * Each XKTEntity holds its position in this list in {@link XKTEntity#entityIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTEntity[]}\n */\n this.entitiesList = [];\n\n /**\n * {@link XKTTile}s within this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTile[]}\n */\n this.tilesList = [];\n\n /**\n * The axis-aligned 3D World-space boundary of this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {Float64Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this XKTModel has been finalized.\n *\n * Set ````true```` by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.finalized = false;\n }\n\n /**\n * Creates an {@link XKTPropertySet} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.propertySetId Unique ID for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetType=\"default\"] A meta type for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetName] Human-readable name for the {@link XKTPropertySet}. Defaults to the ````propertySetId```` parameter.\n * @param {String[]} params.properties Properties for the {@link XKTPropertySet}.\n * @returns {XKTPropertySet} The new {@link XKTPropertySet}.\n */\n createPropertySet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.propertySetId === null || params.propertySetId === undefined) {\n throw \"Parameter expected: params.propertySetId\";\n }\n\n if (params.properties === null || params.properties === undefined) {\n throw \"Parameter expected: params.properties\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more property sets\");\n return;\n }\n\n if (this.propertySets[params.propertySetId]) {\n // console.error(\"XKTPropertySet already exists with this ID: \" + params.propertySetId);\n return;\n }\n\n const propertySetId = params.propertySetId;\n const propertySetType = params.propertySetType || \"Default\";\n const propertySetName = params.propertySetName || params.propertySetId;\n const properties = params.properties || [];\n\n const propertySet = new XKTPropertySet(propertySetId, propertySetType, propertySetName, properties);\n\n this.propertySets[propertySetId] = propertySet;\n this.propertySetsList.push(propertySet);\n\n return propertySet;\n }\n\n /**\n * Creates an {@link XKTMetaObject} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.metaObjectId Unique ID for the {@link XKTMetaObject}.\n * @param {String} params.propertySetIds ID of one or more property sets that contains additional metadata about\n * this {@link XKTMetaObject}. The property sets could be stored externally (ie not managed at all by the XKT file),\n * or could be {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n * @param {String} [params.metaObjectType=\"default\"] A meta type for the {@link XKTMetaObject}. Can be anything,\n * but is usually an IFC type, such as \"IfcSite\" or \"IfcWall\".\n * @param {String} [params.metaObjectName] Human-readable name for the {@link XKTMetaObject}. Defaults to the ````metaObjectId```` parameter.\n * @param {String} [params.parentMetaObjectId] ID of the parent {@link XKTMetaObject}, if any. Defaults to the ````metaObjectId```` parameter.\n * @returns {XKTMetaObject} The new {@link XKTMetaObject}.\n */\n createMetaObject(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.metaObjectId === null || params.metaObjectId === undefined) {\n throw \"Parameter expected: params.metaObjectId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more meta objects\");\n return;\n }\n\n if (this.metaObjects[params.metaObjectId]) {\n // console.error(\"XKTMetaObject already exists with this ID: \" + params.metaObjectId);\n return;\n }\n\n const metaObjectId = params.metaObjectId;\n const propertySetIds = params.propertySetIds;\n const metaObjectType = params.metaObjectType || \"Default\";\n const metaObjectName = params.metaObjectName || params.metaObjectId;\n const parentMetaObjectId = params.parentMetaObjectId;\n\n const metaObject = new XKTMetaObject(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId);\n\n this.metaObjects[metaObjectId] = metaObject;\n this.metaObjectsList.push(metaObject);\n\n if (!parentMetaObjectId) {\n if (!this._rootMetaObject) {\n this._rootMetaObject = metaObject;\n }\n }\n\n return metaObject;\n }\n\n /**\n * Creates an {@link XKTTexture} within this XKTModel.\n *\n * Registers the new {@link XKTTexture} in {@link XKTModel#textures} and {@link XKTModel#texturesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureId Unique ID for the {@link XKTTexture}.\n * @param {String} [params.src] Source of an image file for the texture.\n * @param {Buffer} [params.imageData] Image data for the texture.\n * @param {Number} [params.mediaType] Media type (ie. MIME type) of ````imageData````. Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n * @param {Number} [params.width] Texture width, used with ````imageData````. Ignored for compressed textures.\n * @param {Number} [params.height] Texture height, used with ````imageData````. Ignored for compressed textures.\n * @param {Boolean} [params.compressed=true] Whether to compress the texture.\n * @param {Number} [params.minFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers less than one pixel. Supported\n * values are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter}, {@link NearestMipMapNearestFilter},\n * {@link NearestMipMapLinearFilter} and {@link LinearMipMapLinearFilter}. Ignored for compressed textures.\n * @param {Number} [params.magFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}. Ignored for compressed textures.\n * @param {Number} [params.wrapS=RepeatWrapping] Wrap parameter for texture coordinate *S*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @param {Number} [params.wrapT=RepeatWrapping] Wrap parameter for texture coordinate *T*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * {@param {Number} [params.wrapR=RepeatWrapping] Wrap parameter for texture coordinate *R*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @returns {XKTTexture} The new {@link XKTTexture}.\n */\n createTexture(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureId === null || params.textureId === undefined) {\n throw \"Parameter expected: params.textureId\";\n }\n\n if (!params.imageData && !params.src) {\n throw \"Parameter expected: params.imageData or params.src\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textures\");\n return;\n }\n\n if (this.textures[params.textureId]) {\n console.error(\"XKTTexture already exists with this ID: \" + params.textureId);\n return;\n }\n\n if (params.src) {\n const fileExt = params.src.split('.').pop();\n if (fileExt !== \"jpg\" && fileExt !== \"jpeg\" && fileExt !== \"png\") {\n console.error(`XKTModel does not support image files with extension '${fileExt}' - won't create texture '${params.textureId}`);\n return;\n }\n }\n\n const textureId = params.textureId;\n\n const texture = new XKTTexture({\n textureId,\n imageData: params.imageData,\n mediaType: params.mediaType,\n minFilter: params.minFilter,\n magFilter: params.magFilter,\n wrapS: params.wrapS,\n wrapT: params.wrapT,\n wrapR: params.wrapR,\n width: params.width,\n height: params.height,\n compressed: (params.compressed !== false),\n src: params.src\n });\n\n this.textures[textureId] = texture;\n this.texturesList.push(texture);\n\n return texture;\n }\n\n /**\n * Creates an {@link XKTTextureSet} within this XKTModel.\n *\n * Registers the new {@link XKTTextureSet} in {@link XKTModel#textureSets} and {@link XKTModel#.textureSetsList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureSetId Unique ID for the {@link XKTTextureSet}.\n * @param {*} [params.colorTextureId] ID of *RGBA* base color {@link XKTTexture}, with color in *RGB* and alpha in *A*.\n * @param {*} [params.metallicRoughnessTextureId] ID of *RGBA* metal-roughness {@link XKTTexture}, with the metallic factor in *R*, and roughness factor in *G*.\n * @param {*} [params.normalsTextureId] ID of *RGBA* normal {@link XKTTexture}, with normal map vectors in *RGB*.\n * @param {*} [params.emissiveTextureId] ID of *RGBA* emissive {@link XKTTexture}, with emissive color in *RGB*.\n * @param {*} [params.occlusionTextureId] ID of *RGBA* occlusion {@link XKTTexture}, with occlusion factor in *R*.\n * @returns {XKTTextureSet} The new {@link XKTTextureSet}.\n */\n createTextureSet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureSetId === null || params.textureSetId === undefined) {\n throw \"Parameter expected: params.textureSetId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textureSets\");\n return;\n }\n\n if (this.textureSets[params.textureSetId]) {\n console.error(\"XKTTextureSet already exists with this ID: \" + params.textureSetId);\n return;\n }\n\n let colorTexture;\n if (params.colorTextureId !== undefined && params.colorTextureId !== null) {\n colorTexture = this.textures[params.colorTextureId];\n if (!colorTexture) {\n console.error(`Texture not found: ${params.colorTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n colorTexture.channel = COLOR_TEXTURE;\n }\n\n let metallicRoughnessTexture;\n if (params.metallicRoughnessTextureId !== undefined && params.metallicRoughnessTextureId !== null) {\n metallicRoughnessTexture = this.textures[params.metallicRoughnessTextureId];\n if (!metallicRoughnessTexture) {\n console.error(`Texture not found: ${params.metallicRoughnessTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n metallicRoughnessTexture.channel = METALLIC_ROUGHNESS_TEXTURE;\n }\n\n let normalsTexture;\n if (params.normalsTextureId !== undefined && params.normalsTextureId !== null) {\n normalsTexture = this.textures[params.normalsTextureId];\n if (!normalsTexture) {\n console.error(`Texture not found: ${params.normalsTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n normalsTexture.channel = NORMALS_TEXTURE;\n }\n\n let emissiveTexture;\n if (params.emissiveTextureId !== undefined && params.emissiveTextureId !== null) {\n emissiveTexture = this.textures[params.emissiveTextureId];\n if (!emissiveTexture) {\n console.error(`Texture not found: ${params.emissiveTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n emissiveTexture.channel = EMISSIVE_TEXTURE;\n }\n\n let occlusionTexture;\n if (params.occlusionTextureId !== undefined && params.occlusionTextureId !== null) {\n occlusionTexture = this.textures[params.occlusionTextureId];\n if (!occlusionTexture) {\n console.error(`Texture not found: ${params.occlusionTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n occlusionTexture.channel = OCCLUSION_TEXTURE;\n }\n\n const textureSet = new XKTTextureSet({\n textureSetId: params.textureSetId,\n textureSetIndex: this.textureSetsList.length,\n colorTexture,\n metallicRoughnessTexture,\n normalsTexture,\n emissiveTexture,\n occlusionTexture\n });\n\n this.textureSets[params.textureSetId] = textureSet;\n this.textureSetsList.push(textureSet);\n\n return textureSet;\n }\n\n /**\n * Creates an {@link XKTGeometry} within this XKTModel.\n *\n * Registers the new {@link XKTGeometry} in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.geometryId Unique ID for the {@link XKTGeometry}.\n * @param {String} params.primitiveType The type of {@link XKTGeometry}: \"triangles\", \"lines\" or \"points\".\n * @param {Float64Array} params.positions Floating-point Local-space vertex positions for the {@link XKTGeometry}. Required for all primitive types.\n * @param {Number[]} [params.normals] Floating-point vertex normals for the {@link XKTGeometry}. Only used with triangles primitives. Ignored for points and lines.\n * @param {Number[]} [params.colors] Floating-point RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.uvs] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uv````.\n * @param {Number[]} [params.uv] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uvs````.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Uint32Array} [params.indices] Indices for the {@link XKTGeometry}. Required for triangles and lines primitives. Ignored for points.\n * @param {Number} [params.edgeThreshold=10]\n * @returns {XKTGeometry} The new {@link XKTGeometry}.\n */\n createGeometry(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (!params.primitiveType) {\n throw \"Parameter expected: params.primitiveType\";\n }\n\n if (!params.positions) {\n throw \"Parameter expected: params.positions\";\n }\n\n const triangles = params.primitiveType === \"triangles\";\n const points = params.primitiveType === \"points\";\n const lines = params.primitiveType === \"lines\";\n const line_strip = params.primitiveType === \"line-strip\";\n const triangle_strip = params.primitiveType === \"triangle-strip\";\n const triangle_fan = params.primitiveType === \"triangle-fan\";\n\n if (!triangles && !points && !lines && !line_strip) {\n throw \"Unsupported value for params.primitiveType: \"\n + params.primitiveType\n + \"' - supported values are 'triangles', 'points', 'lines', 'line-strip', 'triangle-strip' and 'triangle-fan\";\n }\n\n if (triangles) {\n if (!params.indices) {\n params.indices = this._createDefaultIndices()\n throw \"Parameter expected for 'triangles' primitive: params.indices\";\n }\n }\n\n if (points) {\n if (!params.colors && !params.colorsCompressed) {\n throw \"Parameter expected for 'points' primitive: params.colors or params.colorsCompressed\";\n }\n }\n\n if (lines) {\n if (!params.indices) {\n throw \"Parameter expected for 'lines' primitive: params.indices\";\n }\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more geometries\");\n return;\n }\n\n if (this.geometries[params.geometryId]) {\n console.error(\"XKTGeometry already exists with this ID: \" + params.geometryId);\n return;\n }\n\n const geometryId = params.geometryId;\n const primitiveType = params.primitiveType;\n const positions = new Float64Array(params.positions); // May modify in #finalize\n\n const xktGeometryCfg = {\n geometryId: geometryId,\n geometryIndex: this.geometriesList.length,\n primitiveType: primitiveType,\n positions: positions,\n uvs: params.uvs || params.uv\n }\n\n if (triangles) {\n if (params.normals) {\n xktGeometryCfg.normals = new Float32Array(params.normals);\n }\n if (params.indices) {\n xktGeometryCfg.indices = params.indices;\n } else {\n xktGeometryCfg.indices = this._createDefaultIndices(positions.length / 3);\n }\n }\n\n if (points) {\n if (params.colorsCompressed) {\n xktGeometryCfg.colorsCompressed = new Uint8Array(params.colorsCompressed);\n\n } else {\n const colors = params.colors;\n const colorsCompressed = new Uint8Array(colors.length);\n for (let i = 0, len = colors.length; i < len; i++) {\n colorsCompressed[i] = Math.floor(colors[i] * 255);\n }\n xktGeometryCfg.colorsCompressed = colorsCompressed;\n }\n }\n\n if (lines) {\n xktGeometryCfg.indices = params.indices;\n }\n\n if (triangles) {\n\n if (!params.normals && !params.uv && !params.uvs) {\n\n // Building models often duplicate positions to allow face-aligned vertex normals; when we're not\n // providing normals for a geometry, it becomes possible to merge duplicate vertex positions within it.\n\n // TODO: Make vertex merging also merge normals?\n\n const mergedPositions = [];\n const mergedIndices = [];\n mergeVertices(xktGeometryCfg.positions, xktGeometryCfg.indices, mergedPositions, mergedIndices);\n xktGeometryCfg.positions = new Float64Array(mergedPositions);\n xktGeometryCfg.indices = mergedIndices;\n }\n\n xktGeometryCfg.edgeIndices = buildEdgeIndices(xktGeometryCfg.positions, xktGeometryCfg.indices, null, params.edgeThreshold || this.edgeThreshold || 10);\n }\n\n const geometry = new XKTGeometry(xktGeometryCfg);\n\n this.geometries[geometryId] = geometry;\n this.geometriesList.push(geometry);\n\n return geometry;\n }\n\n _createDefaultIndices(numIndices) {\n const indices = [];\n for (let i = 0; i < numIndices; i++) {\n indices.push(i);\n }\n return indices;\n }\n\n /**\n * Creates an {@link XKTMesh} within this XKTModel.\n *\n * An {@link XKTMesh} can be owned by one {@link XKTEntity}, which can own multiple {@link XKTMesh}es.\n *\n * Registers the new {@link XKTMesh} in {@link XKTModel#meshes} and {@link XKTModel#meshesList}.\n *\n * @param {*} params Method parameters.\n * @param {Number} params.meshId Unique ID for the {@link XKTMesh}.\n * @param {Number} params.geometryId ID of an existing {@link XKTGeometry} in {@link XKTModel#geometries}.\n * @param {Number} [params.textureSetId] Unique ID of an {@link XKTTextureSet} in {@link XKTModel#textureSets}.\n * @param {Float32Array} params.color RGB color for the {@link XKTMesh}, with each color component in range [0..1].\n * @param {Number} [params.metallic=0] How metallic the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully dielectric material, while ````1```` indicates fully metallic.\n * @param {Number} [params.roughness=1] How rough the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully smooth, while ````1```` indicates fully rough.\n * @param {Number} params.opacity Opacity factor for the {@link XKTMesh}, in range [0..1].\n * @param {Float64Array} [params.matrix] Modeling matrix for the {@link XKTMesh}. Overrides ````position````, ````scale```` and ````rotation```` parameters.\n * @param {Number[]} [params.position=[0,0,0]] Position of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.scale=[1,1,1]] Scale of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.rotation=[0,0,0]] Rotation of the {@link XKTMesh} as Euler angles given in degrees, for each of the X, Y and Z axis. Overridden by the ````matrix```` parameter.\n * @returns {XKTMesh} The new {@link XKTMesh}.\n */\n createMesh(params) {\n\n if (params.meshId === null || params.meshId === undefined) {\n throw \"Parameter expected: params.meshId\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (this.finalized) {\n throw \"XKTModel has been finalized, can't add more meshes\";\n }\n\n if (this.meshes[params.meshId]) {\n console.error(\"XKTMesh already exists with this ID: \" + params.meshId);\n return;\n }\n\n const geometry = this.geometries[params.geometryId];\n\n if (!geometry) {\n console.error(\"XKTGeometry not found: \" + params.geometryId);\n return;\n }\n\n geometry.numInstances++;\n\n let textureSet = null;\n if (params.textureSetId) {\n textureSet = this.textureSets[params.textureSetId];\n if (!textureSet) {\n console.error(\"XKTTextureSet not found: \" + params.textureSetId);\n return;\n }\n textureSet.numInstances++;\n }\n\n let matrix = params.matrix;\n\n if (!matrix) {\n\n const position = params.position;\n const scale = params.scale;\n const rotation = params.rotation;\n\n if (position || scale || rotation) {\n matrix = math.identityMat4();\n const quaternion = math.eulerToQuaternion(rotation || [0, 0, 0], \"XYZ\", math.identityQuaternion());\n math.composeMat4(position || [0, 0, 0], quaternion, scale || [1, 1, 1], matrix)\n\n } else {\n matrix = math.identityMat4();\n }\n }\n\n const meshIndex = this.meshesList.length;\n\n const mesh = new XKTMesh({\n meshId: params.meshId,\n meshIndex,\n matrix,\n geometry,\n color: params.color,\n metallic: params.metallic,\n roughness: params.roughness,\n opacity: params.opacity,\n textureSet\n });\n\n this.meshes[mesh.meshId] = mesh;\n this.meshesList.push(mesh);\n\n return mesh;\n }\n\n /**\n * Creates an {@link XKTEntity} within this XKTModel.\n *\n * Registers the new {@link XKTEntity} in {@link XKTModel#entities} and {@link XKTModel#entitiesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.entityId Unique ID for the {@link XKTEntity}.\n * @param {String[]} params.meshIds IDs of {@link XKTMesh}es used by the {@link XKTEntity}. Note that each {@link XKTMesh} can only be used by one {@link XKTEntity}.\n * @returns {XKTEntity} The new {@link XKTEntity}.\n */\n createEntity(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.entityId === null || params.entityId === undefined) {\n throw \"Parameter expected: params.entityId\";\n }\n\n if (!params.meshIds) {\n throw \"Parameter expected: params.meshIds\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more entities\");\n return;\n }\n\n if (params.meshIds.length === 0) {\n console.warn(\"XKTEntity has no meshes - won't create: \" + params.entityId);\n return;\n }\n\n let entityId = params.entityId;\n\n if (this.entities[entityId]) {\n while (this.entities[entityId]) {\n entityId = math.createUUID();\n }\n console.error(\"XKTEntity already exists with this ID: \" + params.entityId + \" - substituting random ID instead: \" + entityId);\n }\n\n const meshIds = params.meshIds;\n const meshes = [];\n\n for (let meshIdIdx = 0, meshIdLen = meshIds.length; meshIdIdx < meshIdLen; meshIdIdx++) {\n\n const meshId = meshIds[meshIdIdx];\n const mesh = this.meshes[meshId];\n\n if (!mesh) {\n console.error(\"XKTMesh found: \" + meshId);\n continue;\n }\n\n if (mesh.entity) {\n console.error(\"XKTMesh \" + meshId + \" already used by XKTEntity \" + mesh.entity.entityId);\n continue;\n }\n\n meshes.push(mesh);\n }\n\n const entity = new XKTEntity(entityId, meshes);\n\n for (let i = 0, len = meshes.length; i < len; i++) {\n const mesh = meshes[i];\n mesh.entity = entity;\n }\n\n this.entities[entityId] = entity;\n this.entitiesList.push(entity);\n\n return entity;\n }\n\n /**\n * Creates a default {@link XKTMetaObject} for each {@link XKTEntity} that does not already have one.\n */\n createDefaultMetaObjects() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const metaObjectId = entity.entityId;\n const metaObject = this.metaObjects[metaObjectId];\n\n if (!metaObject) {\n\n if (!this._rootMetaObject) {\n this._rootMetaObject = this.createMetaObject({\n metaObjectId: this.modelId,\n metaObjectType: \"Default\",\n metaObjectName: this.modelId\n });\n }\n\n this.createMetaObject({\n metaObjectId: metaObjectId,\n metaObjectType: \"Default\",\n metaObjectName: \"\" + metaObjectId,\n parentMetaObjectId: this._rootMetaObject.metaObjectId\n });\n }\n }\n }\n\n /**\n * Finalizes this XKTModel.\n *\n * After finalizing, we may then serialize the model to an array buffer using {@link writeXKTModelToArrayBuffer}.\n *\n * Logs error and does nothing if this XKTModel has already been finalized.\n *\n * Internally, this method:\n *\n * * for each {@link XKTEntity} that doesn't already have a {@link XKTMetaObject}, creates one with {@link XKTMetaObject#metaObjectType} set to \"default\"\n * * sets each {@link XKTEntity}'s {@link XKTEntity#hasReusedGeometries} true if it shares its {@link XKTGeometry}s with other {@link XKTEntity}s,\n * * creates each {@link XKTEntity}'s {@link XKTEntity#aabb},\n * * creates {@link XKTTile}s in {@link XKTModel#tilesList}, and\n * * sets {@link XKTModel#finalized} ````true````.\n */\n async finalize() {\n\n if (this.finalized) {\n console.log(\"XKTModel already finalized\");\n return;\n }\n\n this._removeUnusedTextures();\n\n await this._compressTextures();\n\n this._bakeSingleUseGeometryPositions();\n\n this._bakeAndOctEncodeNormals();\n\n this._createEntityAABBs();\n\n const rootKDNode = this._createKDTree();\n\n this.entitiesList = [];\n\n this._createTilesFromKDTree(rootKDNode);\n\n this._createReusedGeometriesDecodeMatrix();\n\n this._flagSolidGeometries();\n\n this.aabb.set(rootKDNode.aabb);\n\n this.finalized = true;\n }\n\n _removeUnusedTextures() {\n let texturesList = [];\n const textures = {};\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n if (texture.channel !== null) {\n texture.textureIndex = texturesList.length;\n texturesList.push(texture);\n textures[texture.textureId] = texture;\n }\n }\n this.texturesList = texturesList;\n this.textures = textures;\n }\n\n _compressTextures() {\n let countTextures = this.texturesList.length;\n return new Promise((resolve) => {\n if (countTextures === 0) {\n resolve();\n return;\n }\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n const encodingOptions = TEXTURE_ENCODING_OPTIONS[texture.channel] || {};\n\n if (texture.src) {\n\n // XKTTexture created with XKTModel#createTexture({ src: ... })\n\n const src = texture.src;\n const fileExt = src.split('.').pop();\n switch (fileExt) {\n case \"jpeg\":\n case \"jpg\":\n case \"png\":\n load(src, ImageLoader, {\n image: {\n type: \"data\"\n }\n }).then((imageData) => {\n if (texture.compressed) {\n encode(imageData, KTX2BasisWriter, encodingOptions).then((encodedData) => {\n const encodedImageData = new Uint8Array(encodedData);\n texture.imageData = encodedImageData;\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to load image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n break;\n default:\n if (--countTextures <= 0) {\n resolve();\n }\n break;\n }\n }\n\n if (texture.imageData) {\n\n // XKTTexture created with XKTModel#createTexture({ imageData: ... })\n\n if (texture.compressed) {\n encode(texture.imageData, KTX2BasisWriter, encodingOptions)\n .then((encodedImageData) => {\n texture.imageData = new Uint8Array(encodedImageData);\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }\n }\n });\n }\n\n _bakeSingleUseGeometryPositions() {\n\n for (let j = 0, lenj = this.meshesList.length; j < lenj; j++) {\n\n const mesh = this.meshesList[j];\n\n const geometry = mesh.geometry;\n\n if (geometry.numInstances === 1) {\n\n const matrix = mesh.matrix;\n\n if (matrix && (!math.isIdentityMat4(matrix))) {\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n\n positions[i + 0] = tempVec4b[0];\n positions[i + 1] = tempVec4b[1];\n positions[i + 2] = tempVec4b[2];\n }\n }\n }\n }\n }\n\n _bakeAndOctEncodeNormals() {\n\n for (let i = 0, len = this.meshesList.length; i < len; i++) {\n\n const mesh = this.meshesList[i];\n const geometry = mesh.geometry;\n\n if (geometry.normals && !geometry.normalsOctEncoded) {\n\n geometry.normalsOctEncoded = new Int8Array(geometry.normals.length);\n\n if (geometry.numInstances > 1) {\n geometryCompression.octEncodeNormals(geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n\n } else {\n const modelNormalMatrix = math.inverseMat4(math.transposeMat4(mesh.matrix, tempMat4), tempMat4b);\n geometryCompression.transformAndOctEncodeNormals(modelNormalMatrix, geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n }\n }\n }\n }\n\n _createEntityAABBs() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const entityAABB = entity.aabb;\n const meshes = entity.meshes;\n\n math.collapseAABB3(entityAABB);\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n const matrix = mesh.matrix;\n\n if (geometry.numInstances > 1) {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n math.expandAABB3Point3(entityAABB, tempVec4b);\n }\n\n } else {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n math.expandAABB3Point3(entityAABB, tempVec4a);\n }\n }\n }\n }\n }\n\n _createKDTree() {\n\n let aabb;\n if (this.modelAABB) {\n aabb = this.modelAABB; // Pre-known uber AABB\n } else {\n aabb = math.collapseAABB3();\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n math.expandAABB3(aabb, entity.aabb);\n }\n }\n\n const rootKDNode = new KDNode(aabb);\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n this._insertEntityIntoKDTree(rootKDNode, entity);\n }\n\n return rootKDNode;\n }\n\n _insertEntityIntoKDTree(kdNode, entity) {\n\n const nodeAABB = kdNode.aabb;\n const entityAABB = entity.aabb;\n\n const nodeAABBDiag = math.getAABB3Diag(nodeAABB);\n\n if (nodeAABBDiag < this.minTileSize) {\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n math.expandAABB3(nodeAABB, entityAABB);\n return;\n }\n\n if (kdNode.left) {\n if (math.containsAABB3(kdNode.left.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (kdNode.right) {\n if (math.containsAABB3(kdNode.right.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdTreeDimLength[0] = nodeAABB[3] - nodeAABB[0];\n kdTreeDimLength[1] = nodeAABB[4] - nodeAABB[1];\n kdTreeDimLength[2] = nodeAABB[5] - nodeAABB[2];\n\n let dim = 0;\n\n if (kdTreeDimLength[1] > kdTreeDimLength[dim]) {\n dim = 1;\n }\n\n if (kdTreeDimLength[2] > kdTreeDimLength[dim]) {\n dim = 2;\n }\n\n if (!kdNode.left) {\n const aabbLeft = nodeAABB.slice();\n aabbLeft[dim + 3] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.left = new KDNode(aabbLeft);\n if (math.containsAABB3(aabbLeft, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (!kdNode.right) {\n const aabbRight = nodeAABB.slice();\n aabbRight[dim] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.right = new KDNode(aabbRight);\n if (math.containsAABB3(aabbRight, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n\n math.expandAABB3(nodeAABB, entityAABB);\n }\n\n _createTilesFromKDTree(rootKDNode) {\n this._createTilesFromKDNode(rootKDNode);\n }\n\n _createTilesFromKDNode(kdNode) {\n if (kdNode.entities && kdNode.entities.length > 0) {\n this._createTileFromEntities(kdNode);\n }\n if (kdNode.left) {\n this._createTilesFromKDNode(kdNode.left);\n }\n if (kdNode.right) {\n this._createTilesFromKDNode(kdNode.right);\n }\n }\n\n /**\n * Creates a tile from the given entities.\n *\n * For each single-use {@link XKTGeometry}, this method centers {@link XKTGeometry#positions} to make them relative to the\n * tile's center, then quantizes the positions to unsigned 16-bit integers, relative to the tile's boundary.\n *\n * @param kdNode\n */\n _createTileFromEntities(kdNode) {\n\n const tileAABB = kdNode.aabb;\n const entities = kdNode.entities;\n\n const tileCenter = math.getAABB3Center(tileAABB);\n const tileCenterNeg = math.mulVec3Scalar(tileCenter, -1, math.vec3());\n\n const rtcAABB = math.AABB3(); // AABB centered at the RTC origin\n\n rtcAABB[0] = tileAABB[0] - tileCenter[0];\n rtcAABB[1] = tileAABB[1] - tileCenter[1];\n rtcAABB[2] = tileAABB[2] - tileCenter[2];\n rtcAABB[3] = tileAABB[3] - tileCenter[0];\n rtcAABB[4] = tileAABB[4] - tileCenter[1];\n rtcAABB[5] = tileAABB[5] - tileCenter[2];\n\n for (let i = 0; i < entities.length; i++) {\n\n const entity = entities [i];\n\n const meshes = entity.meshes;\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n\n if (!geometry.reused) { // Batched geometry\n\n const positions = geometry.positions;\n\n // Center positions relative to their tile's World-space center\n\n for (let k = 0, lenk = positions.length; k < lenk; k += 3) {\n\n positions[k + 0] -= tileCenter[0];\n positions[k + 1] -= tileCenter[1];\n positions[k + 2] -= tileCenter[2];\n }\n\n // Quantize positions relative to tile's RTC-space boundary\n\n geometryCompression.quantizePositions(positions, positions.length, rtcAABB, geometry.positionsQuantized);\n\n } else { // Instanced geometry\n\n // Post-multiply a translation to the mesh's modeling matrix\n // to center the entity's geometry instances to the tile RTC center\n\n //////////////////////////////\n // Why do we do this?\n // Seems to break various models\n /////////////////////////////////\n\n math.translateMat4v(tileCenterNeg, mesh.matrix);\n }\n }\n\n entity.entityIndex = this.entitiesList.length;\n\n this.entitiesList.push(entity);\n }\n\n const tile = new XKTTile(tileAABB, entities);\n\n this.tilesList.push(tile);\n }\n\n _createReusedGeometriesDecodeMatrix() {\n\n const tempVec3a = math.vec3();\n const reusedGeometriesAABB = math.collapseAABB3(math.AABB3());\n let countReusedGeometries = 0;\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) { // Instanced geometry\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n math.expandAABB3Point3(reusedGeometriesAABB, tempVec3a);\n }\n\n countReusedGeometries++;\n }\n }\n\n if (countReusedGeometries > 0) {\n\n geometryCompression.createPositionsDecodeMatrix(reusedGeometriesAABB, this.reusedGeometriesDecodeMatrix);\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) {\n geometryCompression.quantizePositions(geometry.positions, geometry.positions.length, reusedGeometriesAABB, geometry.positionsQuantized);\n }\n }\n\n } else {\n math.identityMat4(this.reusedGeometriesDecodeMatrix); // No need for this matrix, but we'll be tidy and set it to identity\n }\n }\n\n _flagSolidGeometries() {\n let maxNumPositions = 0;\n let maxNumIndices = 0;\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n if (geometry.positionsQuantized.length > maxNumPositions) {\n maxNumPositions = geometry.positionsQuantized.length;\n }\n if (geometry.indices.length > maxNumIndices) {\n maxNumIndices = geometry.indices.length;\n }\n }\n }\n let vertexIndexMapping = new Array(maxNumPositions / 3);\n let edges = new Array(maxNumIndices);\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n geometry.solid = isTriangleMeshSolid(geometry.indices, geometry.positionsQuantized, vertexIndexMapping, edges);\n }\n }\n }\n}\n\nexport {\n XKTModel\n}","/**\n * Given geometry defined as an array of positions, optional normals, option uv and an array of indices, returns\n * modified arrays that have duplicate vertices removed.\n *\n * @private\n */\nfunction mergeVertices(positions, indices, mergedPositions, mergedIndices) {\n const positionsMap = {};\n const indicesLookup = [];\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let uvi = 0;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n const vx = positions[i];\n const vy = positions[i + 1];\n const vz = positions[i + 2];\n const key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n if (positionsMap[key] === undefined) {\n positionsMap[key] = mergedPositions.length / 3;\n mergedPositions.push(vx);\n mergedPositions.push(vy);\n mergedPositions.push(vz);\n }\n indicesLookup[i / 3] = positionsMap[key];\n uvi += 2;\n }\n for (let i = 0, len = indices.length; i < len; i++) {\n mergedIndices[i] = indicesLookup[indices[i]];\n }\n}\n\nexport {mergeVertices};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"pako\");","import {XKT_INFO} from \"../XKT_INFO.js\";\nimport * as pako from 'pako';\n\nconst XKT_VERSION = XKT_INFO.xktVersion;\nconst NUM_TEXTURE_ATTRIBUTES = 9;\nconst NUM_MATERIAL_ATTRIBUTES = 6;\n\n/**\n * Writes an {@link XKTModel} to an {@link ArrayBuffer}.\n *\n * @param {XKTModel} xktModel The {@link XKTModel}.\n * @param {String} metaModelJSON The metamodel JSON in a string.\n * @param {Object} [stats] Collects statistics.\n * @param {Object} options Options for how the XKT is written.\n * @param {Boolean} [options.zip=true] ZIP the contents?\n * @returns {ArrayBuffer} The {@link ArrayBuffer}.\n */\nfunction writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, options) {\n const data = getModelData(xktModel, metaModelJSON, stats);\n const deflatedData = deflateData(data, metaModelJSON, options);\n stats.texturesSize += deflatedData.textureData.byteLength;\n const arrayBuffer = createArrayBuffer(deflatedData);\n return arrayBuffer;\n}\n\nfunction getModelData(xktModel, metaModelDataStr, stats) {\n\n //------------------------------------------------------------------------------------------------------------------\n // Allocate data\n //------------------------------------------------------------------------------------------------------------------\n\n const propertySetsList = xktModel.propertySetsList;\n const metaObjectsList = xktModel.metaObjectsList;\n const geometriesList = xktModel.geometriesList;\n const texturesList = xktModel.texturesList;\n const textureSetsList = xktModel.textureSetsList;\n const meshesList = xktModel.meshesList;\n const entitiesList = xktModel.entitiesList;\n const tilesList = xktModel.tilesList;\n\n const numPropertySets = propertySetsList.length;\n const numMetaObjects = metaObjectsList.length;\n const numGeometries = geometriesList.length;\n const numTextures = texturesList.length;\n const numTextureSets = textureSetsList.length;\n const numMeshes = meshesList.length;\n const numEntities = entitiesList.length;\n const numTiles = tilesList.length;\n\n let lenPositions = 0;\n let lenNormals = 0;\n let lenColors = 0;\n let lenUVs = 0;\n let lenIndices = 0;\n let lenEdgeIndices = 0;\n let lenMatrices = 0;\n let lenTextures = 0;\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n if (geometry.positionsQuantized) {\n lenPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n lenNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n lenColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n lenUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n lenIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n lenEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n for (let textureIndex = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n lenTextures += imageData.byteLength;\n\n if (xktTexture.compressed) {\n stats.numCompressedTextures++;\n }\n }\n\n for (let meshIndex = 0; meshIndex < numMeshes; meshIndex++) {\n const mesh = meshesList[meshIndex];\n if (mesh.geometry.numInstances > 1) {\n lenMatrices += 16;\n }\n }\n\n const data = {\n metadata: {},\n textureData: new Uint8Array(lenTextures), // All textures\n eachTextureDataPortion: new Uint32Array(numTextures), // For each texture, an index to its first element in textureData\n eachTextureAttributes: new Uint16Array(numTextures * NUM_TEXTURE_ATTRIBUTES),\n positions: new Uint16Array(lenPositions), // All geometry arrays\n normals: new Int8Array(lenNormals),\n colors: new Uint8Array(lenColors),\n uvs: new Float32Array(lenUVs),\n indices: new Uint32Array(lenIndices),\n edgeIndices: new Uint32Array(lenEdgeIndices),\n eachTextureSetTextures: new Int32Array(numTextureSets * 5), // For each texture set, a set of five Texture indices [color, metal/roughness,normals,emissive,occlusion]; each index has value -1 if no texture\n matrices: new Float32Array(lenMatrices), // Modeling matrices for entities that share geometries. Each entity either shares all it's geometries, or owns all its geometries exclusively. Exclusively-owned geometries are pre-transformed into World-space, and so their entities don't have modeling matrices in this array.\n reusedGeometriesDecodeMatrix: new Float32Array(xktModel.reusedGeometriesDecodeMatrix), // A single, global vertex position de-quantization matrix for all reused geometries. Reused geometries are quantized to their collective Local-space AABB, and this matrix is derived from that AABB.\n eachGeometryPrimitiveType: new Uint8Array(numGeometries), // Primitive type for each geometry (0=solid triangles, 1=surface triangles, 2=lines, 3=points, 4=line-strip)\n eachGeometryPositionsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.positions. Every primitive type has positions.\n eachGeometryNormalsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.normals. If the next geometry has the same index, then this geometry has no normals.\n eachGeometryColorsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.colors. If the next geometry has the same index, then this geometry has no colors.\n eachGeometryUVsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.uvs. If the next geometry has the same index, then this geometry has no UVs.\n eachGeometryIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.indices. If the next geometry has the same index, then this geometry has no indices.\n eachGeometryEdgeIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.edgeIndices. If the next geometry has the same index, then this geometry has no edge indices.\n eachMeshGeometriesPortion: new Uint32Array(numMeshes), // For each mesh, an index into the eachGeometry* arrays\n eachMeshMatricesPortion: new Uint32Array(numMeshes), // For each mesh that shares its geometry, an index to its first element in data.matrices, to indicate the modeling matrix that transforms the shared geometry Local-space vertex positions. This is ignored for meshes that don't share geometries, because the vertex positions of non-shared geometries are pre-transformed into World-space.\n eachMeshTextureSet: new Int32Array(numMeshes), // For each mesh, the index of its texture set in data.eachTextureSetTextures; this array contains signed integers so that we can use -1 to indicate when a mesh has no texture set\n eachMeshMaterialAttributes: new Uint8Array(numMeshes * NUM_MATERIAL_ATTRIBUTES), // For each mesh, an RGBA integer color of format [0..255, 0..255, 0..255, 0..255], and PBR metallic and roughness factors, of format [0..255, 0..255]\n eachEntityId: [], // For each entity, an ID string\n eachEntityMeshesPortion: new Uint32Array(numEntities), // For each entity, the index of the first element of meshes used by the entity\n eachTileAABB: new Float64Array(numTiles * 6), // For each tile, an axis-aligned bounding box\n eachTileEntitiesPortion: new Uint32Array(numTiles) // For each tile, the index of the first element of eachEntityId, eachEntityMeshesPortion and eachEntityMatricesPortion used by the tile\n };\n\n let countPositions = 0;\n let countNormals = 0;\n let countColors = 0;\n let countUVs = 0;\n let countIndices = 0;\n let countEdgeIndices = 0;\n\n // Metadata\n\n data.metadata = {\n id: xktModel.modelId,\n projectId: xktModel.projectId,\n revisionId: xktModel.revisionId,\n author: xktModel.author,\n createdAt: xktModel.createdAt,\n creatingApplication: xktModel.creatingApplication,\n schema: xktModel.schema,\n propertySets: [],\n metaObjects: []\n };\n\n // Property sets\n\n for (let propertySetsIndex = 0; propertySetsIndex < numPropertySets; propertySetsIndex++) {\n const propertySet = propertySetsList[propertySetsIndex];\n const propertySetJSON = {\n id: \"\" + propertySet.propertySetId,\n name: propertySet.propertySetName,\n type: propertySet.propertySetType,\n properties: propertySet.properties\n };\n data.metadata.propertySets.push(propertySetJSON);\n }\n\n // Metaobjects\n\n if (!metaModelDataStr) {\n for (let metaObjectsIndex = 0; metaObjectsIndex < numMetaObjects; metaObjectsIndex++) {\n const metaObject = metaObjectsList[metaObjectsIndex];\n const metaObjectJSON = {\n name: metaObject.metaObjectName,\n type: metaObject.metaObjectType,\n id: \"\" + metaObject.metaObjectId\n };\n if (metaObject.parentMetaObjectId !== undefined && metaObject.parentMetaObjectId !== null) {\n metaObjectJSON.parent = \"\" + metaObject.parentMetaObjectId;\n }\n if (metaObject.propertySetIds && metaObject.propertySetIds.length > 0) {\n metaObjectJSON.propertySetIds = metaObject.propertySetIds;\n }\n if (metaObject.external) {\n metaObjectJSON.external = metaObject.external;\n }\n data.metadata.metaObjects.push(metaObjectJSON);\n }\n }\n\n // Geometries\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n let primitiveType = 1;\n switch (geometry.primitiveType) {\n case \"triangles\":\n primitiveType = geometry.solid ? 0 : 1;\n break;\n case \"points\":\n primitiveType = 2;\n break;\n case \"lines\":\n primitiveType = 3;\n break;\n case \"line-strip\":\n primitiveType = 4;\n break;\n case \"triangle-strip\":\n primitiveType = 5;\n break;\n case \"triangle-fan\":\n primitiveType = 6;\n break;\n default:\n primitiveType = 1\n }\n data.eachGeometryPrimitiveType [geometryIndex] = primitiveType;\n data.eachGeometryPositionsPortion [geometryIndex] = countPositions;\n data.eachGeometryNormalsPortion [geometryIndex] = countNormals;\n data.eachGeometryColorsPortion [geometryIndex] = countColors;\n data.eachGeometryUVsPortion [geometryIndex] = countUVs;\n data.eachGeometryIndicesPortion [geometryIndex] = countIndices;\n data.eachGeometryEdgeIndicesPortion [geometryIndex] = countEdgeIndices;\n if (geometry.positionsQuantized) {\n data.positions.set(geometry.positionsQuantized, countPositions);\n countPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n data.normals.set(geometry.normalsOctEncoded, countNormals);\n countNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n data.colors.set(geometry.colorsCompressed, countColors);\n countColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n data.uvs.set(geometry.uvs, countUVs);\n countUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n data.indices.set(geometry.indices, countIndices);\n countIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n data.edgeIndices.set(geometry.edgeIndices, countEdgeIndices);\n countEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n // Textures\n\n for (let textureIndex = 0, numTextures = xktModel.texturesList.length, portionIdx = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = xktModel.texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n data.textureData.set(imageData, portionIdx);\n data.eachTextureDataPortion[textureIndex] = portionIdx;\n\n portionIdx += imageData.byteLength;\n\n let textureAttrIdx = textureIndex * NUM_TEXTURE_ATTRIBUTES;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.compressed ? 1 : 0;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.mediaType; // GIFMediaType | PNGMediaType | JPEGMediaType\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.width;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.height;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.minFilter; // LinearMipmapLinearFilter | LinearMipMapNearestFilter | NearestMipMapNearestFilter | NearestMipMapLinearFilter | LinearMipMapLinearFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.magFilter; // LinearFilter | NearestFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapS; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapT; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapR; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n }\n\n // Texture sets\n\n for (let textureSetIndex = 0, numTextureSets = xktModel.textureSetsList.length, eachTextureSetTexturesIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {\n const textureSet = textureSetsList[textureSetIndex];\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.colorTexture ? textureSet.colorTexture.textureIndex : -1; // Color map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.metallicRoughnessTexture ? textureSet.metallicRoughnessTexture.textureIndex : -1; // Metal/rough map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.normalsTexture ? textureSet.normalsTexture.textureIndex : -1; // Normal map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.emissiveTexture ? textureSet.emissiveTexture.textureIndex : -1; // Emissive map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.occlusionTexture ? textureSet.occlusionTexture.textureIndex : -1; // Occlusion map\n }\n\n // Tiles -> Entities -> Meshes\n\n let entityIndex = 0;\n let countEntityMeshesPortion = 0;\n let eachMeshMaterialAttributesIndex = 0;\n let matricesIndex = 0;\n let meshIndex = 0;\n\n for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) {\n\n const tile = tilesList [tileIndex];\n const tileEntities = tile.entities;\n const numTileEntities = tileEntities.length;\n\n if (numTileEntities === 0) {\n continue;\n }\n\n data.eachTileEntitiesPortion[tileIndex] = entityIndex;\n\n const tileAABB = tile.aabb;\n\n for (let j = 0; j < numTileEntities; j++) {\n\n const entity = tileEntities[j];\n const entityMeshes = entity.meshes;\n const numEntityMeshes = entityMeshes.length;\n\n for (let k = 0; k < numEntityMeshes; k++) {\n\n const mesh = entityMeshes[k];\n const geometry = mesh.geometry;\n const geometryIndex = geometry.geometryIndex;\n\n data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex;\n\n if (mesh.geometry.numInstances > 1) {\n data.matrices.set(mesh.matrix, matricesIndex);\n data.eachMeshMatricesPortion [meshIndex] = matricesIndex;\n matricesIndex += 16;\n }\n\n data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;\n\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness\n\n meshIndex++;\n }\n\n data.eachEntityId [entityIndex] = entity.entityId;\n data.eachEntityMeshesPortion[entityIndex] = countEntityMeshesPortion; // <<<<<<<<<<<<<<<<<<<< Error here? Order/value of countEntityMeshesPortion correct?\n\n entityIndex++;\n countEntityMeshesPortion += numEntityMeshes;\n }\n\n const tileAABBIndex = tileIndex * 6;\n\n data.eachTileAABB.set(tileAABB, tileAABBIndex);\n }\n\n return data;\n}\n\nfunction deflateData(data, metaModelJSON, options) {\n\n function deflate(buffer) {\n return (options.zip !== false) ? pako.deflate(buffer) : buffer;\n }\n\n let metaModelBytes;\n if (metaModelJSON) {\n const deflatedJSON = deflateJSON(metaModelJSON);\n metaModelBytes = deflate(deflatedJSON)\n } else {\n const deflatedJSON = deflateJSON(data.metadata);\n metaModelBytes = deflate(deflatedJSON)\n }\n\n return {\n metadata: metaModelBytes,\n textureData: deflate(data.textureData.buffer),\n eachTextureDataPortion: deflate(data.eachTextureDataPortion.buffer),\n eachTextureAttributes: deflate(data.eachTextureAttributes.buffer),\n positions: deflate(data.positions.buffer),\n normals: deflate(data.normals.buffer),\n colors: deflate(data.colors.buffer),\n uvs: deflate(data.uvs.buffer),\n indices: deflate(data.indices.buffer),\n edgeIndices: deflate(data.edgeIndices.buffer),\n eachTextureSetTextures: deflate(data.eachTextureSetTextures.buffer),\n matrices: deflate(data.matrices.buffer),\n reusedGeometriesDecodeMatrix: deflate(data.reusedGeometriesDecodeMatrix.buffer),\n eachGeometryPrimitiveType: deflate(data.eachGeometryPrimitiveType.buffer),\n eachGeometryPositionsPortion: deflate(data.eachGeometryPositionsPortion.buffer),\n eachGeometryNormalsPortion: deflate(data.eachGeometryNormalsPortion.buffer),\n eachGeometryColorsPortion: deflate(data.eachGeometryColorsPortion.buffer),\n eachGeometryUVsPortion: deflate(data.eachGeometryUVsPortion.buffer),\n eachGeometryIndicesPortion: deflate(data.eachGeometryIndicesPortion.buffer),\n eachGeometryEdgeIndicesPortion: deflate(data.eachGeometryEdgeIndicesPortion.buffer),\n eachMeshGeometriesPortion: deflate(data.eachMeshGeometriesPortion.buffer),\n eachMeshMatricesPortion: deflate(data.eachMeshMatricesPortion.buffer),\n eachMeshTextureSet: deflate(data.eachMeshTextureSet.buffer),\n eachMeshMaterialAttributes: deflate(data.eachMeshMaterialAttributes.buffer),\n eachEntityId: deflate(JSON.stringify(data.eachEntityId)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n })),\n eachEntityMeshesPortion: deflate(data.eachEntityMeshesPortion.buffer),\n eachTileAABB: deflate(data.eachTileAABB.buffer),\n eachTileEntitiesPortion: deflate(data.eachTileEntitiesPortion.buffer)\n };\n}\n\nfunction deflateJSON(strings) {\n return JSON.stringify(strings)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n });\n}\n\nfunction createArrayBuffer(deflatedData) {\n return toArrayBuffer([\n deflatedData.metadata,\n deflatedData.textureData,\n deflatedData.eachTextureDataPortion,\n deflatedData.eachTextureAttributes,\n deflatedData.positions,\n deflatedData.normals,\n deflatedData.colors,\n deflatedData.uvs,\n deflatedData.indices,\n deflatedData.edgeIndices,\n deflatedData.eachTextureSetTextures,\n deflatedData.matrices,\n deflatedData.reusedGeometriesDecodeMatrix,\n deflatedData.eachGeometryPrimitiveType,\n deflatedData.eachGeometryPositionsPortion,\n deflatedData.eachGeometryNormalsPortion,\n deflatedData.eachGeometryColorsPortion,\n deflatedData.eachGeometryUVsPortion,\n deflatedData.eachGeometryIndicesPortion,\n deflatedData.eachGeometryEdgeIndicesPortion,\n deflatedData.eachMeshGeometriesPortion,\n deflatedData.eachMeshMatricesPortion,\n deflatedData.eachMeshTextureSet,\n deflatedData.eachMeshMaterialAttributes,\n deflatedData.eachEntityId,\n deflatedData.eachEntityMeshesPortion,\n deflatedData.eachTileAABB,\n deflatedData.eachTileEntitiesPortion\n ]);\n}\n\nfunction toArrayBuffer(elements) {\n const indexData = new Uint32Array(elements.length + 2);\n indexData[0] = XKT_VERSION;\n indexData [1] = elements.length; // Stored Data 1.1: number of stored elements\n let dataLen = 0; // Stored Data 1.2: length of stored elements\n for (let i = 0, len = elements.length; i < len; i++) {\n const element = elements[i];\n const elementsize = element.length;\n indexData[i + 2] = elementsize;\n dataLen += elementsize;\n }\n const indexBuf = new Uint8Array(indexData.buffer);\n const dataArray = new Uint8Array(indexBuf.length + dataLen);\n dataArray.set(indexBuf);\n let offset = indexBuf.length;\n for (let i = 0, len = elements.length; i < len; i++) { // Stored Data 2: the elements themselves\n const element = elements[i];\n dataArray.set(element, offset);\n offset += element.length;\n }\n return dataArray.buffer;\n}\n\nexport {writeXKTModelToArrayBuffer};","/** @private */\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n\n // filter collinear points around the cuts\n filterPoints(outerNode, outerNode.next);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n\nexport {earcut};","import {earcut} from './../lib/earcut';\nimport {math} from \"./../lib/math.js\";\n\nconst tempVec2a = math.vec2();\nconst tempVec3a = math.vec3();\nconst tempVec3b = math.vec3();\nconst tempVec3c = math.vec3();\n\n/**\n * @desc Parses a CityJSON model into an {@link XKTModel}.\n *\n * [CityJSON](https://www.cityjson.org) is a JSON-based encoding for a subset of the CityGML data model (version 2.0.0),\n * which is an open standardised data model and exchange format to store digital 3D models of cities and\n * landscapes. CityGML is an official standard of the [Open Geospatial Consortium](https://www.ogc.org/).\n *\n * This converter function supports most of the [CityJSON 1.0.2 Specification](https://www.cityjson.org/specs/1.0.2),\n * with the following limitations:\n *\n * * Does not (yet) support CityJSON semantics for geometry primitives.\n * * Does not (yet) support textured geometries.\n * * Does not (yet) support geometry templates.\n * * When the CityJSON file provides multiple *themes* for a geometry, then we parse only the first of the provided themes for that geometry.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a CityJSON model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/cityjson/DenHaag.json\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseCityJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.data CityJSON data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the CityJSON vertex positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform CityJSON vertex positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when CityJSON has been parsed.\n */\nfunction parseCityJSONIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n stats = {}, log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (data.type !== \"CityJSON\") {\n reject(\"Invalid argument: data is not a CityJSON file\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n let vertices;\n\n log(\"Using parser: parseCityJSONIntoXKTModel\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n\n if (data.transform || center || transform) {\n vertices = copyVertices(data.vertices);\n if (data.transform) {\n transformVertices(vertices, data.transform)\n }\n if (center) {\n centerVertices(vertices);\n }\n if (transform) {\n customTransformVertices(vertices, transform);\n }\n } else {\n vertices = data.vertices;\n }\n\n stats.sourceFormat = data.type || \"\";\n stats.schemaVersion = data.version || \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n stats.numMetaObjects++;\n\n const modelMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: modelMetaObjectId,\n metaObjectType: \"CityJSON\",\n metaObjectName: \"CityJSON\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n stats.numMetaObjects++;\n\n const ctx = {\n data,\n vertices,\n xktModel,\n rootMetaObjectId: modelMetaObjectId,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n ctx.xktModel.schema = data.type + \" \" + data.version;\n\n ctx.log(\"Converting \" + ctx.xktModel.schema);\n\n parseCityJSON(ctx);\n\n resolve();\n });\n}\n\nfunction copyVertices(vertices) {\n const vertices2 = [];\n for (let i = 0, j = 0; i < vertices.length; i++, j += 3) {\n const x = vertices[i][0];\n const y = vertices[i][1];\n const z = vertices[i][2];\n vertices2.push([x, y, z]);\n }\n return vertices2;\n}\n\nfunction transformVertices(vertices, cityJSONTransform) {\n const scale = cityJSONTransform.scale || math.vec3([1, 1, 1]);\n const translate = cityJSONTransform.translate || math.vec3([0, 0, 0]);\n for (let i = 0; i < vertices.length; i++) {\n const vertex = vertices[i];\n vertex[0] = (vertex[0] * scale[0]) + translate[0];\n vertex[1] = (vertex[1] * scale[1]) + translate[1];\n vertex[2] = (vertex[2] * scale[2]) + translate[2];\n }\n}\n\nfunction centerVertices(vertices) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = vertices.length;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n centerPos[0] += vertex[0];\n centerPos[1] += vertex[1];\n centerPos[2] += vertex[2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n vertex[0] -= centerPos[0];\n vertex[1] -= centerPos[1];\n vertex[2] -= centerPos[2];\n }\n }\n}\n\nfunction customTransformVertices(vertices, transform) {\n if (transform) {\n const mat = math.mat4(transform);\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n math.transformPoint3(mat, vertex, vertex);\n }\n }\n}\n\nfunction parseCityJSON(ctx) {\n\n const data = ctx.data;\n const cityObjects = data.CityObjects;\n\n for (const objectId in cityObjects) {\n if (cityObjects.hasOwnProperty(objectId)) {\n const cityObject = cityObjects[objectId];\n parseCityObject(ctx, cityObject, objectId);\n }\n }\n}\n\nfunction parseCityObject(ctx, cityObject, objectId) {\n\n const xktModel = ctx.xktModel;\n const data = ctx.data;\n const metaObjectId = objectId;\n const metaObjectType = cityObject.type;\n const metaObjectName = metaObjectType + \" : \" + objectId;\n\n const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObjectId;\n\n xktModel.createMetaObject({\n metaObjectId,\n metaObjectName,\n metaObjectType,\n parentMetaObjectId\n });\n\n ctx.stats.numMetaObjects++;\n\n if (!(cityObject.geometry && cityObject.geometry.length > 0)) {\n return;\n }\n\n const meshIds = [];\n\n for (let i = 0, len = cityObject.geometry.length; i < len; i++) {\n\n const geometry = cityObject.geometry[i];\n\n let objectMaterial;\n let surfaceMaterials;\n\n const appearance = data.appearance;\n if (appearance) {\n const materials = appearance.materials;\n if (materials) {\n const geometryMaterial = geometry.material;\n if (geometryMaterial) {\n const themeIds = Object.keys(geometryMaterial);\n if (themeIds.length > 0) {\n const themeId = themeIds[0];\n const theme = geometryMaterial[themeId];\n if (theme.value !== undefined) {\n objectMaterial = materials[theme.value];\n } else {\n const values = theme.values;\n if (values) {\n surfaceMaterials = [];\n for (let j = 0, lenj = values.length; j < lenj; j++) {\n const value = values[i];\n const surfaceMaterial = materials[value];\n surfaceMaterials.push(surfaceMaterial);\n }\n }\n }\n }\n }\n }\n }\n\n if (surfaceMaterials) {\n parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds);\n\n } else {\n parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds);\n }\n }\n\n if (meshIds.length > 0) {\n xktModel.createEntity({\n entityId: objectId,\n meshIds: meshIds\n });\n\n ctx.stats.numObjects++;\n }\n}\n\nfunction parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) {\n\n const geomType = geometry.type;\n\n switch (geomType) {\n\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n break;\n\n case \"MultiSolid\":\n\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n}\n\nfunction parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) {\n\n const vertices = ctx.vertices;\n const xktModel = ctx.xktModel;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n const surface = surfaces[i];\n const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0};\n\n const face = [];\n const holes = [];\n\n const sharedIndices = [];\n\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n for (let j = 0; j < surface.length; j++) {\n\n if (face.length > 0) {\n holes.push(face.length);\n }\n\n const newFace = extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg);\n\n face.push(...newFace);\n }\n\n if (face.length === 3) { // Triangle\n\n geometryCfg.indices.push(face[0]);\n geometryCfg.indices.push(face[1]);\n geometryCfg.indices.push(face[2]);\n\n } else if (face.length > 3) { // Polygon\n\n // Prepare to triangulate\n\n const pList = [];\n\n for (let k = 0; k < face.length; k++) {\n pList.push({\n x: vertices[sharedIndices[face[k]]][0],\n y: vertices[sharedIndices[face[k]]][1],\n z: vertices[sharedIndices[face[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n\n // Convert to 2D\n\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n\n to2D(pList[k], normal, tempVec2a);\n\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n // Triangulate\n\n const tr = earcut(pv, holes, 2);\n\n // Create triangles\n\n for (let k = 0; k < tr.length; k += 3) {\n geometryCfg.indices.unshift(face[tr[k]]);\n geometryCfg.indices.unshift(face[tr[k + 1]]);\n geometryCfg.indices.unshift(face[tr[k + 2]]);\n }\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n}\n\nfunction parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) {\n\n const xktModel = ctx.xktModel;\n const sharedIndices = [];\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n const geomType = geometry.type;\n\n switch (geomType) {\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n break;\n\n case \"MultiSolid\":\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n}\n\nfunction parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) {\n\n const vertices = ctx.vertices;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n let boundary = [];\n let holes = [];\n\n for (let j = 0; j < surfaces[i].length; j++) {\n if (boundary.length > 0) {\n holes.push(boundary.length);\n }\n const newBoundary = extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg);\n boundary.push(...newBoundary);\n }\n\n if (boundary.length === 3) { // Triangle\n\n primitiveCfg.indices.push(boundary[0]);\n primitiveCfg.indices.push(boundary[1]);\n primitiveCfg.indices.push(boundary[2]);\n\n } else if (boundary.length > 3) { // Polygon\n\n let pList = [];\n\n for (let k = 0; k < boundary.length; k++) {\n pList.push({\n x: vertices[sharedIndices[boundary[k]]][0],\n y: vertices[sharedIndices[boundary[k]]][1],\n z: vertices[sharedIndices[boundary[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n to2D(pList[k], normal, tempVec2a);\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n const tr = earcut(pv, holes, 2);\n\n for (let k = 0; k < tr.length; k += 3) {\n primitiveCfg.indices.unshift(boundary[tr[k]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 1]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 2]]);\n }\n }\n }\n}\n\nfunction extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) {\n\n const vertices = ctx.vertices;\n const newBoundary = []\n\n for (let i = 0, len = boundary.length; i < len; i++) {\n\n const index = boundary[i];\n\n if (sharedIndices.includes(index)) {\n const vertexIndex = sharedIndices.indexOf(index);\n newBoundary.push(vertexIndex);\n\n } else {\n geometryCfg.positions.push(vertices[index][0]);\n geometryCfg.positions.push(vertices[index][1]);\n geometryCfg.positions.push(vertices[index][2]);\n\n newBoundary.push(sharedIndices.length);\n\n sharedIndices.push(index);\n }\n }\n\n return newBoundary\n}\n\nfunction getNormalOfPositions(positions, normal) {\n\n for (let i = 0; i < positions.length; i++) {\n\n let nexti = i + 1;\n if (nexti === positions.length) {\n nexti = 0;\n }\n\n normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z));\n normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x));\n normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y));\n }\n\n return math.normalizeVec3(normal);\n}\n\nfunction to2D(_p, _n, re) {\n\n const p = tempVec3a;\n const n = tempVec3b;\n const x3 = tempVec3c;\n\n p[0] = _p.x;\n p[1] = _p.y;\n p[2] = _p.z;\n\n n[0] = _n.x;\n n[1] = _n.y;\n n[2] = _n.z;\n\n x3[0] = 1.1;\n x3[1] = 1.1;\n x3[2] = 1.1;\n\n const dist = math.lenVec3(math.subVec3(x3, n));\n\n if (dist < 0.01) {\n x3[0] += 1.0;\n x3[1] += 2.0;\n x3[2] += 3.0;\n }\n\n const dot = math.dotVec3(x3, n);\n const tmp2 = math.mulVec3Scalar(n, dot, math.vec3());\n\n x3[0] -= tmp2[0];\n x3[1] -= tmp2[1];\n x3[2] -= tmp2[2];\n\n math.normalizeVec3(x3);\n\n const y3 = math.cross3Vec3(n, x3, math.vec3());\n const x = math.dotVec3(p, x3);\n const y = math.dotVec3(p, y3);\n\n re[0] = x;\n re[1] = y;\n}\n\nexport {parseCityJSONIntoXKTModel};","function isString(value) {\n return (typeof value === 'string' || value instanceof String);\n}\n\nfunction apply(o, o2) {\n for (const name in o) {\n if (o.hasOwnProperty(name)) {\n o2[name] = o[name];\n }\n }\n return o2;\n}\n\n/**\n * @private\n */\nconst utils = {\n isString,\n apply\n};\n\nexport {utils};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/gltf\");","import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nimport {parse} from '@loaders.gl/core';\nimport {GLTFLoader} from '@loaders.gl/gltf';\nimport {\n ClampToEdgeWrapping,\n LinearFilter,\n LinearMipMapLinearFilter,\n LinearMipMapNearestFilter,\n MirroredRepeatWrapping,\n NearestFilter,\n NearestMipMapLinearFilter,\n NearestMipMapNearestFilter,\n RepeatWrapping\n} from \"../constants.js\";\n\n/**\n * @desc Parses glTF into an {@link XKTModel}, supporting ````.glb```` and textures.\n *\n * * Supports ````.glb```` and textures\n * * For a lightweight glTF JSON parser that ignores textures, see {@link parseGLTFJSONIntoXKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a binary glTF model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"../assets/models/gltf/HousePlan/glTF-Binary/HousePlan.glb\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {ArrayBuffer} params.data The glTF.\n * @param {String} [params.baseUri] The base URI used to load this glTF, if any. For resolving relative uris to linked resources.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeTextures=true] Whether to parse textures.\n * @param {Boolean} [params.includeNormals=true] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the glTF.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when glTF has been parsed.\n */\nfunction parseGLTFIntoXKTModel({\n data,\n baseUri,\n xktModel,\n metaModelData,\n includeTextures = true,\n includeNormals = true,\n getAttachment,\n stats = {},\n log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n parse(data, GLTFLoader, {\n baseUri\n }).then((gltfData) => {\n\n const ctx = {\n gltfData,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n error: function (msg) {\n console.error(msg);\n },\n xktModel,\n includeNormals: (includeNormals !== false),\n includeTextures: (includeTextures !== false),\n geometryCreated: {},\n nextId: 0,\n stats\n };\n\n ctx.log(\"Using parser: parseGLTFIntoXKTModel\");\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n ctx.log(`Parsing textures: ${ctx.includeTextures ? \"enabled\" : \"disabled\"}`);\n\n if (ctx.includeTextures) {\n parseTextures(ctx);\n }\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(`[parseGLTFIntoXKTModel] ${errMsg}`);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n return {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n}\n\nfunction parseTextures(ctx) {\n const gltfData = ctx.gltfData;\n const textures = gltfData.textures;\n if (textures) {\n for (let i = 0, len = textures.length; i < len; i++) {\n parseTexture(ctx, textures[i]);\n ctx.stats.numTextures++;\n }\n }\n}\n\nfunction parseTexture(ctx, texture) {\n if (!texture.source || !texture.source.image) {\n return;\n }\n const textureId = `texture-${ctx.nextId++}`;\n\n let minFilter = NearestMipMapLinearFilter;\n switch (texture.sampler.minFilter) {\n case 9728:\n minFilter = NearestFilter;\n break;\n case 9729:\n minFilter = LinearFilter;\n break;\n case 9984:\n minFilter = NearestMipMapNearestFilter;\n break;\n case 9985:\n minFilter = LinearMipMapNearestFilter;\n break;\n case 9986:\n minFilter = NearestMipMapLinearFilter;\n break;\n case 9987:\n minFilter = LinearMipMapLinearFilter;\n break;\n }\n\n let magFilter = LinearFilter;\n switch (texture.sampler.magFilter) {\n case 9728:\n magFilter = NearestFilter;\n break;\n case 9729:\n magFilter = LinearFilter;\n break;\n }\n\n let wrapS = RepeatWrapping;\n switch (texture.sampler.wrapS) {\n case 33071:\n wrapS = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapS = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapS = RepeatWrapping;\n break;\n }\n\n let wrapT = RepeatWrapping;\n switch (texture.sampler.wrapT) {\n case 33071:\n wrapT = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapT = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapT = RepeatWrapping;\n break;\n }\n\n let wrapR = RepeatWrapping;\n switch (texture.sampler.wrapR) {\n case 33071:\n wrapR = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapR = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapR = RepeatWrapping;\n break;\n }\n\n ctx.xktModel.createTexture({\n textureId: textureId,\n imageData: texture.source.image,\n mediaType: texture.source.mediaType,\n compressed: true,\n width: texture.source.image.width,\n height: texture.source.image.height,\n minFilter,\n magFilter,\n wrapS,\n wrapT,\n wrapR,\n flipY: !!texture.flipY,\n // encoding: \"sRGB\"\n });\n texture._textureId = textureId;\n}\n\nfunction parseMaterials(ctx) {\n const gltfData = ctx.gltfData;\n const materials = gltfData.materials;\n if (materials) {\n for (let i = 0, len = materials.length; i < len; i++) {\n const material = materials[i];\n material._textureSetId = ctx.includeTextures ? parseTextureSet(ctx, material) : null;\n material._attributes = parseMaterialAttributes(ctx, material);\n }\n }\n}\n\nfunction parseTextureSet(ctx, material) {\n const textureSetCfg = {};\n if (material.normalTexture) {\n textureSetCfg.normalTextureId = material.normalTexture.texture._textureId;\n }\n if (material.occlusionTexture) {\n textureSetCfg.occlusionTextureId = material.occlusionTexture.texture._textureId;\n }\n if (material.emissiveTexture) {\n textureSetCfg.emissiveTextureId = material.emissiveTexture.texture._textureId;\n }\n // const alphaMode = material.alphaMode;\n // switch (alphaMode) {\n // case \"NORMAL_OPAQUE\":\n // materialCfg.alphaMode = \"opaque\";\n // break;\n // case \"MASK\":\n // materialCfg.alphaMode = \"mask\";\n // break;\n // case \"BLEND\":\n // materialCfg.alphaMode = \"blend\";\n // break;\n // default:\n // }\n // const alphaCutoff = material.alphaCutoff;\n // if (alphaCutoff !== undefined) {\n // materialCfg.alphaCutoff = alphaCutoff;\n // }\n const metallicPBR = material.pbrMetallicRoughness;\n if (material.pbrMetallicRoughness) {\n const pbrMetallicRoughness = material.pbrMetallicRoughness;\n const baseColorTexture = pbrMetallicRoughness.baseColorTexture || pbrMetallicRoughness.colorTexture;\n if (baseColorTexture) {\n if (baseColorTexture.texture) {\n textureSetCfg.colorTextureId = baseColorTexture.texture._textureId;\n } else {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[baseColorTexture.index]._textureId;\n }\n }\n if (metallicPBR.metallicRoughnessTexture) {\n textureSetCfg.metallicRoughnessTextureId = metallicPBR.metallicRoughnessTexture.texture._textureId;\n }\n }\n const extensions = material.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const specularTexture = specularPBR.specularTexture;\n if (specularTexture !== null && specularTexture !== undefined) {\n // textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n const specularColorTexture = specularPBR.specularColorTexture;\n if (specularColorTexture !== null && specularColorTexture !== undefined) {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n }\n }\n if (textureSetCfg.normalTextureId !== undefined ||\n textureSetCfg.occlusionTextureId !== undefined ||\n textureSetCfg.emissiveTextureId !== undefined ||\n textureSetCfg.colorTextureId !== undefined ||\n textureSetCfg.metallicRoughnessTextureId !== undefined) {\n textureSetCfg.textureSetId = `textureSet-${ctx.nextId++};`\n ctx.xktModel.createTextureSet(textureSetCfg);\n ctx.stats.numTextureSets++;\n return textureSetCfg.textureSetId;\n }\n return null;\n}\n\nfunction parseMaterialAttributes(ctx, material) { // Substitute RGBA for material, to use fast flat shading instead\n const extensions = material.extensions;\n const materialAttributes = {\n color: new Float32Array([1, 1, 1, 1]),\n opacity: 1,\n metallic: 0,\n roughness: 1\n };\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n materialAttributes.color.set(diffuseFactor);\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n materialAttributes.color.set(diffuse);\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n materialAttributes.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n materialAttributes.opacity = transparent;\n }\n }\n }\n const metallicPBR = material.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n materialAttributes.color[0] = baseColorFactor[0];\n materialAttributes.color[1] = baseColorFactor[1];\n materialAttributes.color[2] = baseColorFactor[2];\n materialAttributes.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n materialAttributes.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n materialAttributes.roughness = roughnessFactor;\n }\n }\n return materialAttributes;\n}\n\nfunction parseDefaultScene(ctx) {\n const gltfData = ctx.gltfData;\n const scene = gltfData.scene || gltfData.scenes[0];\n if (!scene) {\n ctx.error(\"glTF has no default scene\");\n return;\n }\n parseScene(ctx, scene);\n}\n\nfunction parseScene(ctx, scene) {\n const nodes = scene.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n countMeshUsage(ctx, node);\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n parseNode(ctx, node, 0, null);\n }\n}\n\nfunction countMeshUsage(ctx, node) {\n const mesh = node.mesh;\n if (mesh) {\n mesh.instances = mesh.instances ? mesh.instances + 1 : 1;\n }\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n if (!childNode) {\n ctx.error(\"Node not found: \" + i);\n continue;\n }\n countMeshUsage(ctx, childNode);\n }\n }\n}\n\nconst deferredMeshIds = [];\n\nfunction parseNode(ctx, node, depth, matrix) {\n\n const xktModel = ctx.xktModel;\n\n // Pre-order visit scene node\n\n let localMatrix;\n if (node.matrix) {\n localMatrix = node.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.translation) {\n localMatrix = math.translationMat4v(node.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.rotation) {\n localMatrix = math.quaternionToMat4(node.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.scale) {\n localMatrix = math.scalingMat4v(node.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (node.mesh) {\n\n const mesh = node.mesh;\n const numPrimitives = mesh.primitives.length;\n\n if (numPrimitives > 0) {\n for (let i = 0; i < numPrimitives; i++) {\n const primitive = mesh.primitives[i];\n if (!primitive._xktGeometryId) {\n const xktGeometryId = \"geometry-\" + ctx.nextId++;\n const geometryCfg = {\n geometryId: xktGeometryId\n };\n switch (primitive.mode) {\n case 0: // POINTS\n geometryCfg.primitiveType = \"points\";\n break;\n case 1: // LINES\n geometryCfg.primitiveType = \"lines\";\n break;\n case 2: // LINE_LOOP\n geometryCfg.primitiveType = \"line-loop\";\n break;\n case 3: // LINE_STRIP\n geometryCfg.primitiveType = \"line-strip\";\n break;\n case 4: // TRIANGLES\n geometryCfg.primitiveType = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n geometryCfg.primitiveType = \"triangle-strip\";\n break;\n case 6: // TRIANGLE_FAN\n geometryCfg.primitiveType = \"triangle-fan\";\n break;\n default:\n geometryCfg.primitiveType = \"triangles\";\n }\n const POSITION = primitive.attributes.POSITION;\n if (!POSITION) {\n continue;\n }\n geometryCfg.positions = primitive.attributes.POSITION.value;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n if (ctx.includeNormals) {\n if (primitive.attributes.NORMAL) {\n geometryCfg.normals = primitive.attributes.NORMAL.value;\n ctx.stats.numNormals += geometryCfg.normals.length / 3;\n }\n }\n if (primitive.attributes.COLOR_0) {\n geometryCfg.colorsCompressed = primitive.attributes.COLOR_0.value;\n }\n if (ctx.includeTextures) {\n if (primitive.attributes.TEXCOORD_0) {\n geometryCfg.uvs = primitive.attributes.TEXCOORD_0.value;\n ctx.stats.numUVs += geometryCfg.uvs.length / 2;\n }\n }\n if (primitive.indices) {\n geometryCfg.indices = primitive.indices.value;\n if (primitive.mode === 4) {\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n }\n xktModel.createGeometry(geometryCfg);\n primitive._xktGeometryId = xktGeometryId;\n ctx.stats.numGeometries++;\n }\n\n const xktMeshId = ctx.nextId++;\n const meshCfg = {\n meshId: xktMeshId,\n geometryId: primitive._xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4()\n };\n const material = primitive.material;\n if (material) {\n meshCfg.textureSetId = material._textureSetId;\n meshCfg.color = material._attributes.color;\n meshCfg.opacity = material._attributes.opacity;\n meshCfg.metallic = material._attributes.metallic;\n meshCfg.roughness = material._attributes.roughness;\n } else {\n meshCfg.color = [1.0, 1.0, 1.0];\n meshCfg.opacity = 1.0;\n }\n xktModel.createMesh(meshCfg);\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n\n // Visit child scene nodes\n\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n parseNode(ctx, childNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = node.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (!!xktEntityId && xktModel.entities[xktEntityId]) {\n ctx.log(`Warning: Two or more glTF nodes found with same 'name' attribute: '${nodeName} - will randomly-generating an object ID in XKT`);\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n if (ctx.metaModelCorrections) {\n // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n } else {\n // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n}\n\nexport {parseGLTFIntoXKTModel};\n","import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nconst atob2 = (typeof atob !== 'undefined') ? atob : a => Buffer.from(a, 'base64').toString('binary');\n\nconst WEBGL_COMPONENT_TYPES = {\n 5120: Int8Array,\n 5121: Uint8Array,\n 5122: Int16Array,\n 5123: Uint16Array,\n 5125: Uint32Array,\n 5126: Float32Array\n};\n\nconst WEBGL_TYPE_SIZES = {\n 'SCALAR': 1,\n 'VEC2': 2,\n 'VEC3': 3,\n 'VEC4': 4,\n 'MAT2': 4,\n 'MAT3': 9,\n 'MAT4': 16\n};\n\n/**\n * @desc Parses glTF JSON into an {@link XKTModel}, without ````.glb```` and textures.\n *\n * * Lightweight JSON-based glTF parser which ignores textures\n * * For texture and ````.glb```` support, see {@link parseGLTFIntoXKTModel}\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a glTF model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/gltf/duplex/scene.gltf\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {Object} params.data The glTF JSON.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeNormals=false] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded representation of the glTF.\n * @param {Boolean} [params.reuseGeometries=true] When true, the parser will enable geometry reuse within the XKTModel. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be if we have 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {function} [params.getAttachment] Callback through which to fetch attachments, if the glTF has them.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise}\n */\nfunction parseGLTFJSONIntoXKTModel({\n data,\n xktModel,\n metaModelData,\n includeNormals,\n reuseGeometries,\n getAttachment,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseGLTFJSONIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const ctx = {\n gltf: data,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n xktModel,\n includeNormals,\n createXKTGeometryIds: {},\n nextMeshId: 0,\n reuseGeometries: (reuseGeometries !== false),\n stats\n };\n\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n\n parseBuffers(ctx).then(() => {\n\n parseBufferViews(ctx);\n freeBuffers(ctx);\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n const metaModelCorrections = {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n return metaModelCorrections;\n}\n\nfunction parseBuffers(ctx) { // Parses geometry buffers into temporary \"_buffer\" Unit8Array properties on the glTF \"buffer\" elements\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n return Promise.all(buffers.map(buffer => parseBuffer(ctx, buffer)));\n } else {\n return new Promise(function (resolve, reject) {\n resolve();\n });\n }\n}\n\nfunction parseBuffer(ctx, bufferInfo) {\n return new Promise(function (resolve, reject) {\n // Allow a shortcut where the glTF buffer is \"enrichened\" with direct\n // access to the data-arrayBuffer, w/out needing to either:\n // - read the file indicated by the \".uri\" component of the buffer\n // - base64-decode the encoded data in the \".uri\" component\n if (bufferInfo._arrayBuffer) {\n bufferInfo._buffer = bufferInfo._arrayBuffer;\n resolve(bufferInfo);\n return;\n }\n // Otherwise, proceed with \"standard-glTF\" .uri component.\n const uri = bufferInfo.uri;\n if (!uri) {\n reject('gltf/handleBuffer missing uri in ' + JSON.stringify(bufferInfo));\n return;\n }\n parseArrayBuffer(ctx, uri).then((arrayBuffer) => {\n bufferInfo._buffer = arrayBuffer;\n resolve(arrayBuffer);\n }, (errMsg) => {\n reject(errMsg);\n })\n });\n}\n\nfunction parseArrayBuffer(ctx, uri) {\n return new Promise(function (resolve, reject) {\n const dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; // Check for data: URI\n const dataUriRegexResult = uri.match(dataUriRegex);\n if (dataUriRegexResult) { // Safari can't handle data URIs through XMLHttpRequest\n const isBase64 = !!dataUriRegexResult[2];\n let data = dataUriRegexResult[3];\n data = decodeURIComponent(data);\n if (isBase64) {\n data = atob2(data);\n }\n const buffer = new ArrayBuffer(data.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < data.length; i++) {\n view[i] = data.charCodeAt(i);\n }\n resolve(buffer);\n } else { // Uri is a path to a file\n ctx.getAttachment(uri).then(\n (arrayBuffer) => {\n resolve(arrayBuffer);\n },\n (errMsg) => {\n reject(errMsg);\n });\n }\n });\n}\n\nfunction parseBufferViews(ctx) { // Parses our temporary \"_buffer\" properties into \"_buffer\" properties on glTF \"bufferView\" elements\n const bufferViewsInfo = ctx.gltf.bufferViews;\n if (bufferViewsInfo) {\n for (let i = 0, len = bufferViewsInfo.length; i < len; i++) {\n parseBufferView(ctx, bufferViewsInfo[i]);\n }\n }\n}\n\nfunction parseBufferView(ctx, bufferViewInfo) {\n const buffer = ctx.gltf.buffers[bufferViewInfo.buffer];\n bufferViewInfo._typedArray = null;\n const byteLength = bufferViewInfo.byteLength || 0;\n const byteOffset = bufferViewInfo.byteOffset || 0;\n bufferViewInfo._buffer = buffer._buffer.slice(byteOffset, byteOffset + byteLength);\n}\n\nfunction freeBuffers(ctx) { // Deletes the \"_buffer\" properties from the glTF \"buffer\" elements, to save memory\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n for (let i = 0, len = buffers.length; i < len; i++) {\n buffers[i]._buffer = null;\n }\n }\n}\n\nfunction parseMaterials(ctx) {\n const materialsInfo = ctx.gltf.materials;\n if (materialsInfo) {\n for (let i = 0, len = materialsInfo.length; i < len; i++) {\n const materialInfo = materialsInfo[i];\n const material = parseMaterial(ctx, materialInfo);\n materialInfo._materialData = material;\n }\n }\n}\n\nfunction parseMaterial(ctx, materialInfo) { // Attempts to extract an RGBA color for a glTF material\n const material = {\n color: new Float32Array([1, 1, 1]),\n opacity: 1.0,\n metallic: 0,\n roughness: 1\n };\n const extensions = materialInfo.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n material.color[0] = diffuseFactor[0];\n material.color[1] = diffuseFactor[1];\n material.color[2] = diffuseFactor[2];\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n material.color[0] = diffuse[0];\n material.color[1] = diffuse[1];\n material.color[2] = diffuse[2];\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n material.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n material.opacity = transparent;\n }\n }\n }\n const metallicPBR = materialInfo.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n material.color[0] = baseColorFactor[0];\n material.color[1] = baseColorFactor[1];\n material.color[2] = baseColorFactor[2];\n material.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n material.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n material.roughness = roughnessFactor;\n }\n }\n return material;\n}\n\nfunction parseDefaultScene(ctx) {\n const scene = ctx.gltf.scene || 0;\n const defaultSceneInfo = ctx.gltf.scenes[scene];\n if (!defaultSceneInfo) {\n throw new Error(\"glTF has no default scene\");\n }\n parseScene(ctx, defaultSceneInfo);\n}\n\n\nfunction parseScene(ctx, sceneInfo) {\n const nodes = sceneInfo.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const glTFNode = ctx.gltf.nodes[nodes[i]];\n if (glTFNode) {\n parseNode(ctx, glTFNode, 0, null);\n }\n }\n}\n\nlet deferredMeshIds = [];\n\nfunction parseNode(ctx, glTFNode, depth, matrix) {\n\n const gltf = ctx.gltf;\n const xktModel = ctx.xktModel;\n\n let localMatrix;\n\n if (glTFNode.matrix) {\n localMatrix = glTFNode.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.translation) {\n localMatrix = math.translationMat4v(glTFNode.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.rotation) {\n localMatrix = math.quaternionToMat4(glTFNode.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.scale) {\n localMatrix = math.scalingMat4v(glTFNode.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n const gltfMeshId = glTFNode.mesh;\n\n if (gltfMeshId !== undefined) {\n\n const meshInfo = gltf.meshes[gltfMeshId];\n\n if (meshInfo) {\n\n const numPrimitivesInMesh = meshInfo.primitives.length;\n\n if (numPrimitivesInMesh > 0) {\n\n for (let i = 0; i < numPrimitivesInMesh; i++) {\n\n const primitiveInfo = meshInfo.primitives[i];\n\n const geometryHash = createPrimitiveGeometryHash(primitiveInfo);\n\n let xktGeometryId = ctx.createXKTGeometryIds[geometryHash];\n\n if ((!ctx.reuseGeometries) || !xktGeometryId) {\n\n xktGeometryId = \"geometry-\" + ctx.nextMeshId++\n\n const geometryArrays = {};\n\n parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays);\n\n const colors = geometryArrays.colors;\n\n let colorsCompressed;\n\n if (geometryArrays.colors) {\n colorsCompressed = [];\n for (let j = 0, lenj = colors.length; j < lenj; j += 4) {\n colorsCompressed.push(colors[j + 0]);\n colorsCompressed.push(colors[j + 1]);\n colorsCompressed.push(colors[j + 2]);\n colorsCompressed.push(255);\n }\n }\n\n xktModel.createGeometry({\n geometryId: xktGeometryId,\n primitiveType: geometryArrays.primitive,\n positions: geometryArrays.positions,\n normals: ctx.includeNormals ? geometryArrays.normals : null,\n colorsCompressed: colorsCompressed,\n indices: geometryArrays.indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryArrays.positions ? geometryArrays.positions.length / 3 : 0;\n ctx.stats.numNormals += (ctx.includeNormals && geometryArrays.normals) ? geometryArrays.normals.length / 3 : 0;\n ctx.stats.numTriangles += geometryArrays.indices ? geometryArrays.indices.length / 3 : 0;\n\n ctx.createXKTGeometryIds[geometryHash] = xktGeometryId;\n } else {\n// Geometry reused\n }\n\n const materialIndex = primitiveInfo.material;\n const materialInfo = (materialIndex !== null && materialIndex !== undefined) ? gltf.materials[materialIndex] : null;\n const color = materialInfo ? materialInfo._materialData.color : new Float32Array([1.0, 1.0, 1.0, 1.0]);\n const opacity = materialInfo ? materialInfo._materialData.opacity : 1.0;\n const metallic = materialInfo ? materialInfo._materialData.metallic : 0.0;\n const roughness = materialInfo ? materialInfo._materialData.roughness : 1.0;\n\n const xktMeshId = \"mesh-\" + ctx.nextMeshId++;\n\n xktModel.createMesh({\n meshId: xktMeshId,\n geometryId: xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4(),\n color: color,\n opacity: opacity,\n metallic: metallic,\n roughness: roughness\n });\n\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n }\n\n\n if (glTFNode.children) {\n const children = glTFNode.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNodeIdx = children[i];\n const childGLTFNode = gltf.nodes[childNodeIdx];\n if (!childGLTFNode) {\n console.warn('Node not found: ' + i);\n continue;\n }\n parseNode(ctx, childGLTFNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = glTFNode.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`[parseGLTFJSONIntoXKTModel] Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (xktEntityId === undefined || xktEntityId === null) {\n if (xktModel.entities[xktEntityId]) {\n ctx.error(\"Two or more glTF nodes found with same 'name' attribute: '\" + nodeName + \"'\");\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n }\n if (ctx.metaModelCorrections) { // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n } else { // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n}\n\nfunction createPrimitiveGeometryHash(primitiveInfo) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return \"empty\";\n }\n const mode = primitiveInfo.mode;\n const material = primitiveInfo.material;\n const indices = primitiveInfo.indices;\n const positions = primitiveInfo.attributes.POSITION;\n const normals = primitiveInfo.attributes.NORMAL;\n const colors = primitiveInfo.attributes.COLOR_0;\n const uv = primitiveInfo.attributes.TEXCOORD_0;\n return [\n mode,\n // material,\n (indices !== null && indices !== undefined) ? indices : \"-\",\n (positions !== null && positions !== undefined) ? positions : \"-\",\n (normals !== null && normals !== undefined) ? normals : \"-\",\n (colors !== null && colors !== undefined) ? colors : \"-\",\n (uv !== null && uv !== undefined) ? uv : \"-\"\n ].join(\";\");\n}\n\nfunction parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return;\n }\n switch (primitiveInfo.mode) {\n case 0: // POINTS\n geometryArrays.primitive = \"points\";\n break;\n case 1: // LINES\n geometryArrays.primitive = \"lines\";\n break;\n case 2: // LINE_LOOP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 3: // LINE_STRIP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 4: // TRIANGLES\n geometryArrays.primitive = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n // TODO: convert\n console.log(\"TRIANGLE_STRIP\");\n geometryArrays.primitive = \"triangles\";\n break;\n case 6: // TRIANGLE_FAN\n // TODO: convert\n console.log(\"TRIANGLE_FAN\");\n geometryArrays.primitive = \"triangles\";\n break;\n default:\n geometryArrays.primitive = \"triangles\";\n }\n const accessors = ctx.gltf.accessors;\n const indicesIndex = primitiveInfo.indices;\n if (indicesIndex !== null && indicesIndex !== undefined) {\n const accessorInfo = accessors[indicesIndex];\n geometryArrays.indices = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const positionsIndex = attributes.POSITION;\n if (positionsIndex !== null && positionsIndex !== undefined) {\n const accessorInfo = accessors[positionsIndex];\n geometryArrays.positions = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const normalsIndex = attributes.NORMAL;\n if (normalsIndex !== null && normalsIndex !== undefined) {\n const accessorInfo = accessors[normalsIndex];\n geometryArrays.normals = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const colorsIndex = attributes.COLOR_0;\n if (colorsIndex !== null && colorsIndex !== undefined) {\n const accessorInfo = accessors[colorsIndex];\n geometryArrays.colors = parseAccessorTypedArray(ctx, accessorInfo);\n }\n}\n\nfunction parseAccessorTypedArray(ctx, accessorInfo) {\n const bufferView = ctx.gltf.bufferViews[accessorInfo.bufferView];\n const itemSize = WEBGL_TYPE_SIZES[accessorInfo.type];\n const TypedArray = WEBGL_COMPONENT_TYPES[accessorInfo.componentType];\n const elementBytes = TypedArray.BYTES_PER_ELEMENT; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n const itemBytes = elementBytes * itemSize;\n if (accessorInfo.byteStride && accessorInfo.byteStride !== itemBytes) { // The buffer is not interleaved if the stride is the item size in bytes.\n throw new Error(\"interleaved buffer!\"); // TODO\n } else {\n return new TypedArray(bufferView._buffer, accessorInfo.byteOffset || 0, accessorInfo.count * itemSize);\n }\n}\n\nexport {parseGLTFJSONIntoXKTModel};\n","/**\n * @desc Parses IFC STEP file data into an {@link XKTModel}.\n *\n * This function uses [web-ifc](https://github.com/tomvandig/web-ifc) to parse the IFC, which relies on a\n * WASM file to do the parsing.\n *\n * Depending on how we use this function, we may need to provide it with a path to the directory where that WASM file is stored.\n *\n * This function is tested with web-ifc version 0.0.34.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an IFC model into it.\n *\n * ````javascript\n * import {XKTModel, parseIFCIntoXKTModel, writeXKTModelToArrayBuffer} from \"xeokit-convert.es.js\";\n *\n * import * as WebIFC from \"web-ifc-api.js\";\n *\n * utils.loadArraybuffer(\"rac_advanced_sample_project.ifc\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseIFCIntoXKTModel({\n * WebIFC,\n * data,\n * xktModel,\n * wasmPath: \"../dist/\",\n * autoNormals: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {ArrayBuffer} [params.data] IFC file data.\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Boolean} [params.autoNormals=true] When true, the parser will ignore the IFC geometry normals, and the IFC\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the IFC model. This is ````true```` by default, because IFC models tend to look acceptable with flat-shading,\n * and we always want to minimize IFC model size wherever possible.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {String} params.wasmPath Path to ````web-ifc.wasm````, required by this function.\n * @param {Object} [params.stats={}] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when IFC has been parsed.\n */\nfunction parseIFCIntoXKTModel({\n WebIFC,\n data,\n xktModel,\n autoNormals = true,\n includeTypes,\n excludeTypes,\n wasmPath,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseIFCIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n if (!wasmPath) {\n reject(\"Argument expected: wasmPath\");\n return;\n }\n\n const ifcAPI = new WebIFC.IfcAPI();\n\n if (wasmPath) {\n ifcAPI.SetWasmPath(wasmPath);\n }\n\n ifcAPI.Init().then(() => {\n\n const dataArray = new Uint8Array(data);\n\n const modelID = ifcAPI.OpenModel(dataArray);\n\n stats.sourceFormat = \"IFC\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n\n const ctx = {\n WebIFC,\n modelID,\n ifcAPI,\n xktModel,\n autoNormals,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n if (includeTypes) {\n ctx.includeTypes = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n ctx.includeTypes[includeTypes[i]] = true;\n }\n }\n\n if (excludeTypes) {\n ctx.excludeTypes = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n ctx.excludeTypes[excludeTypes[i]] = true;\n }\n }\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(modelID, WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(modelID, ifcProjectId);\n\n ctx.xktModel.schema = \"\";\n ctx.xktModel.modelId = \"\" + modelID;\n ctx.xktModel.projectId = \"\" + ifcProjectId;\n\n parseMetadata(ctx);\n parseGeometry(ctx);\n parsePropertySets(ctx);\n\n resolve();\n\n }).catch((e) => {\n\n reject(e);\n })\n });\n}\n\nfunction parsePropertySets(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCRELDEFINESBYPROPERTIES);\n\n for (let i = 0; i < lines.size(); i++) {\n\n let relID = lines.get(i);\n\n let rel = ctx.ifcAPI.GetLine(ctx.modelID, relID, true);\n\n if (rel) {\n\n const relatingPropertyDefinition = rel.RelatingPropertyDefinition;\n if (!relatingPropertyDefinition) {\n continue;\n }\n\n const propertySetId = relatingPropertyDefinition.GlobalId.value;\n\n const relatedObjects = rel.RelatedObjects;\n if (relatedObjects) {\n for (let i = 0, len = relatedObjects.length; i < len; i++) {\n const relatedObject = relatedObjects[i];\n const metaObjectId = relatedObject.GlobalId.value;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n if (metaObject) {\n if (!metaObject.propertySetIds) {\n metaObject.propertySetIds = [];\n }\n metaObject.propertySetIds.push(propertySetId);\n }\n }\n }\n\n const props = relatingPropertyDefinition.HasProperties;\n if (props && props.length > 0) {\n const propertySetType = \"Default\";\n const propertySetName = relatingPropertyDefinition.Name.value;\n const properties = [];\n for (let i = 0, len = props.length; i < len; i++) {\n const prop = props[i];\n const name = prop.Name;\n const nominalValue = prop.NominalValue;\n if (name && nominalValue) {\n const property = {\n name: name.value,\n type: nominalValue.type,\n value: nominalValue.value,\n valueType: nominalValue.valueType\n };\n if (prop.Description) {\n property.description = prop.Description.value;\n } else if (nominalValue.description) {\n property.description = nominalValue.description;\n }\n properties.push(property);\n }\n }\n ctx.xktModel.createPropertySet({propertySetId, propertySetType, propertySetName, properties});\n ctx.stats.numPropertySets++;\n }\n }\n }\n}\n\nfunction parseMetadata(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(ctx.modelID, ifcProjectId);\n\n parseSpatialChildren(ctx, ifcProject);\n}\n\nfunction parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectType = ifcElement.__proto__.constructor.name;\n\n if (ctx.includeTypes && (!ctx.includeTypes[metaObjectType])) {\n return;\n }\n\n if (ctx.excludeTypes && ctx.excludeTypes[metaObjectType]) {\n return;\n }\n\n createMetaObject(ctx, ifcElement, parentMetaObjectId);\n\n const metaObjectId = ifcElement.GlobalId.value;\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingObject',\n 'RelatedObjects',\n ctx.WebIFC.IFCRELAGGREGATES,\n metaObjectId);\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingStructure',\n 'RelatedElements',\n ctx.WebIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,\n metaObjectId);\n}\n\nfunction createMetaObject(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectId = ifcElement.GlobalId.value;\n const propertySetIds = null;\n const metaObjectType = ifcElement.__proto__.constructor.name;\n const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== \"\") ? ifcElement.Name.value : metaObjectType;\n\n ctx.xktModel.createMetaObject({metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId});\n ctx.stats.numMetaObjects++;\n}\n\nfunction parseRelatedItemsOfType(ctx, id, relation, related, type, parentMetaObjectId) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, type);\n\n for (let i = 0; i < lines.size(); i++) {\n\n const relID = lines.get(i);\n const rel = ctx.ifcAPI.GetLine(ctx.modelID, relID);\n const relatedItems = rel[relation];\n\n let foundElement = false;\n\n if (Array.isArray(relatedItems)) {\n const values = relatedItems.map((item) => item.value);\n foundElement = values.includes(id);\n\n } else {\n foundElement = (relatedItems.value === id);\n }\n\n if (foundElement) {\n\n const element = rel[related];\n\n if (!Array.isArray(element)) {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n\n } else {\n\n element.forEach((element2) => {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element2.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n });\n }\n }\n }\n}\n\nfunction parseGeometry(ctx) {\n\n // Parses the geometry and materials in the IFC, creates\n // XKTEntity, XKTMesh and XKTGeometry components within the XKTModel.\n\n const flatMeshes = ctx.ifcAPI.LoadAllGeometry(ctx.modelID);\n\n for (let i = 0, len = flatMeshes.size(); i < len; i++) {\n const flatMesh = flatMeshes.get(i);\n createObject(ctx, flatMesh);\n }\n\n // LoadAllGeometry does not return IFCSpace meshes\n // here is a workaround\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCSPACE);\n for (let j = 0, len = lines.size(); j < len; j++) {\n const ifcSpaceId = lines.get(j);\n const flatMesh = ctx.ifcAPI.GetFlatMesh(ctx.modelID, ifcSpaceId);\n createObject(ctx, flatMesh);\n }\n}\n\nfunction createObject(ctx, flatMesh) {\n\n const flatMeshExpressID = flatMesh.expressID;\n const placedGeometries = flatMesh.geometries;\n\n const meshIds = [];\n\n const properties = ctx.ifcAPI.GetLine(ctx.modelID, flatMeshExpressID);\n const entityId = properties.GlobalId.value;\n\n const metaObjectId = entityId;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n\n if (ctx.includeTypes && (!metaObject || (!ctx.includeTypes[metaObject.metaObjectType]))) {\n return;\n }\n\n if (ctx.excludeTypes && (!metaObject || ctx.excludeTypes[metaObject.metaObjectType])) {\n console.log(\"excluding: \" + metaObjectId)\n return;\n }\n\n for (let j = 0, lenj = placedGeometries.size(); j < lenj; j++) {\n\n const placedGeometry = placedGeometries.get(j);\n const geometryId = \"\" + placedGeometry.geometryExpressID;\n\n if (!ctx.xktModel.geometries[geometryId]) {\n\n const geometry = ctx.ifcAPI.GetGeometry(ctx.modelID, placedGeometry.geometryExpressID);\n const vertexData = ctx.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());\n const indices = ctx.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());\n\n // De-interleave vertex arrays\n\n const positions = [];\n const normals = [];\n\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n positions.push(vertexData[k * 6 + 0]);\n positions.push(vertexData[k * 6 + 1]);\n positions.push(vertexData[k * 6 + 2]);\n }\n\n if (!ctx.autoNormals) {\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n normals.push(vertexData[k * 6 + 3]);\n normals.push(vertexData[k * 6 + 4]);\n normals.push(vertexData[k * 6 + 5]);\n }\n }\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: ctx.autoNormals ? null : normals,\n indices: indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += (positions.length / 3);\n ctx.stats.numTriangles += (indices.length / 3);\n }\n\n const meshId = (\"mesh\" + ctx.nextId++);\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n matrix: placedGeometry.flatTransformation,\n color: [placedGeometry.color.x, placedGeometry.color.y, placedGeometry.color.z],\n opacity: placedGeometry.color.w\n });\n\n meshIds.push(meshId);\n }\n\n if (meshIds.length > 0) {\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: meshIds\n });\n ctx.stats.numObjects++;\n }\n}\n\nexport {parseIFCIntoXKTModel};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/las\");","import {parse} from '@loaders.gl/core';\nimport {LASLoader} from '@loaders.gl/las';\n\nimport {math} from \"../lib/math.js\";\n\nconst MAX_VERTICES = 500000; // TODO: Rough estimate\n\n/**\n * @desc Parses LAS and LAZ point cloud data into an {@link XKTModel}.\n *\n * This parser handles both the LASER file format (LAS) and its compressed version (LAZ),\n * a public format for the interchange of 3-dimensional point cloud data data, developed\n * for LIDAR mapping purposes.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/laz/autzen.laz\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parseLASIntoXKTModel({\n * data,\n * xktModel,\n * rotateX: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data LAS/LAZ file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the LAS point positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform point positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Number|String} [params.colorDepth=8] Whether colors encoded using 8 or 16 bits. Can be set to 'auto'. LAS specification recommends 16 bits.\n * @param {Boolean} [params.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.\n * @param {Number} [params.skip=1] Read one from every n points.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when LAS has been parsed.\n */\nfunction parseLASIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n colorDepth = \"auto\",\n fp64 = false,\n skip = 1,\n stats,\n log = () => {\n }\n }) {\n\n if (log) {\n log(\"Using parser: parseLASIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n log(\"Converting LAZ/LAS\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n log(`colorDepth: ${colorDepth}`);\n log(`fp64: ${fp64}`);\n log(`skip: ${skip}`);\n\n parse(data, LASLoader, {\n las: {\n colorDepth,\n fp64\n }\n }).then((parsedData) => {\n\n const attributes = parsedData.attributes;\n\n const loaderData = parsedData.loaderData;\n const pointsFormatId = loaderData.pointsFormatId !== undefined ? loaderData.pointsFormatId : -1;\n\n if (!attributes.POSITION) {\n log(\"No positions found in file (expected for all LAS point formats)\");\n return;\n }\n\n let readAttributes = {};\n\n switch (pointsFormatId) {\n case 0:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 0)\");\n return;\n }\n\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 1:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 1)\");\n return;\n }\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 2:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 2)\");\n return;\n }\n\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n case 3:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 3)\");\n return;\n }\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n }\n\n const pointsChunks = chunkArray(readPositions(readAttributes.positions), MAX_VERTICES * 3);\n const colorsChunks = chunkArray(readAttributes.colors, MAX_VERTICES * 4);\n\n const meshIds = [];\n\n for (let j = 0, lenj = pointsChunks.length; j < lenj; j++) {\n\n const geometryId = `geometry-${j}`;\n const meshId = `mesh-${j}`;\n\n meshIds.push(meshId);\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"points\",\n positions: pointsChunks[j],\n colorsCompressed: colorsChunks[j]\n });\n\n xktModel.createMesh({\n meshId,\n geometryId\n });\n }\n\n const entityId = math.createUUID();\n\n xktModel.createEntity({\n entityId,\n meshIds\n });\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"PointCloud\",\n metaObjectName: \"PointCloud (LAZ)\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n if (stats) {\n stats.sourceFormat = \"LAS\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = readAttributes.positions.length / 3;\n }\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n\n function readPositions(positionsValue) {\n if (positionsValue) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = positionsValue.length;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n centerPos[0] += positionsValue[i + 0];\n centerPos[1] += positionsValue[i + 1];\n centerPos[2] += positionsValue[i + 2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n positionsValue[i + 0] -= centerPos[0];\n positionsValue[i + 1] -= centerPos[1];\n positionsValue[i + 2] -= centerPos[2];\n }\n }\n if (transform) {\n const mat = math.mat4(transform);\n const pos = math.vec3();\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n pos[0] = positionsValue[i + 0];\n pos[1] = positionsValue[i + 1];\n pos[2] = positionsValue[i + 2];\n math.transformPoint3(mat, pos, pos);\n positionsValue[i + 0] = pos[0];\n positionsValue[i + 1] = pos[1];\n positionsValue[i + 2] = pos[2];\n }\n }\n }\n return positionsValue;\n }\n\n function readColorsAndIntensities(attributesPosition, attributesColor, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const colors = attributesColor.value;\n const colorSize = attributesColor.size;\n const intensities = attributesIntensity.value;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n=0,len = intensities.length; i < len; i++, k += colorSize, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = colors[k + 0];\n colorsCompressed[m++] = colors[k + 1];\n colorsCompressed[m++] = colors[k + 2];\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function readIntensities(attributesPosition, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const intensities = attributesIntensity.intensity;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, len = intensities.length; i < len; i++, k += 3, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function chunkArray(array, chunkSize) {\n if (chunkSize >= array.length) {\n return [array]; // One chunk\n }\n let result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n }\n\n}\n\nexport {parseLASIntoXKTModel};","/**\n * @desc Parses JSON metamodel into an {@link XKTModel}.\n *\n * @param {Object} params Parsing parameters.\n * @param {JSON} params.metaModelData Metamodel data.\n * @param {String[]} [params.excludeTypes] Types to exclude from parsing.\n * @param {String[]} [params.includeTypes] Types to include in parsing.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when JSON has been parsed.\n */\nfunction parseMetaModelIntoXKTModel({metaModelData, xktModel, includeTypes, excludeTypes, log}) {\n\n if (log) {\n log(\"Using parser: parseMetaModelIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n const metaObjects = metaModelData.metaObjects || [];\n const propertySets = metaModelData.propertySets || [];\n\n xktModel.modelId = metaModelData.revisionId || \"\"; // HACK\n xktModel.projectId = metaModelData.projectId || \"\";\n xktModel.revisionId = metaModelData.revisionId || \"\";\n xktModel.author = metaModelData.author || \"\";\n xktModel.createdAt = metaModelData.createdAt || \"\";\n xktModel.creatingApplication = metaModelData.creatingApplication || \"\";\n xktModel.schema = metaModelData.schema || \"\";\n\n for (let i = 0, len = propertySets.length; i < len; i++) {\n\n const propertySet = propertySets[i];\n\n xktModel.createPropertySet({\n propertySetId: propertySet.id,\n propertySetName: propertySet.name,\n propertySetType: propertySet.type,\n properties: propertySet.properties\n });\n }\n\n let includeTypesMap;\n if (includeTypes) {\n includeTypesMap = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n includeTypesMap[includeTypes[i]] = true;\n }\n }\n\n let excludeTypesMap;\n if (excludeTypes) {\n excludeTypesMap = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n excludeTypesMap[excludeTypes[i]] = true;\n }\n }\n\n const metaObjectsMap = {};\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const newObject = metaObjects[i];\n metaObjectsMap[newObject.id] = newObject;\n }\n\n let countMetaObjects = 0;\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n\n const metaObject = metaObjects[i];\n const type = metaObject.type;\n\n if (excludeTypesMap && excludeTypesMap[type]) {\n continue;\n }\n\n if (includeTypesMap && !includeTypesMap[type]) {\n continue;\n }\n\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) { // Don't create redundant sub-objects\n continue\n }\n }\n\n const propertySetIds = [];\n if (metaObject.propertySetIds) {\n for (let j = 0, lenj = metaObject.propertySetIds.length; j < lenj; j++) {\n const propertySetId = metaObject.propertySetIds[j];\n if (propertySetId !== undefined && propertySetId !== null && propertySetId !== \"\") {\n propertySetIds.push(propertySetId);\n }\n }\n }\n if (metaObject.propertySetId !== undefined && metaObject.propertySetId !== null && metaObject.propertySetId !== \"\") {\n propertySetIds.push(metaObject.propertySetId);\n }\n\n xktModel.createMetaObject({\n metaObjectId: metaObject.id,\n metaObjectType: metaObject.type,\n metaObjectName: metaObject.name,\n parentMetaObjectId: metaObject.parent,\n propertySetIds: propertySetIds.length > 0 ? propertySetIds : null\n });\n\n countMetaObjects++;\n }\n\n if (log) {\n log(\"Converted meta objects: \" + countMetaObjects);\n }\n\n resolve();\n });\n}\n\nexport {parseMetaModelIntoXKTModel};\n","/**\n * @desc Parses PCD point cloud data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"\"./models/pcd/ism_test_cat.pcd\"\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parsePCDIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PCD file data.\n * @param {Boolean} [params.littleEndian=true] Whether PCD binary data is Little-Endian or Big-Endian.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PCD has been parsed.\n */\nfunction parsePCDIntoXKTModel({data, xktModel, littleEndian = true, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePCDIntoXKTModel\");\n }\n\n return new Promise(function(resolve, reject) {\n\n const textData = decodeText(new Uint8Array(data));\n\n const header = parseHeader(textData);\n\n const positions = [];\n const normals = [];\n const colors = [];\n\n if (header.data === 'ascii') {\n\n const offset = header.offset;\n const data = textData.substr(header.headerLen);\n const lines = data.split('\\n');\n\n for (let i = 0, l = lines.length; i < l; i++) {\n\n if (lines[i] === '') {\n continue;\n }\n\n const line = lines[i].split(' ');\n\n if (offset.x !== undefined) {\n positions.push(parseFloat(line[offset.x]));\n positions.push(parseFloat(line[offset.y]));\n positions.push(parseFloat(line[offset.z]));\n }\n\n if (offset.rgb !== undefined) {\n const rgb = parseFloat(line[offset.rgb]);\n const r = (rgb >> 16) & 0x0000ff;\n const g = (rgb >> 8) & 0x0000ff;\n const b = (rgb >> 0) & 0x0000ff;\n colors.push(r, g, b, 255);\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n if (header.data === 'binary_compressed') {\n\n const sizes = new Uint32Array(data.slice(header.headerLen, header.headerLen + 8));\n const compressedSize = sizes[0];\n const decompressedSize = sizes[1];\n const decompressed = decompressLZF(new Uint8Array(data, header.headerLen + 8, compressedSize), decompressedSize);\n const dataview = new DataView(decompressed.buffer);\n const offset = header.offset;\n\n for (let i = 0; i < header.points; i++) {\n\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32((header.points * offset.x) + header.size[0] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.y) + header.size[1] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.z) + header.size[2] * i, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 0));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 1));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 2));\n // colors.push(255);\n } else {\n colors.push(1);\n colors.push(1);\n colors.push(1);\n }\n }\n }\n\n if (header.data === 'binary') {\n\n const dataview = new DataView(data, header.headerLen);\n const offset = header.offset;\n\n for (let i = 0, row = 0; i < header.points; i++, row += header.rowSize) {\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32(row + offset.x, littleEndian));\n positions.push(dataview.getFloat32(row + offset.y, littleEndian));\n positions.push(dataview.getFloat32(row + offset.z, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8(row + offset.rgb + 2));\n colors.push(dataview.getUint8(row + offset.rgb + 1));\n colors.push(dataview.getUint8(row + offset.rgb + 0));\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n xktModel.createGeometry({\n geometryId: \"pointsGeometry\",\n primitiveType: \"points\",\n positions: positions,\n colors: colors && colors.length > 0 ? colors : null\n });\n\n xktModel.createMesh({\n meshId: \"pointsMesh\",\n geometryId: \"pointsGeometry\"\n });\n\n xktModel.createEntity({\n entityId: \"geometries\",\n meshIds: [\"pointsMesh\"]\n });\n\n if (log) {\n log(\"Converted drawable objects: 1\");\n log(\"Converted geometries: 1\");\n log(\"Converted vertices: \" + positions.length / 3);\n }\n\n if (stats) {\n stats.sourceFormat = \"PCD\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = positions.length / 3;\n }\n\n resolve();\n });\n}\n\nfunction parseHeader(data) {\n const header = {};\n const result1 = data.search(/[\\r\\n]DATA\\s(\\S*)\\s/i);\n const result2 = /[\\r\\n]DATA\\s(\\S*)\\s/i.exec(data.substr(result1 - 1));\n header.data = result2[1];\n header.headerLen = result2[0].length + result1;\n header.str = data.substr(0, header.headerLen);\n header.str = header.str.replace(/\\#.*/gi, ''); // Strip comments\n header.version = /VERSION (.*)/i.exec(header.str); // Parse\n header.fields = /FIELDS (.*)/i.exec(header.str);\n header.size = /SIZE (.*)/i.exec(header.str);\n header.type = /TYPE (.*)/i.exec(header.str);\n header.count = /COUNT (.*)/i.exec(header.str);\n header.width = /WIDTH (.*)/i.exec(header.str);\n header.height = /HEIGHT (.*)/i.exec(header.str);\n header.viewpoint = /VIEWPOINT (.*)/i.exec(header.str);\n header.points = /POINTS (.*)/i.exec(header.str);\n if (header.version !== null) {\n header.version = parseFloat(header.version[1]);\n }\n if (header.fields !== null) {\n header.fields = header.fields[1].split(' ');\n }\n if (header.type !== null) {\n header.type = header.type[1].split(' ');\n }\n if (header.width !== null) {\n header.width = parseInt(header.width[1]);\n }\n if (header.height !== null) {\n header.height = parseInt(header.height[1]);\n }\n if (header.viewpoint !== null) {\n header.viewpoint = header.viewpoint[1];\n }\n if (header.points !== null) {\n header.points = parseInt(header.points[1], 10);\n }\n if (header.points === null) {\n header.points = header.width * header.height;\n }\n if (header.size !== null) {\n header.size = header.size[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (header.count !== null) {\n header.count = header.count[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n } else {\n header.count = [];\n for (let i = 0, l = header.fields.length; i < l; i++) {\n header.count.push(1);\n }\n }\n header.offset = {};\n let sizeSum = 0;\n for (let i = 0, l = header.fields.length; i < l; i++) {\n if (header.data === 'ascii') {\n header.offset[header.fields[i]] = i;\n } else {\n header.offset[header.fields[i]] = sizeSum;\n sizeSum += header.size[i] * header.count[i];\n }\n }\n header.rowSize = sizeSum; // For binary only\n return header;\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]);\n }\n try {\n return decodeURIComponent(escape(s));\n } catch (e) {\n return s;\n }\n}\n\nfunction decompressLZF(inData, outLength) { // https://gitlab.com/taketwo/three-pcd-loader/blob/master/decompress-lzf.js\n const inLength = inData.length;\n const outData = new Uint8Array(outLength);\n let inPtr = 0;\n let outPtr = 0;\n let ctrl;\n let len;\n let ref;\n do {\n ctrl = inData[inPtr++];\n if (ctrl < (1 << 5)) {\n ctrl++;\n if (outPtr + ctrl > outLength) throw new Error('Output buffer is not large enough');\n if (inPtr + ctrl > inLength) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = inData[inPtr++];\n } while (--ctrl);\n } else {\n len = ctrl >> 5;\n ref = outPtr - ((ctrl & 0x1f) << 8) - 1;\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n if (len === 7) {\n len += inData[inPtr++];\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n }\n ref -= inData[inPtr++];\n if (outPtr + len + 2 > outLength) throw new Error('Output buffer is not large enough');\n if (ref < 0) throw new Error('Invalid compressed data');\n if (ref >= outPtr) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = outData[ref++];\n } while (--len + 2);\n }\n } while (inPtr < inLength);\n return outData;\n}\n\nexport {parsePCDIntoXKTModel};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@loaders.gl/ply\");","import {parse} from '@loaders.gl/core';\nimport {PLYLoader} from '@loaders.gl/ply';\n\n/**\n * @desc Parses PLY file data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a PLY model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/ply/test.ply\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parsePLYIntoXKTModel({data, xktModel}).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PLY file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PLY has been parsed.\n */\nasync function parsePLYIntoXKTModel({data, xktModel, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePLYIntoXKTModel\");\n }\n\n if (!data) {\n throw \"Argument expected: data\";\n }\n\n if (!xktModel) {\n throw \"Argument expected: xktModel\";\n }\n\n let parsedData;\n try {\n parsedData = await parse(data, PLYLoader);\n } catch (e) {\n if (log) {\n log(\"Error: \" + e);\n }\n return;\n }\n\n const attributes = parsedData.attributes;\n const hasColors = !!attributes.COLOR_0;\n\n if (hasColors) {\n const colorsValue = hasColors ? attributes.COLOR_0.value : null;\n const colorsCompressed = [];\n for (let i = 0, len = colorsValue.length; i < len; i += 4) {\n colorsCompressed.push(colorsValue[i]);\n colorsCompressed.push(colorsValue[i + 1]);\n colorsCompressed.push(colorsValue[i + 2]);\n }\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : [],\n colorsCompressed: colorsCompressed\n });\n } else {\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : []\n });\n }\n\n xktModel.createMesh({\n meshId: \"plyMesh\",\n geometryId: \"plyGeometry\",\n color: (!hasColors) ? [1, 1, 1] : null\n });\n\n xktModel.createEntity({\n entityId: \"ply\",\n meshIds: [\"plyMesh\"]\n });\n\n if (stats) {\n stats.sourceFormat = \"PLY\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = attributes.POSITION.value.length / 3;\n }\n}\n\nexport {parsePLYIntoXKTModel};\n","import {faceToVertexNormals} from \"../lib/faceToVertexNormals.js\";\nimport {math} from \"../lib/math.js\";\n\n/**\n * @desc Parses STL file data into an {@link XKTModel}.\n *\n * * Supports binary and ASCII STL formats.\n * * Option to create a separate {@link XKTEntity} for each group of faces that share the same vertex colors.\n * * Option to smooth face-aligned normals loaded from STL.\n * * Option to reduce XKT file size by ignoring STL normals and relying on xeokit to auto-generate them.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an STL model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/stl/binary/spurGear.stl\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseSTLIntoXKTModel({data, xktModel});\n *\n * xktModel.finalize();\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer|String} [params.data] STL file data. Can be binary or string.\n * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the STL geometry normals, and the STL\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the STL.\n * Overrides ````smoothNormals```` when ````true````. This ignores the normals in the STL, and loads no\n * normals from the STL into the {@link XKTModel}, resulting in the XKT file storing no normals for the STL model. The\n * xeokit-sdk will then automatically generate the normals within its shaders. The disadvantages are that auto-normals\n * may slow rendering down a little bit, and that the normals can only be face-aligned (and thus rendered using flat\n * shading). The advantages, however, are a smaller XKT file size, and the ability to apply certain geometry optimizations\n * during parsing, such as removing duplicated STL vertex positions, that are not possible when normals are loaded\n * for the STL vertices.\n * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented STL normals to vertex normals, for a smooth appearance. Ignored if ````autoNormals```` is ````true````.\n * @param {Number} [params.smoothNormalsAngleThreshold=20] This is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.\n * @param {Boolean} [params.splitMeshes=true] When true, creates a separate {@link XKTEntity} for each group of faces that share the same vertex colors. Only works with binary STL (ie. when ````data```` is an ArrayBuffer).\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when STL has been parsed.\n */\nasync function parseSTLIntoXKTModel({\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n stats,\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseSTLIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n const rootMetaObjectId = math.createUUID();\n\n const rootMetaObject = xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n const ctx = {\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n rootMetaObject,\n nextId: 0,\n log: (log || function (msg) {\n }),\n stats: {\n numObjects: 0,\n numGeometries: 0,\n numTriangles: 0,\n numVertices: 0\n }\n };\n\n const binData = ensureBinary(data);\n\n if (isBinary(binData)) {\n parseBinary(ctx, binData);\n } else {\n parseASCII(ctx, ensureString(data));\n }\n\n if (stats) {\n stats.sourceFormat = \"STL\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numTriangles = ctx.stats.numTriangles;\n stats.numVertices = ctx.stats.numVertices;\n }\n\n resolve();\n });\n}\n\nfunction isBinary(data) {\n const reader = new DataView(data);\n const numFaces = reader.getUint32(80, true);\n const faceSize = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);\n const numExpectedBytes = 80 + (32 / 8) + (numFaces * faceSize);\n if (numExpectedBytes === reader.byteLength) {\n return true;\n }\n const solid = [115, 111, 108, 105, 100];\n for (let i = 0; i < 5; i++) {\n if (solid[i] !== reader.getUint8(i, false)) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseBinary(ctx, data) {\n const reader = new DataView(data);\n const faces = reader.getUint32(80, true);\n let r;\n let g;\n let b;\n let hasColors = false;\n let colors;\n let defaultR;\n let defaultG;\n let defaultB;\n let lastR = null;\n let lastG = null;\n let lastB = null;\n let newMesh = false;\n let alpha;\n for (let index = 0; index < 80 - 10; index++) {\n if ((reader.getUint32(index, false) === 0x434F4C4F /*COLO*/) &&\n (reader.getUint8(index + 4) === 0x52 /*'R'*/) &&\n (reader.getUint8(index + 5) === 0x3D /*'='*/)) {\n hasColors = true;\n colors = [];\n defaultR = reader.getUint8(index + 6) / 255;\n defaultG = reader.getUint8(index + 7) / 255;\n defaultB = reader.getUint8(index + 8) / 255;\n alpha = reader.getUint8(index + 9) / 255;\n }\n }\n let dataOffset = 84;\n let faceLength = 12 * 4 + 2;\n let positions = [];\n let normals = [];\n let splitMeshes = ctx.splitMeshes;\n for (let face = 0; face < faces; face++) {\n let start = dataOffset + face * faceLength;\n let normalX = reader.getFloat32(start, true);\n let normalY = reader.getFloat32(start + 4, true);\n let normalZ = reader.getFloat32(start + 8, true);\n if (hasColors) {\n let packedColor = reader.getUint16(start + 48, true);\n if ((packedColor & 0x8000) === 0) {\n r = (packedColor & 0x1F) / 31;\n g = ((packedColor >> 5) & 0x1F) / 31;\n b = ((packedColor >> 10) & 0x1F) / 31;\n } else {\n r = defaultR;\n g = defaultG;\n b = defaultB;\n }\n if (splitMeshes && r !== lastR || g !== lastG || b !== lastB) {\n if (lastR !== null) {\n newMesh = true;\n }\n lastR = r;\n lastG = g;\n lastB = b;\n }\n }\n for (let i = 1; i <= 3; i++) {\n let vertexstart = start + i * 12;\n positions.push(reader.getFloat32(vertexstart, true));\n positions.push(reader.getFloat32(vertexstart + 4, true));\n positions.push(reader.getFloat32(vertexstart + 8, true));\n if (!ctx.autoNormals) {\n normals.push(normalX, normalY, normalZ);\n }\n if (hasColors) {\n colors.push(r, g, b, 1); // TODO: handle alpha\n }\n }\n if (splitMeshes && newMesh) {\n addMesh(ctx, positions, normals, colors);\n positions = [];\n normals = [];\n colors = colors ? [] : null;\n newMesh = false;\n }\n }\n if (positions.length > 0) {\n addMesh(ctx, positions, normals, colors);\n }\n}\n\nfunction parseASCII(ctx, data) {\n const faceRegex = /facet([\\s\\S]*?)endfacet/g;\n let faceCounter = 0;\n const floatRegex = /[\\s]+([+-]?(?:\\d+.\\d+|\\d+.|\\d+|.\\d+)(?:[eE][+-]?\\d+)?)/.source;\n const vertexRegex = new RegExp('vertex' + floatRegex + floatRegex + floatRegex, 'g');\n const normalRegex = new RegExp('normal' + floatRegex + floatRegex + floatRegex, 'g');\n const positions = [];\n const normals = [];\n const colors = null;\n let normalx;\n let normaly;\n let normalz;\n let result;\n let verticesPerFace;\n let normalsPerFace;\n let text;\n while ((result = faceRegex.exec(data)) !== null) {\n verticesPerFace = 0;\n normalsPerFace = 0;\n text = result[0];\n while ((result = normalRegex.exec(text)) !== null) {\n normalx = parseFloat(result[1]);\n normaly = parseFloat(result[2]);\n normalz = parseFloat(result[3]);\n normalsPerFace++;\n }\n while ((result = vertexRegex.exec(text)) !== null) {\n positions.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n normals.push(normalx, normaly, normalz);\n verticesPerFace++;\n }\n if (normalsPerFace !== 1) {\n ctx.log(\"Error in normal of face \" + faceCounter);\n return -1;\n }\n if (verticesPerFace !== 3) {\n ctx.log(\"Error in positions of face \" + faceCounter);\n return -1;\n }\n faceCounter++;\n }\n addMesh(ctx, positions, normals, colors);\n}\n\nlet nextGeometryId = 0;\n\nfunction addMesh(ctx, positions, normals, colors) {\n\n const indices = new Int32Array(positions.length / 3);\n for (let ni = 0, len = indices.length; ni < len; ni++) {\n indices[ni] = ni;\n }\n\n normals = normals && normals.length > 0 ? normals : null;\n colors = colors && colors.length > 0 ? colors : null;\n\n if (!ctx.autoNormals && ctx.smoothNormals) {\n faceToVertexNormals(positions, normals, {smoothNormalsAngleThreshold: ctx.smoothNormalsAngleThreshold});\n }\n\n const geometryId = \"\" + nextGeometryId++;\n const meshId = \"\" + nextGeometryId++;\n const entityId = \"\" + nextGeometryId++;\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: (!ctx.autoNormals) ? normals : null,\n colors: colors,\n indices: indices\n });\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: colors ? null : [1, 1, 1],\n metallic: 0.9,\n roughness: 0.1\n });\n\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: [meshId]\n });\n\n ctx.xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"Default\",\n metaObjectName: \"STL Mesh\",\n parentMetaObjectId: ctx.rootMetaObject.metaObjectId\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numObjects++;\n ctx.stats.numVertices += positions.length / 3;\n ctx.stats.numTriangles += indices.length / 3;\n}\n\nfunction ensureString(buffer) {\n if (typeof buffer !== 'string') {\n return decodeText(new Uint8Array(buffer));\n }\n return buffer;\n}\n\nfunction ensureBinary(buffer) {\n if (typeof buffer === 'string') {\n const arrayBuffer = new Uint8Array(buffer.length);\n for (let i = 0; i < buffer.length; i++) {\n arrayBuffer[i] = buffer.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n }\n return arrayBuffer.buffer || arrayBuffer;\n } else {\n return buffer;\n }\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]); // Implicitly assumes little-endian.\n }\n return decodeURIComponent(escape(s));\n}\n\nexport {parseSTLIntoXKTModel};\n","import {math} from \"./math.js\";\n\n/**\n * Converts surface-perpendicular face normals to vertex normals. Assumes that the mesh contains disjoint triangles\n * that don't share vertex array elements. Works by finding groups of vertices that have the same location and\n * averaging their normal vectors.\n *\n * @returns {{positions: Array, normals: *}}\n * @private\n */\nfunction faceToVertexNormals(positions, normals, options = {}) {\n const smoothNormalsAngleThreshold = options.smoothNormalsAngleThreshold || 20;\n const vertexMap = {};\n const vertexNormals = [];\n const vertexNormalAccum = {};\n let acc;\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let posi;\n let i;\n let j;\n let len;\n let a;\n let b;\n let c;\n\n for (i = 0, len = positions.length; i < len; i += 3) {\n\n posi = i / 3;\n\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n\n key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n\n if (vertexMap[key] === undefined) {\n vertexMap[key] = [posi];\n } else {\n vertexMap[key].push(posi);\n }\n\n const normal = math.normalizeVec3([normals[i], normals[i + 1], normals[i + 2]]);\n\n vertexNormals[posi] = normal;\n\n acc = math.vec4([normal[0], normal[1], normal[2], 1]);\n\n vertexNormalAccum[posi] = acc;\n }\n\n for (key in vertexMap) {\n\n if (vertexMap.hasOwnProperty(key)) {\n\n const vertices = vertexMap[key];\n const numVerts = vertices.length;\n\n for (i = 0; i < numVerts; i++) {\n\n const ii = vertices[i];\n\n acc = vertexNormalAccum[ii];\n\n for (j = 0; j < numVerts; j++) {\n\n if (i === j) {\n continue;\n }\n\n const jj = vertices[j];\n\n a = vertexNormals[ii];\n b = vertexNormals[jj];\n\n const angle = Math.abs(math.angleVec3(a, b) / math.DEGTORAD);\n\n if (angle < smoothNormalsAngleThreshold) {\n\n acc[0] += b[0];\n acc[1] += b[1];\n acc[2] += b[2];\n acc[3] += 1.0;\n }\n }\n }\n }\n }\n\n for (i = 0, len = normals.length; i < len; i += 3) {\n\n acc = vertexNormalAccum[i / 3];\n\n normals[i + 0] = acc[0] / acc[3];\n normals[i + 1] = acc[1] / acc[3];\n normals[i + 2] = acc[2] / acc[3];\n\n }\n}\n\nexport {faceToVertexNormals};","/**\n * @desc Creates box-shaped triangle mesh geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxGeometry({\n * primitiveType: \"triangles\" // or \"lines\"\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType,\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n\n primitiveType: \"triangles\",\n\n // The vertices - eight for our cube, each\n // one spanning three array elements for X,Y and Z\n\n positions: [\n\n // v0-v1-v2-v3 front\n xmax, ymax, zmax,\n xmin, ymax, zmax,\n xmin, ymin, zmax,\n xmax, ymin, zmax,\n\n // v0-v3-v4-v1 right\n xmax, ymax, zmax,\n xmax, ymin, zmax,\n xmax, ymin, zmin,\n xmax, ymax, zmin,\n\n // v0-v1-v6-v1 top\n xmax, ymax, zmax,\n xmax, ymax, zmin,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n\n // v1-v6-v7-v2 left\n xmin, ymax, zmax,\n xmin, ymax, zmin,\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n\n // v7-v4-v3-v2 bottom\n xmin, ymin, zmin,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmin, ymin, zmax,\n\n // v4-v7-v6-v1 back\n xmax, ymin, zmin,\n xmin, ymin, zmin,\n xmin, ymax, zmin,\n xmax, ymax, zmin\n ],\n\n // Normal vectors, one for each vertex\n normals: [\n\n // v0-v1-v2-v3 front\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n\n // v0-v3-v4-v5 right\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n\n // v0-v5-v6-v1 top\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n\n // v1-v6-v7-v2 left\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n\n // v7-v4-v3-v2 bottom\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n\n // v4-v7-v6-v5 back\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1\n ],\n\n // UV coords\n uv: [\n\n // v0-v1-v2-v3 front\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v0-v3-v4-v1 right\n 0, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n // v0-v1-v6-v1 top\n 1, 1,\n 1, 0,\n 0, 0,\n 0, 1,\n\n // v1-v6-v7-v2 left\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v7-v4-v3-v2 bottom\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0,\n\n // v4-v7-v6-v1 back\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0\n ],\n\n // Indices - these organise the\n // positions and uv texture coordinates\n // into geometric primitives in accordance\n // with the \"primitive\" parameter,\n // in this case a set of three indices\n // for each triangle.\n //\n // Note that each triangle is specified\n // in counter-clockwise winding order.\n //\n // You can specify them in clockwise\n // order if you configure the Modes\n // node's frontFace flag as \"cw\", instead of\n // the default \"ccw\".\n indices: [\n 0, 1, 2,\n 0, 2, 3,\n // front\n 4, 5, 6,\n 4, 6, 7,\n // right\n 8, 9, 10,\n 8, 10, 11,\n // top\n 12, 13, 14,\n 12, 14, 15,\n // left\n 16, 17, 18,\n 16, 18, 19,\n // bottom\n 20, 21, 22,\n 20, 22, 23\n ]\n };\n}\n\nexport {buildBoxGeometry};\n","/**\n * @desc Creates box-shaped line segment geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxLinesGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxLinesGeometry({\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType, // \"lines\"\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxLinesGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxLinesGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n primitiveType: \"lines\",\n positions: [\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmax, ymax, zmin,\n xmax, ymax, zmax\n ],\n indices: [\n 0, 1,\n 1, 3,\n 3, 2,\n 2, 0,\n 4, 5,\n 5, 7,\n 7, 6,\n 6, 4,\n 0, 4,\n 1, 5,\n 2, 6,\n 3, 7\n ]\n }\n}\n\nexport {buildBoxLinesGeometry};\n","/**\n * @desc Creates cylinder-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a cylinder-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildCylinderGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const cylinder = buildCylinderGeometry({\n * center: [0,0,0],\n * radiusTop: 2.0,\n * radiusBottom: 2.0,\n * height: 5.0,\n * radialSegments: 20,\n * heightSegments: 1,\n * openEnded: false\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"cylinderGeometry\",\n * primitiveType: cylinder.primitiveType,\n * positions: cylinder.positions,\n * normals: cylinder.normals,\n * indices: cylinder.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redCylinderMesh\",\n * geometryId: \"cylinderGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redCylinder\",\n * meshIds: [\"redCylinderMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildCylinderGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radiusTop=1] Radius of top.\n * @param {Number} [cfg.radiusBottom=1] Radius of bottom.\n * @param {Number} [cfg.height=1] Height.\n * @param {Number} [cfg.radialSegments=60] Number of horizontal segments.\n * @param {Number} [cfg.heightSegments=1] Number of vertical segments.\n * @param {Boolean} [cfg.openEnded=false] Whether or not the cylinder has solid caps on the ends.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildCylinderGeometry(cfg = {}) {\n\n let radiusTop = cfg.radiusTop || 1;\n if (radiusTop < 0) {\n console.error(\"negative radiusTop not allowed - will invert\");\n radiusTop *= -1;\n }\n\n let radiusBottom = cfg.radiusBottom || 1;\n if (radiusBottom < 0) {\n console.error(\"negative radiusBottom not allowed - will invert\");\n radiusBottom *= -1;\n }\n\n let height = cfg.height || 1;\n if (height < 0) {\n console.error(\"negative height not allowed - will invert\");\n height *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 3) {\n radialSegments = 3;\n }\n\n let heightSegments = cfg.heightSegments || 1;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n if (heightSegments < 1) {\n heightSegments = 1;\n }\n\n const openEnded = !!cfg.openEnded;\n\n let center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const heightHalf = height / 2;\n const heightLength = height / heightSegments;\n const radialAngle = (2.0 * Math.PI / radialSegments);\n const radialLength = 1.0 / radialSegments;\n //var nextRadius = this._radiusBottom;\n const radiusChange = (radiusTop - radiusBottom) / heightSegments;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let h;\n let i;\n\n let x;\n let z;\n\n let currentRadius;\n let currentHeight;\n\n let first;\n let second;\n\n let startIndex;\n let tu;\n let tv;\n\n // create vertices\n const normalY = (90.0 - (Math.atan(height / (radiusBottom - radiusTop))) * 180 / Math.PI) / 90.0;\n\n for (h = 0; h <= heightSegments; h++) {\n currentRadius = radiusTop - h * radiusChange;\n currentHeight = heightHalf - h * heightLength;\n\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n normals.push(currentRadius * x);\n normals.push(normalY); //todo\n normals.push(currentRadius * z);\n\n uvs.push((i * radialLength));\n uvs.push(h * 1 / heightSegments);\n\n positions.push((currentRadius * x) + centerX);\n positions.push((currentHeight) + centerY);\n positions.push((currentRadius * z) + centerZ);\n }\n }\n\n // create faces\n for (h = 0; h < heightSegments; h++) {\n for (i = 0; i <= radialSegments; i++) {\n\n first = h * (radialSegments + 1) + i;\n second = first + radialSegments;\n\n indices.push(first);\n indices.push(second);\n indices.push(second + 1);\n\n indices.push(first);\n indices.push(second + 1);\n indices.push(first + 1);\n }\n }\n\n // create top cap\n if (!openEnded && radiusTop > 0) {\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusTop * x);\n normals.push(1.0);\n normals.push(radiusTop * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusTop * x) + centerX);\n positions.push((heightHalf) + centerY);\n positions.push((radiusTop * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(first);\n indices.push(first + 1);\n indices.push(center);\n }\n }\n\n // create bottom cap\n if (!openEnded && radiusBottom > 0) {\n\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(-1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(0 - heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusBottom * x);\n normals.push(-1.0);\n normals.push(radiusBottom * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusBottom * x) + centerX);\n positions.push((0 - heightHalf) + centerY);\n positions.push((radiusBottom * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(center);\n indices.push(first + 1);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\n\nexport {buildCylinderGeometry};\n","/**\n * @desc Creates grid-shaped geometry arrays..\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a grid-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildGridGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const grid = buildGridGeometry({\n * size: 1000,\n * divisions: 500\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"gridGeometry\",\n * primitiveType: grid.primitiveType, // Will be \"lines\"\n * positions: grid.positions,\n * indices: grid.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redGridMesh\",\n * geometryId: \"gridGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redGrid\",\n * meshIds: [\"redGridMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildGridGeometry\n * @param {*} [cfg] Configs\n * @param {Number} [cfg.size=1] Dimension on the X and Z-axis.\n * @param {Number} [cfg.divisions=1] Number of divisions on X and Z axis..\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildGridGeometry(cfg = {}) {\n\n let size = cfg.size || 1;\n if (size < 0) {\n console.error(\"negative size not allowed - will invert\");\n size *= -1;\n }\n\n let divisions = cfg.divisions || 1;\n if (divisions < 0) {\n console.error(\"negative divisions not allowed - will invert\");\n divisions *= -1;\n }\n if (divisions < 1) {\n divisions = 1;\n }\n\n size = size || 10;\n divisions = divisions || 10;\n\n const step = size / divisions;\n const halfSize = size / 2;\n\n const positions = [];\n const indices = [];\n let l = 0;\n\n for (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) {\n\n positions.push(-halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(k);\n positions.push(0);\n positions.push(-halfSize);\n\n positions.push(k);\n positions.push(0);\n positions.push(halfSize);\n\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildGridGeometry};\n","/**\n * @desc Creates plane-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a plane-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildPlaneGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const plane = buildPlaneGeometry({\n * center: [0,0,0],\n * xSize: 2,\n * zSize: 2,\n * xSegments: 10,\n * zSegments: 10\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"planeGeometry\",\n * primitiveType: plane.primitiveType, // Will be \"triangles\"\n * positions: plane.positions,\n * normals: plane.normals,\n * indices: plane.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redPlaneMesh\",\n * geometryId: \"planeGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redPlane\",\n * meshIds: [\"redPlaneMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildPlaneGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1] Dimension on the X-axis.\n * @param {Number} [cfg.zSize=1] Dimension on the Z-axis.\n * @param {Number} [cfg.xSegments=1] Number of segments on the X-axis.\n * @param {Number} [cfg.zSegments=1] Number of segments on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildPlaneGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n let xSegments = cfg.xSegments || 1;\n if (xSegments < 0) {\n console.error(\"negative xSegments not allowed - will invert\");\n xSegments *= -1;\n }\n if (xSegments < 1) {\n xSegments = 1;\n }\n\n let zSegments = cfg.xSegments || 1;\n if (zSegments < 0) {\n console.error(\"negative zSegments not allowed - will invert\");\n zSegments *= -1;\n }\n if (zSegments < 1) {\n zSegments = 1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const halfWidth = xSize / 2;\n const halfHeight = zSize / 2;\n\n const planeX = Math.floor(xSegments) || 1;\n const planeZ = Math.floor(zSegments) || 1;\n\n const planeX1 = planeX + 1;\n const planeZ1 = planeZ + 1;\n\n const segmentWidth = xSize / planeX;\n const segmentHeight = zSize / planeZ;\n\n const positions = new Float32Array(planeX1 * planeZ1 * 3);\n const normals = new Float32Array(planeX1 * planeZ1 * 3);\n const uvs = new Float32Array(planeX1 * planeZ1 * 2);\n\n let offset = 0;\n let offset2 = 0;\n\n let iz;\n let ix;\n let x;\n let a;\n let b;\n let c;\n let d;\n\n for (iz = 0; iz < planeZ1; iz++) {\n\n const z = iz * segmentHeight - halfHeight;\n\n for (ix = 0; ix < planeX1; ix++) {\n\n x = ix * segmentWidth - halfWidth;\n\n positions[offset] = x + centerX;\n positions[offset + 1] = centerY;\n positions[offset + 2] = -z + centerZ;\n\n normals[offset + 2] = -1;\n\n uvs[offset2] = (ix) / planeX;\n uvs[offset2 + 1] = ((planeZ - iz) / planeZ);\n\n offset += 3;\n offset2 += 2;\n }\n }\n\n offset = 0;\n\n const indices = new ((positions.length / 3) > 65535 ? Uint32Array : Uint16Array)(planeX * planeZ * 6);\n\n for (iz = 0; iz < planeZ; iz++) {\n\n for (ix = 0; ix < planeX; ix++) {\n\n a = ix + planeX1 * iz;\n b = ix + planeX1 * (iz + 1);\n c = (ix + 1) + planeX1 * (iz + 1);\n d = (ix + 1) + planeX1 * iz;\n\n indices[offset] = d;\n indices[offset + 1] = b;\n indices[offset + 2] = a;\n\n indices[offset + 3] = d;\n indices[offset + 4] = c;\n indices[offset + 5] = b;\n\n offset += 6;\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildPlaneGeometry};\n","/**\n * @desc Creates sphere-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a sphere-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildSphereGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const sphere = buildSphereGeometry({\n * center: [0,0,0],\n * radius: 1.5,\n * heightSegments: 60,\n * widthSegments: 60\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"sphereGeometry\",\n * primitiveType: sphere.primitiveType, // Will be \"triangles\"\n * positions: sphere.positions,\n * normals: sphere.normals,\n * indices: sphere.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redSphereMesh\",\n * geometryId: \"sphereGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n *const xktEntity = xktModel.createEntity({\n * entityId: \"redSphere\",\n * meshIds: [\"redSphereMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildSphereGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] Radius.\n * @param {Number} [cfg.heightSegments=24] Number of latitudinal bands.\n * @param {Number} [cfg.widthSegments=18] Number of longitudinal bands.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildSphereGeometry(cfg = {}) {\n\n const lod = cfg.lod || 1;\n\n const centerX = cfg.center ? cfg.center[0] : 0;\n const centerY = cfg.center ? cfg.center[1] : 0;\n const centerZ = cfg.center ? cfg.center[2] : 0;\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n\n let heightSegments = cfg.heightSegments || 18;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n heightSegments = Math.floor(lod * heightSegments);\n if (heightSegments < 18) {\n heightSegments = 18;\n }\n\n let widthSegments = cfg.widthSegments || 18;\n if (widthSegments < 0) {\n console.error(\"negative widthSegments not allowed - will invert\");\n widthSegments *= -1;\n }\n widthSegments = Math.floor(lod * widthSegments);\n if (widthSegments < 18) {\n widthSegments = 18;\n }\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let i;\n let j;\n\n let theta;\n let sinTheta;\n let cosTheta;\n\n let phi;\n let sinPhi;\n let cosPhi;\n\n let x;\n let y;\n let z;\n\n let u;\n let v;\n\n let first;\n let second;\n\n for (i = 0; i <= heightSegments; i++) {\n\n theta = i * Math.PI / heightSegments;\n sinTheta = Math.sin(theta);\n cosTheta = Math.cos(theta);\n\n for (j = 0; j <= widthSegments; j++) {\n\n phi = j * 2 * Math.PI / widthSegments;\n sinPhi = Math.sin(phi);\n cosPhi = Math.cos(phi);\n\n x = cosPhi * sinTheta;\n y = cosTheta;\n z = sinPhi * sinTheta;\n u = 1.0 - j / widthSegments;\n v = i / heightSegments;\n\n normals.push(x);\n normals.push(y);\n normals.push(z);\n\n uvs.push(u);\n uvs.push(v);\n\n positions.push(centerX + radius * x);\n positions.push(centerY + radius * y);\n positions.push(centerZ + radius * z);\n }\n }\n\n for (i = 0; i < heightSegments; i++) {\n for (j = 0; j < widthSegments; j++) {\n\n first = (i * (widthSegments + 1)) + j;\n second = first + widthSegments + 1;\n\n indices.push(first + 1);\n indices.push(second + 1);\n indices.push(second);\n indices.push(first + 1);\n indices.push(second);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildSphereGeometry};\n","import {math} from '../lib/math.js';\n\n/**\n * @desc Creates torus-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a torus-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildTorusGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const torus = buildTorusGeometry({\n * center: [0,0,0],\n * radius: 1.0,\n * tube: 0.5,\n * radialSegments: 32,\n * tubeSegments: 24,\n * arc: Math.PI * 2.0\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"torusGeometry\",\n * primitiveType: torus.primitiveType, // Will be \"triangles\"\n * positions: torus.positions,\n * normals: torus.normals,\n * indices: torus.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTorusMesh\",\n * geometryId: \"torusGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redTorus\",\n * meshIds: [\"redTorusMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildTorusGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] The overall radius.\n * @param {Number} [cfg.tube=0.3] The tube radius.\n * @param {Number} [cfg.radialSegments=32] The number of radial segments.\n * @param {Number} [cfg.tubeSegments=24] The number of tubular segments.\n * @param {Number} [cfg.arc=Math.PI*0.5] The length of the arc in radians, where Math.PI*2 is a closed torus.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildTorusGeometry(cfg = {}) {\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n radius *= 0.5;\n\n let tube = cfg.tube || 0.3;\n if (tube < 0) {\n console.error(\"negative tube not allowed - will invert\");\n tube *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 4) {\n radialSegments = 4;\n }\n\n let tubeSegments = cfg.tubeSegments || 24;\n if (tubeSegments < 0) {\n console.error(\"negative tubeSegments not allowed - will invert\");\n tubeSegments *= -1;\n }\n if (tubeSegments < 4) {\n tubeSegments = 4;\n }\n\n let arc = cfg.arc || Math.PI * 2;\n if (arc < 0) {\n console.warn(\"negative arc not allowed - will invert\");\n arc *= -1;\n }\n if (arc > 360) {\n arc = 360;\n }\n\n const center = cfg.center;\n let centerX = center ? center[0] : 0;\n let centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let u;\n let v;\n let x;\n let y;\n let z;\n let vec;\n\n let i;\n let j;\n\n for (j = 0; j <= tubeSegments; j++) {\n for (i = 0; i <= radialSegments; i++) {\n\n u = i / radialSegments * arc;\n v = 0.785398 + (j / tubeSegments * Math.PI * 2);\n\n centerX = radius * Math.cos(u);\n centerY = radius * Math.sin(u);\n\n x = (radius + tube * Math.cos(v)) * Math.cos(u);\n y = (radius + tube * Math.cos(v)) * Math.sin(u);\n z = tube * Math.sin(v);\n\n positions.push(x + centerX);\n positions.push(y + centerY);\n positions.push(z + centerZ);\n\n uvs.push(1 - (i / radialSegments));\n uvs.push((j / tubeSegments));\n\n vec = math.normalizeVec3(math.subVec3([x, y, z], [centerX, centerY, centerZ], []), []);\n\n normals.push(vec[0]);\n normals.push(vec[1]);\n normals.push(vec[2]);\n }\n }\n\n let a;\n let b;\n let c;\n let d;\n\n for (j = 1; j <= tubeSegments; j++) {\n for (i = 1; i <= radialSegments; i++) {\n\n a = (radialSegments + 1) * j + i - 1;\n b = (radialSegments + 1) * (j - 1) + i - 1;\n c = (radialSegments + 1) * (j - 1) + i;\n d = (radialSegments + 1) * j + i;\n\n indices.push(a);\n indices.push(b);\n indices.push(c);\n\n indices.push(c);\n indices.push(d);\n indices.push(a);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildTorusGeometry};\n","const letters = {\n ' ': {width: 16, points: []},\n '!': {\n width: 10, points: [\n [5, 21],\n [5, 7],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '\"': {\n width: 16, points: [\n [4, 21],\n [4, 14],\n [-1, -1],\n [12, 21],\n [12, 14]\n ]\n },\n '#': {\n width: 21, points: [\n [11, 25],\n [4, -7],\n [-1, -1],\n [17, 25],\n [10, -7],\n [-1, -1],\n [4, 12],\n [18, 12],\n [-1, -1],\n [3, 6],\n [17, 6]\n ]\n },\n '$': {\n width: 20, points: [\n [8, 25],\n [8, -4],\n [-1, -1],\n [12, 25],\n [12, -4],\n [-1, -1],\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n '%': {\n width: 24, points: [\n [21, 21],\n [3, 0],\n [-1, -1],\n [8, 21],\n [10, 19],\n [10, 17],\n [9, 15],\n [7, 14],\n [5, 14],\n [3, 16],\n [3, 18],\n [4, 20],\n [6, 21],\n [8, 21],\n [10, 20],\n [13, 19],\n [16, 19],\n [19, 20],\n [21, 21],\n [-1, -1],\n [17, 7],\n [15, 6],\n [14, 4],\n [14, 2],\n [16, 0],\n [18, 0],\n [20, 1],\n [21, 3],\n [21, 5],\n [19, 7],\n [17, 7]\n ]\n },\n '&': {\n width: 26, points: [\n [23, 12],\n [23, 13],\n [22, 14],\n [21, 14],\n [20, 13],\n [19, 11],\n [17, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [7, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 6],\n [4, 8],\n [5, 9],\n [12, 13],\n [13, 14],\n [14, 16],\n [14, 18],\n [13, 20],\n [11, 21],\n [9, 20],\n [8, 18],\n [8, 16],\n [9, 13],\n [11, 10],\n [16, 3],\n [18, 1],\n [20, 0],\n [22, 0],\n [23, 1],\n [23, 2]\n ]\n },\n '\\'': {\n width: 10, points: [\n [5, 19],\n [4, 20],\n [5, 21],\n [6, 20],\n [6, 18],\n [5, 16],\n [4, 15]\n ]\n },\n '(': {\n width: 14, points: [\n [11, 25],\n [9, 23],\n [7, 20],\n [5, 16],\n [4, 11],\n [4, 7],\n [5, 2],\n [7, -2],\n [9, -5],\n [11, -7]\n ]\n },\n ')': {\n width: 14, points: [\n [3, 25],\n [5, 23],\n [7, 20],\n [9, 16],\n [10, 11],\n [10, 7],\n [9, 2],\n [7, -2],\n [5, -5],\n [3, -7]\n ]\n },\n '*': {\n width: 16, points: [\n [8, 21],\n [8, 9],\n [-1, -1],\n [3, 18],\n [13, 12],\n [-1, -1],\n [13, 18],\n [3, 12]\n ]\n },\n '+': {\n width: 26, points: [\n [13, 18],\n [13, 0],\n [-1, -1],\n [4, 9],\n [22, 9]\n ]\n },\n ',': {\n width: 10, points: [\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '-': {\n width: 26, points: [\n [4, 9],\n [22, 9]\n ]\n },\n '.': {\n width: 10, points: [\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '/': {\n width: 22, points: [\n [20, 25],\n [2, -7]\n ]\n },\n '0': {\n width: 20, points: [\n [9, 21],\n [6, 20],\n [4, 17],\n [3, 12],\n [3, 9],\n [4, 4],\n [6, 1],\n [9, 0],\n [11, 0],\n [14, 1],\n [16, 4],\n [17, 9],\n [17, 12],\n [16, 17],\n [14, 20],\n [11, 21],\n [9, 21]\n ]\n },\n '1': {\n width: 20, points: [\n [6, 17],\n [8, 18],\n [11, 21],\n [11, 0]\n ]\n },\n '2': {\n width: 20, points: [\n [4, 16],\n [4, 17],\n [5, 19],\n [6, 20],\n [8, 21],\n [12, 21],\n [14, 20],\n [15, 19],\n [16, 17],\n [16, 15],\n [15, 13],\n [13, 10],\n [3, 0],\n [17, 0]\n ]\n },\n '3': {\n width: 20, points: [\n [5, 21],\n [16, 21],\n [10, 13],\n [13, 13],\n [15, 12],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '4': {\n width: 20, points: [\n [13, 21],\n [3, 7],\n [18, 7],\n [-1, -1],\n [13, 21],\n [13, 0]\n ]\n },\n '5': {\n width: 20, points: [\n [15, 21],\n [5, 21],\n [4, 12],\n [5, 13],\n [8, 14],\n [11, 14],\n [14, 13],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '6': {\n width: 20, points: [\n [16, 18],\n [15, 20],\n [12, 21],\n [10, 21],\n [7, 20],\n [5, 17],\n [4, 12],\n [4, 7],\n [5, 3],\n [7, 1],\n [10, 0],\n [11, 0],\n [14, 1],\n [16, 3],\n [17, 6],\n [17, 7],\n [16, 10],\n [14, 12],\n [11, 13],\n [10, 13],\n [7, 12],\n [5, 10],\n [4, 7]\n ]\n },\n '7': {\n width: 20, points: [\n [17, 21],\n [7, 0],\n [-1, -1],\n [3, 21],\n [17, 21]\n ]\n },\n '8': {\n width: 20, points: [\n [8, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 14],\n [7, 13],\n [11, 12],\n [14, 11],\n [16, 9],\n [17, 7],\n [17, 4],\n [16, 2],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 7],\n [4, 9],\n [6, 11],\n [9, 12],\n [13, 13],\n [15, 14],\n [16, 16],\n [16, 18],\n [15, 20],\n [12, 21],\n [8, 21]\n ]\n },\n '9': {\n width: 20, points: [\n [16, 14],\n [15, 11],\n [13, 9],\n [10, 8],\n [9, 8],\n [6, 9],\n [4, 11],\n [3, 14],\n [3, 15],\n [4, 18],\n [6, 20],\n [9, 21],\n [10, 21],\n [13, 20],\n [15, 18],\n [16, 14],\n [16, 9],\n [15, 4],\n [13, 1],\n [10, 0],\n [8, 0],\n [5, 1],\n [4, 3]\n ]\n },\n ':': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n ';': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '<': {\n width: 24, points: [\n [20, 18],\n [4, 9],\n [20, 0]\n ]\n },\n '=': {\n width: 26, points: [\n [4, 12],\n [22, 12],\n [-1, -1],\n [4, 6],\n [22, 6]\n ]\n },\n '>': {\n width: 24, points: [\n [4, 18],\n [20, 9],\n [4, 0]\n ]\n },\n '?': {\n width: 18, points: [\n [3, 16],\n [3, 17],\n [4, 19],\n [5, 20],\n [7, 21],\n [11, 21],\n [13, 20],\n [14, 19],\n [15, 17],\n [15, 15],\n [14, 13],\n [13, 12],\n [9, 10],\n [9, 7],\n [-1, -1],\n [9, 2],\n [8, 1],\n [9, 0],\n [10, 1],\n [9, 2]\n ]\n },\n '@': {\n width: 27, points: [\n [18, 13],\n [17, 15],\n [15, 16],\n [12, 16],\n [10, 15],\n [9, 14],\n [8, 11],\n [8, 8],\n [9, 6],\n [11, 5],\n [14, 5],\n [16, 6],\n [17, 8],\n [-1, -1],\n [12, 16],\n [10, 14],\n [9, 11],\n [9, 8],\n [10, 6],\n [11, 5],\n [-1, -1],\n [18, 16],\n [17, 8],\n [17, 6],\n [19, 5],\n [21, 5],\n [23, 7],\n [24, 10],\n [24, 12],\n [23, 15],\n [22, 17],\n [20, 19],\n [18, 20],\n [15, 21],\n [12, 21],\n [9, 20],\n [7, 19],\n [5, 17],\n [4, 15],\n [3, 12],\n [3, 9],\n [4, 6],\n [5, 4],\n [7, 2],\n [9, 1],\n [12, 0],\n [15, 0],\n [18, 1],\n [20, 2],\n [21, 3],\n [-1, -1],\n [19, 16],\n [18, 8],\n [18, 6],\n [19, 5]\n ]\n },\n 'A': {\n width: 18, points: [\n [9, 21],\n [1, 0],\n [-1, -1],\n [9, 21],\n [17, 0],\n [-1, -1],\n [4, 7],\n [14, 7]\n ]\n },\n 'B': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [-1, -1],\n [4, 11],\n [13, 11],\n [16, 10],\n [17, 9],\n [18, 7],\n [18, 4],\n [17, 2],\n [16, 1],\n [13, 0],\n [4, 0]\n ]\n },\n 'C': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5]\n ]\n },\n 'D': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [11, 21],\n [14, 20],\n [16, 18],\n [17, 16],\n [18, 13],\n [18, 8],\n [17, 5],\n [16, 3],\n [14, 1],\n [11, 0],\n [4, 0]\n ]\n },\n 'E': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11],\n [-1, -1],\n [4, 0],\n [17, 0]\n ]\n },\n 'F': {\n width: 18, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11]\n ]\n },\n 'G': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [18, 8],\n [-1, -1],\n [13, 8],\n [18, 8]\n ]\n },\n 'H': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [18, 0],\n [-1, -1],\n [4, 11],\n [18, 11]\n ]\n },\n 'I': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'J': {\n width: 16, points: [\n [12, 21],\n [12, 5],\n [11, 2],\n [10, 1],\n [8, 0],\n [6, 0],\n [4, 1],\n [3, 2],\n [2, 5],\n [2, 7]\n ]\n },\n 'K': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [4, 7],\n [-1, -1],\n [9, 12],\n [18, 0]\n ]\n },\n 'L': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 0],\n [16, 0]\n ]\n },\n 'M': {\n width: 24, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [20, 0]\n ]\n },\n 'N': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [18, 0],\n [-1, -1],\n [18, 21],\n [18, 0]\n ]\n },\n 'O': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21]\n ]\n },\n 'P': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 14],\n [17, 12],\n [16, 11],\n [13, 10],\n [4, 10]\n ]\n },\n 'Q': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [-1, -1],\n [12, 4],\n [18, -2]\n ]\n },\n 'R': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [4, 11],\n [-1, -1],\n [11, 11],\n [18, 0]\n ]\n },\n 'S': {\n width: 20, points: [\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n 'T': {\n width: 16, points: [\n [8, 21],\n [8, 0],\n [-1, -1],\n [1, 21],\n [15, 21]\n ]\n },\n 'U': {\n width: 22, points: [\n [4, 21],\n [4, 6],\n [5, 3],\n [7, 1],\n [10, 0],\n [12, 0],\n [15, 1],\n [17, 3],\n [18, 6],\n [18, 21]\n ]\n },\n 'V': {\n width: 18, points: [\n [1, 21],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 0]\n ]\n },\n 'W': {\n width: 24, points: [\n [2, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [17, 0],\n [-1, -1],\n [22, 21],\n [17, 0]\n ]\n },\n 'X': {\n width: 20, points: [\n [3, 21],\n [17, 0],\n [-1, -1],\n [17, 21],\n [3, 0]\n ]\n },\n 'Y': {\n width: 18, points: [\n [1, 21],\n [9, 11],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 11]\n ]\n },\n 'Z': {\n width: 20, points: [\n [17, 21],\n [3, 0],\n [-1, -1],\n [3, 21],\n [17, 21],\n [-1, -1],\n [3, 0],\n [17, 0]\n ]\n },\n '[': {\n width: 14, points: [\n [4, 25],\n [4, -7],\n [-1, -1],\n [5, 25],\n [5, -7],\n [-1, -1],\n [4, 25],\n [11, 25],\n [-1, -1],\n [4, -7],\n [11, -7]\n ]\n },\n '\\\\': {\n width: 14, points: [\n [0, 21],\n [14, -3]\n ]\n },\n ']': {\n width: 14, points: [\n [9, 25],\n [9, -7],\n [-1, -1],\n [10, 25],\n [10, -7],\n [-1, -1],\n [3, 25],\n [10, 25],\n [-1, -1],\n [3, -7],\n [10, -7]\n ]\n },\n '^': {\n width: 16, points: [\n [6, 15],\n [8, 18],\n [10, 15],\n [-1, -1],\n [3, 12],\n [8, 17],\n [13, 12],\n [-1, -1],\n [8, 17],\n [8, 0]\n ]\n },\n '_': {\n width: 16, points: [\n [0, -2],\n [16, -2]\n ]\n },\n '`': {\n width: 10, points: [\n [6, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 15],\n [6, 16],\n [5, 17]\n ]\n },\n 'a': {\n width: 19, points: [\n [15, 14],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'b': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'c': {\n width: 18, points: [\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'd': {\n width: 19, points: [\n [15, 21],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'e': {\n width: 18, points: [\n [3, 8],\n [15, 8],\n [15, 10],\n [14, 12],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'f': {\n width: 12, points: [\n [10, 21],\n [8, 21],\n [6, 20],\n [5, 17],\n [5, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'g': {\n width: 19, points: [\n [15, 14],\n [15, -2],\n [14, -5],\n [13, -6],\n [11, -7],\n [8, -7],\n [6, -6],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'h': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'i': {\n width: 8, points: [\n [3, 21],\n [4, 20],\n [5, 21],\n [4, 22],\n [3, 21],\n [-1, -1],\n [4, 14],\n [4, 0]\n ]\n },\n 'j': {\n width: 10, points: [\n [5, 21],\n [6, 20],\n [7, 21],\n [6, 22],\n [5, 21],\n [-1, -1],\n [6, 14],\n [6, -3],\n [5, -6],\n [3, -7],\n [1, -7]\n ]\n },\n 'k': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [14, 14],\n [4, 4],\n [-1, -1],\n [8, 8],\n [15, 0]\n ]\n },\n 'l': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'm': {\n width: 30, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0],\n [-1, -1],\n [15, 10],\n [18, 13],\n [20, 14],\n [23, 14],\n [25, 13],\n [26, 10],\n [26, 0]\n ]\n },\n 'n': {\n width: 19, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'o': {\n width: 19, points: [\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3],\n [16, 6],\n [16, 8],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14]\n ]\n },\n 'p': {\n width: 19, points: [\n [4, 14],\n [4, -7],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'q': {\n width: 19, points: [\n [15, 14],\n [15, -7],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'r': {\n width: 13, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 8],\n [5, 11],\n [7, 13],\n [9, 14],\n [12, 14]\n ]\n },\n 's': {\n width: 17, points: [\n [14, 11],\n [13, 13],\n [10, 14],\n [7, 14],\n [4, 13],\n [3, 11],\n [4, 9],\n [6, 8],\n [11, 7],\n [13, 6],\n [14, 4],\n [14, 3],\n [13, 1],\n [10, 0],\n [7, 0],\n [4, 1],\n [3, 3]\n ]\n },\n 't': {\n width: 12, points: [\n [5, 21],\n [5, 4],\n [6, 1],\n [8, 0],\n [10, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'u': {\n width: 19, points: [\n [4, 14],\n [4, 4],\n [5, 1],\n [7, 0],\n [10, 0],\n [12, 1],\n [15, 4],\n [-1, -1],\n [15, 14],\n [15, 0]\n ]\n },\n 'v': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0]\n ]\n },\n 'w': {\n width: 22, points: [\n [3, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [15, 0],\n [-1, -1],\n [19, 14],\n [15, 0]\n ]\n },\n 'x': {\n width: 17, points: [\n [3, 14],\n [14, 0],\n [-1, -1],\n [14, 14],\n [3, 0]\n ]\n },\n 'y': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0],\n [6, -4],\n [4, -6],\n [2, -7],\n [1, -7]\n ]\n },\n 'z': {\n width: 17, points: [\n [14, 14],\n [3, 0],\n [-1, -1],\n [3, 14],\n [14, 14],\n [-1, -1],\n [3, 0],\n [14, 0]\n ]\n },\n '{': {\n width: 14, points: [\n [9, 25],\n [7, 24],\n [6, 23],\n [5, 21],\n [5, 19],\n [6, 17],\n [7, 16],\n [8, 14],\n [8, 12],\n [6, 10],\n [-1, -1],\n [7, 24],\n [6, 22],\n [6, 20],\n [7, 18],\n [8, 17],\n [9, 15],\n [9, 13],\n [8, 11],\n [4, 9],\n [8, 7],\n [9, 5],\n [9, 3],\n [8, 1],\n [7, 0],\n [6, -2],\n [6, -4],\n [7, -6],\n [-1, -1],\n [6, 8],\n [8, 6],\n [8, 4],\n [7, 2],\n [6, 1],\n [5, -1],\n [5, -3],\n [6, -5],\n [7, -6],\n [9, -7]\n ]\n },\n '|': {\n width: 8, points: [\n [4, 25],\n [4, -7]\n ]\n },\n '}': {\n width: 14, points: [\n [5, 25],\n [7, 24],\n [8, 23],\n [9, 21],\n [9, 19],\n [8, 17],\n [7, 16],\n [6, 14],\n [6, 12],\n [8, 10],\n [-1, -1],\n [7, 24],\n [8, 22],\n [8, 20],\n [7, 18],\n [6, 17],\n [5, 15],\n [5, 13],\n [6, 11],\n [10, 9],\n [6, 7],\n [5, 5],\n [5, 3],\n [6, 1],\n [7, 0],\n [8, -2],\n [8, -4],\n [7, -6],\n [-1, -1],\n [8, 8],\n [6, 6],\n [6, 4],\n [7, 2],\n [8, 1],\n [9, -1],\n [9, -3],\n [8, -5],\n [7, -6],\n [5, -7]\n ]\n },\n '~': {\n width: 24, points: [\n [3, 6],\n [3, 8],\n [4, 11],\n [6, 12],\n [8, 12],\n [10, 11],\n [14, 8],\n [16, 7],\n [18, 7],\n [20, 8],\n [21, 10],\n [-1, -1],\n [3, 8],\n [4, 10],\n [6, 11],\n [8, 11],\n [10, 10],\n [14, 7],\n [16, 6],\n [18, 6],\n [20, 7],\n [21, 10],\n [21, 12]\n ]\n }\n};\n\n/**\n * @desc Creates wireframe text-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a text-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildVectorTextGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const text = buildVectorTextGeometry({\n * origin: [0,0,0],\n * text: \"On the other side of the screen, it all looked so easy\"\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"textGeometry\",\n * primitiveType: text.primitiveType, // Will be \"lines\"\n * positions: text.positions,\n * indices: text.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTextMesh\",\n * geometryId: \"textGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redText\",\n * meshIds: [\"redTextMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildVectorTextGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number[]} [cfg.origin] 3D point indicating the top left corner.\n * @param {Number} [cfg.size=1] Size of each character.\n * @param {String} [cfg.text=\"\"] The text.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildVectorTextGeometry(cfg = {}) {\n\n var origin = cfg.origin || [0, 0, 0];\n var xOrigin = origin[0];\n var yOrigin = origin[1];\n var zOrigin = origin[2];\n var size = cfg.size || 1;\n\n var positions = [];\n var indices = [];\n var text = (\"\" + cfg.text).trim();\n var lines = (text || \"\").split(\"\\n\");\n var countVerts = 0;\n var y = 0;\n var x;\n var str;\n var len;\n var c;\n var mag = 1.0 / 25.0;\n var penUp;\n var p1;\n var p2;\n var needLine;\n var pointsLen;\n var a;\n\n for (var iLine = 0; iLine < lines.length; iLine++) {\n\n x = 0;\n str = lines[iLine];\n len = str.length;\n\n for (var i = 0; i < len; i++) {\n\n c = letters[str.charAt(i)];\n\n if (c === '\\n') {\n //alert(\"newline\");\n }\n\n if (!c) {\n continue;\n }\n\n penUp = 1;\n p1 = -1;\n p2 = -1;\n needLine = false;\n\n pointsLen = c.points.length;\n\n for (var j = 0; j < pointsLen; j++) {\n a = c.points[j];\n\n if (a[0] === -1 && a[1] === -1) {\n penUp = 1;\n needLine = false;\n continue;\n }\n\n positions.push((x + (a[0] * size) * mag) + xOrigin);\n positions.push((y + (a[1] * size) * mag) + yOrigin);\n positions.push(0 + zOrigin);\n\n if (p1 === -1) {\n p1 = countVerts;\n } else if (p2 === -1) {\n p2 = countVerts;\n } else {\n p1 = p2;\n p2 = countVerts;\n }\n countVerts++;\n\n if (penUp) {\n penUp = false;\n\n } else {\n indices.push(p1);\n indices.push(p2);\n }\n\n needLine = true;\n }\n x += c.width * mag * size;\n\n }\n y -= 35 * mag * size;\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildVectorTextGeometry}\n","/**\n * @private\n * @param buf\n * @returns {ArrayBuffer}\n */\nexport function toArrayBuffer(buf) {\n const ab = new ArrayBuffer(buf.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buf.length; ++i) {\n view[i] = buf[i];\n }\n return ab;\n}","import {XKT_INFO} from \"./XKT_INFO.js\";\nimport {XKTModel} from \"./XKTModel/XKTModel.js\";\nimport {parseCityJSONIntoXKTModel} from \"./parsers/parseCityJSONIntoXKTModel.js\";\nimport {parseGLTFIntoXKTModel} from \"./parsers/parseGLTFIntoXKTModel.js\";\nimport {parseIFCIntoXKTModel} from \"./parsers/parseIFCIntoXKTModel.js\";\nimport {parseLASIntoXKTModel} from \"./parsers/parseLASIntoXKTModel.js\";\nimport {parsePCDIntoXKTModel} from \"./parsers/parsePCDIntoXKTModel.js\";\nimport {parsePLYIntoXKTModel} from \"./parsers/parsePLYIntoXKTModel.js\";\nimport {parseSTLIntoXKTModel} from \"./parsers/parseSTLIntoXKTModel.js\";\nimport {writeXKTModelToArrayBuffer} from \"./XKTModel/writeXKTModelToArrayBuffer.js\";\n\nimport {toArrayBuffer} from \"./XKTModel/lib/toArraybuffer\";\n\nconst fs = require('fs');\nconst path = require(\"path\");\n\n/**\n * Converts model files into xeokit's native XKT format.\n *\n * Supported source formats are: IFC, CityJSON, glTF, LAZ and LAS.\n *\n * **Only bundled in xeokit-convert.cjs.js.**\n *\n * ## Usage\n *\n * ````javascript\n * const convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\n * const fs = require('fs');\n *\n * convert2xkt({\n * sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n * outputXKT: (xtkArrayBuffer) => {\n * fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n * }\n * }).then(() => {\n * console.log(\"Converted.\");\n * }, (errMsg) => {\n * console.error(\"Conversion failed: \" + errMsg)\n * });\n ````\n * @param {Object} params Conversion parameters.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {*} [params.configs] Configurations.\n * @param {String} [params.source] Path to source file. Alternative to ````sourceData````.\n * @param {ArrayBuffer|JSON} [params.sourceData] Source file data. Alternative to ````source````.\n * @param {String} [params.sourceFormat] Format of source file/data. Always needed with ````sourceData````, but not normally needed with ````source````, because convert2xkt will determine the format automatically from the file extension of ````source````.\n * @param {String} [params.metaModelDataStr] Source file data. Overrides metadata from ````metaModelSource````, ````sourceData```` and ````source````.\n * @param {String} [params.metaModelSource] Path to source metaModel file. Overrides metadata from ````sourceData```` and ````source````. Overridden by ````metaModelData````.\n * @param {String} [params.output] Path to destination XKT file. Directories on this path are automatically created if not existing.\n * @param {Function} [params.outputXKTModel] Callback to collect the ````XKTModel```` that is internally build by this method.\n * @param {Function} [params.outputXKT] Callback to collect XKT file data.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {Object} [stats] Collects conversion statistics. Statistics are attached to this object if provided.\n * @param {Function} [params.outputStats] Callback to collect statistics.\n * @param {Boolean} [params.rotateX=false] Whether to rotate the model 90 degrees about the X axis to make the Y axis \"up\", if necessary. Applies to CityJSON and LAS/LAZ models.\n * @param {Boolean} [params.reuseGeometries=true] When true, will enable geometry reuse within the XKT. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be when a model (eg. glTF) has 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {Boolean} [params.includeTextures=true] Whether to convert textures. Only works for ````glTF```` models.\n * @param {Boolean} [params.includeNormals=true] Whether to convert normals. When false, the parser will ignore\n * geometry normals, and the modelwill rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the model.\n * @param {Number} [params.minTileSize=200] Minimum RTC coordinate tile size. Set this to a value between 100 and 10000,\n * depending on how far from the coordinate origin the model's vertex positions are; specify larger tile sizes when close\n * to the origin, and smaller sizes when distant. This compensates for decreasing precision as floats get bigger.\n * @param {Function} [params.log] Logging callback.\n * @return {Promise}\n */\nfunction convert2xkt({\n WebIFC,\n configs,\n source,\n sourceData,\n sourceFormat,\n metaModelSource,\n metaModelDataStr,\n modelAABB,\n output,\n outputXKTModel,\n outputXKT,\n includeTypes,\n excludeTypes,\n reuseGeometries = true,\n minTileSize = 200,\n stats = {},\n outputStats,\n rotateX = false,\n includeTextures = true,\n includeNormals = true,\n log = function (msg) {\n }\n }) {\n\n stats.sourceFormat = \"\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numTextureSets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.sourceSize = 0;\n stats.xktSize = 0;\n stats.texturesSize = 0;\n stats.xktVersion = \"\";\n stats.compressionRatio = 0;\n stats.conversionTime = 0;\n stats.aabb = null;\n\n function getFileExtension(fileName) {\n let ext = path.extname(source);\n if (ext.charAt(0) === \".\") {\n ext = ext.substring(1);\n }\n return ext;\n }\n\n return new Promise(function (resolve, reject) {\n const _log = log;\n log = (msg) => {\n _log(`[convert2xkt] ${msg}`)\n }\n\n if (!source && !sourceData) {\n reject(\"Argument expected: source or sourceData\");\n return;\n }\n\n if (!sourceFormat && sourceData) {\n reject(\"Argument expected: sourceFormat is required with sourceData\");\n return;\n }\n\n if (!output && !outputXKTModel && !outputXKT) {\n reject(\"Argument expected: output, outputXKTModel or outputXKT\");\n return;\n }\n\n if (source) {\n log('Reading input file: ' + source);\n }\n\n const startTime = new Date();\n\n const sourceConfigs = configs.sourceConfigs || {};\n const ext = sourceFormat || getFileExtension(source);\n\n log(`Input file extension: \"${ext}\"`);\n\n let fileTypeConfigs = sourceConfigs[ext];\n\n if (!fileTypeConfigs) {\n log(`[WARNING] Could not find configs sourceConfigs entry for source format \"${ext}\". This is derived from the source file name extension. Will use internal default configs.`);\n fileTypeConfigs = {};\n }\n function overrideOption(option1, option2) {\n if (option1 !== undefined) {\n return option1;\n }\n return option2;\n }\n\n if (!sourceData) {\n try {\n sourceData = fs.readFileSync(source);\n } catch (err) {\n reject(err);\n return;\n }\n }\n\n const sourceFileSizeBytes = sourceData.byteLength;\n\n log(\"Input file size: \" + (sourceFileSizeBytes / 1000).toFixed(2) + \" kB\");\n\n if (!metaModelDataStr && metaModelSource) {\n log('Reading input metadata file: ' + metaModelSource);\n try {\n metaModelDataStr = fs.readFileSync(metaModelSource);\n } catch (err) {\n reject(err);\n return;\n }\n } else {\n log(`Not embedding metadata in XKT`);\n }\n\n let metaModelJSON;\n\n if (metaModelDataStr) {\n try {\n metaModelJSON = JSON.parse(metaModelDataStr);\n } catch (e) {\n metaModelJSON = {};\n log(`Error parsing metadata JSON: ${e}`);\n }\n }\n\n minTileSize = overrideOption(fileTypeConfigs.minTileSize, minTileSize);\n rotateX = overrideOption(fileTypeConfigs.rotateX, rotateX);\n reuseGeometries = overrideOption(fileTypeConfigs.reuseGeometries, reuseGeometries);\n includeTextures = overrideOption(fileTypeConfigs.includeTextures, includeTextures);\n includeNormals = overrideOption(fileTypeConfigs.includeNormals, includeNormals);\n includeTypes = overrideOption(fileTypeConfigs.includeTypes, includeTypes);\n excludeTypes = overrideOption(fileTypeConfigs.excludeTypes, excludeTypes);\n\n if (reuseGeometries === false) {\n log(\"Geometry reuse is disabled\");\n }\n\n const xktModel = new XKTModel({\n minTileSize,\n modelAABB\n });\n\n switch (ext) {\n case \"json\":\n convert(parseCityJSONIntoXKTModel, {\n data: JSON.parse(sourceData),\n xktModel,\n stats,\n rotateX,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n log\n });\n break;\n\n case \"glb\":\n sourceData = toArrayBuffer(sourceData);\n convert(parseGLTFIntoXKTModel, {\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"gltf\":\n sourceData = toArrayBuffer(sourceData);\n const gltfBasePath = source ? path.dirname(source) : \"\";\n convert(parseGLTFIntoXKTModel, {\n baseUri: gltfBasePath,\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n // case \"gltf\":\n // const gltfJSON = JSON.parse(sourceData);\n // const gltfBasePath = source ? getBasePath(source) : \"\";\n // convert(parseGLTFIntoXKTModel, {\n // baseUri: gltfBasePath,\n // data: gltfJSON,\n // reuseGeometries,\n // includeTextures,\n // includeNormals,\n // metaModelData: metaModelJSON,\n // xktModel,\n // getAttachment: async (name) => {\n // const filePath = gltfBasePath + name;\n // log(`Reading attachment file: ${filePath}`);\n // const buffer = fs.readFileSync(filePath);\n // const arrayBuf = toArrayBuffer(buffer);\n // return arrayBuf;\n // },\n // stats,\n // log\n // });\n // break;\n\n case \"ifc\":\n convert(parseIFCIntoXKTModel, {\n WebIFC,\n data: sourceData,\n xktModel,\n wasmPath: \"./\",\n includeTypes,\n excludeTypes,\n stats,\n log\n });\n break;\n\n case \"laz\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"las\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"pcd\":\n convert(parsePCDIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"ply\":\n convert(parsePLYIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"stl\":\n convert(parseSTLIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n default:\n reject(`Error: unsupported source format: \"${ext}\".`);\n return;\n }\n\n function convert(parser, converterParams) {\n\n parser(converterParams).then(() => {\n\n if (!metaModelJSON) {\n log(\"Creating default metamodel in XKT\");\n xktModel.createDefaultMetaObjects();\n }\n\n log(\"Input file parsed OK. Building XKT document...\");\n\n xktModel.finalize().then(() => {\n\n log(\"XKT document built OK. Writing to XKT file...\");\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, {zip: true});\n\n const xktContent = Buffer.from(xktArrayBuffer);\n\n const targetFileSizeBytes = xktArrayBuffer.byteLength;\n\n stats.minTileSize = minTileSize || 200;\n stats.sourceSize = (sourceFileSizeBytes / 1000).toFixed(2);\n stats.xktSize = (targetFileSizeBytes / 1000).toFixed(2);\n stats.xktVersion = XKT_INFO.xktVersion;\n stats.compressionRatio = (sourceFileSizeBytes / targetFileSizeBytes).toFixed(2);\n stats.conversionTime = ((new Date() - startTime) / 1000.0).toFixed(2);\n stats.aabb = xktModel.aabb;\n log(`Converted to: XKT v${stats.xktVersion}`);\n if (includeTypes) {\n log(\"Include types: \" + (includeTypes ? includeTypes : \"(include all)\"));\n }\n if (excludeTypes) {\n log(\"Exclude types: \" + (excludeTypes ? excludeTypes : \"(exclude none)\"));\n }\n log(\"XKT size: \" + stats.xktSize + \" kB\");\n log(\"XKT textures size: \" + (stats.texturesSize / 1000).toFixed(2) + \"kB\");\n log(\"Compression ratio: \" + stats.compressionRatio);\n log(\"Conversion time: \" + stats.conversionTime + \" s\");\n log(\"Converted metaobjects: \" + stats.numMetaObjects);\n log(\"Converted property sets: \" + stats.numPropertySets);\n log(\"Converted drawable objects: \" + stats.numObjects);\n log(\"Converted geometries: \" + stats.numGeometries);\n log(\"Converted textures: \" + stats.numTextures);\n log(\"Converted textureSets: \" + stats.numTextureSets);\n log(\"Converted triangles: \" + stats.numTriangles);\n log(\"Converted vertices: \" + stats.numVertices);\n log(\"Converted UVs: \" + stats.numUVs);\n log(\"Converted normals: \" + stats.numNormals);\n log(\"Converted tiles: \" + xktModel.tilesList.length);\n log(\"minTileSize: \" + stats.minTileSize);\n\n if (output) {\n const outputDir = path.dirname(output);\n if (outputDir !== \"\" && !fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {recursive: true});\n }\n log('Writing XKT file: ' + output);\n fs.writeFileSync(output, xktContent);\n }\n\n if (outputXKTModel) {\n outputXKTModel(xktModel);\n }\n\n if (outputXKT) {\n outputXKT(xktContent);\n }\n\n if (outputStats) {\n outputStats(stats);\n }\n\n resolve();\n });\n }, (err) => {\n reject(err);\n });\n }\n });\n}\n\nexport {convert2xkt};","import '@loaders.gl/polyfills';\nimport {installFilePolyfills} from '@loaders.gl/polyfills';\n\ninstallFilePolyfills();\n\nexport * from \"./src/index.js\";\nexport {convert2xkt} from \"./src/convert2xkt.js\"; // convert2xkt is only bundled for Node.js\n"],"names":["root","factory","exports","module","define","amd","global","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","p","mat","mat2","mat3","xyz","tempVec3","vec","translate","scale","XKT_INFO","xktVersion","RepeatWrapping","ClampToEdgeWrapping","MirroredRepeatWrapping","NearestFilter","NearestMipMapNearestFilter","NearestMipmapNearestFilter","NearestMipmapLinearFilter","NearestMipMapLinearFilter","LinearFilter","LinearMipmapNearestFilter","LinearMipMapNearestFilter","LinearMipmapLinearFilter","LinearMipMapLinearFilter","GIFMediaType","JPEGMediaType","PNGMediaType","FloatArrayType","Float64Array","tempMat1","tempMat2","tempVec4","math","MIN_DOUBLE","Number","MAX_SAFE_INTEGER","MAX_DOUBLE","DEGTORAD","RADTODEG","vec2","values","vec3","vec4","mat3ToMat4","mat4","arguments","length","mat4ToMat3","createUUID","lut","i","toString","d0","Math","random","d1","d2","d3","concat","clamp","min","max","fmod","a","b","console","error","negateVec4","v","dest","addVec4","u","addVec4Scalar","s","addVec3","addVec3Scalar","subVec4","subVec3","subVec2","subVec4Scalar","subScalarVec4","mulVec4","mulVec4Scalar","mulVec3Scalar","mulVec2Scalar","divVec3","divVec4","divScalarVec3","divVec3Scalar","divVec4Scalar","divScalarVec4","dotVec4","cross3Vec4","u0","u1","u2","v0","v1","v2","cross3Vec3","x","y","z","x2","y2","z2","sqLenVec4","lenVec4","sqrt","dotVec3","dotVec2","sqLenVec3","sqLenVec2","lenVec3","distVec3","w","lenVec2","distVec2","rcpVec3","normalizeVec4","f","normalizeVec3","normalizeVec2","angleVec3","theta","acos","vec3FromMat4Scale","m","vecToArray","trunc","round","len","Array","slice","xyzArrayToObject","arr","xyzObjectToArray","arry","dupMat4","mat4To3","m4s","setMat4ToZeroes","setMat4ToOnes","diagonalMat4v","diagonalMat4c","diagonalMat4s","identityMat4","identityMat3","isIdentityMat4","negateMat4","addMat4","addMat4Scalar","addScalarMat4","subMat4","subMat4Scalar","subScalarMat4","mulMat4","a00","a01","a02","a03","a10","a11","a12","a13","a20","a21","a22","a23","a30","a31","a32","a33","b00","b01","b02","b03","b10","b11","b12","b13","b20","b21","b22","b23","b30","b31","b32","b33","mulMat3","mulMat4Scalar","mulMat4v4","v3","transposeMat4","m4","m14","m8","m13","m12","m9","transposeMat3","determinantMat4","inverseMat4","b04","b05","b06","b07","b08","b09","invDet","traceMat4","translationMat4v","translationMat3v","translationMat4c","translationMat4s","translateMat4v","translateMat4c","OLDtranslateMat4c","m15","m3","m7","m11","rotationMat4v","anglerad","axis","xy","yz","zx","xs","ys","zs","ax","sin","c","cos","q","rotationMat4c","scalingMat4v","scalingMat3v","scalingMat4c","scaleMat4c","scaleMat4v","scalingMat4s","rotationTranslationMat4","xx","xz","yy","zz","wx","wy","wz","mat4ToEuler","order","m21","m22","m23","m31","m32","m33","asin","abs","atan2","composeMat4","position","quaternion","quaternionToRotationMat4","decomposeMat4","matrix","sx","sy","sz","set","invSX","invSY","invSZ","mat4ToQuaternion","this","lookAtMat4v","pos","target","up","z0","z1","x0","x1","y0","y1","posx","posy","posz","upx","upy","upz","targetx","targety","targetz","lookAtMat4c","orthoMat4c","left","right","bottom","top","near","far","rl","tb","fn","frustumMat4v","fmin","fmax","fmin4","fmax4","t","tempMat20","tempMat21","tempMat22","frustumMat4","perspectiveMat4","fovyrad","aspectratio","znear","zfar","pmin","pmax","tan","transformPoint3","transformPoint4","transformPoints3","points","points2","p0","p1","p2","pi","result","m0","m1","m2","m5","m6","m10","transformPositions3","transformPositions4","transformVec3","transformVec4","rotateVec3X","rotateVec3Y","rotateVec3Z","projectVec4","unprojectVec3","viewMat","projMat","lerpVec3","t1","t2","flatten","leni","j","lenj","item","push","identityQuaternion","eulerToQuaternion","euler","c1","c2","c3","s1","s2","s3","trace","vec3PairToQuaternion","norm_u_norm_v","real_part","normalizeQuaternion","angleAxisToQuaternion","angleAxis","halfAngle","fsin","quaternionToEuler","mulQuaternions","p3","q0","q1","q2","q3","vec3ApplyQuaternion","qx","qy","qz","qw","ix","iy","iz","iw","quaternionToMat4","tx","ty","tz","twx","twy","twz","txx","txy","txz","tyy","tyz","tzz","conjugateQuaternion","inverseQuaternion","quaternionToAngleAxis","angle","AABB3","AABB2","OBB3","OBB2","Sphere3","transformOBB3","containsAABB3","aabb1","aabb2","getAABB3Diag","aabb","getAABB3DiagPoint","diagVec","xneg","xpos","yneg","ypos","zneg","zpos","getAABB3Center","getAABB2Center","collapseAABB3","AABB3ToOBB3","obb","positions3ToAABB3","positions","positionsDecodeMatrix","xmin","ymin","zmin","xmax","ymax","zmax","decompressPosition","OBB3ToAABB3","points3ToAABB3","points3ToSphere3","sphere","numPoints","dist","radius","positions3ToSphere3","tempVec3a","tempVec3b","lenPositions","numPositions","OBB3ToSphere3","point","lenPoints","getSphere3Center","expandAABB3","expandAABB3Point3","triangleNormal","normal","p1x","p1y","p1z","p2x","p2y","p2z","p3x","p3y","p3z","mag","octEncodeVec3","array","xfunc","yfunc","tempx","tempy","Int8Array","octDecodeVec2","oct","dot","uniquePositions","indicesLookup","indicesReverseLookup","weldedIndices","faces","numFaces","compa","compb","compc","cb","ab","cross","inverseNormal","geometryCompression","quantizePositions","quantizedPositions","maxInt","xMultiplier","yMultiplier","zMultiplier","verify","num","floor","compressPosition","multiplier","Float32Array","createPositionsDecodeMatrix","xwid","ywid","zwid","transformAndOctEncodeNormals","modelNormalMatrix","normals","lenNormals","compressedNormals","lenCompressedNormals","best","currentCos","bestCos","localNormal","worldNormal","octEncodeNormals","buildEdgeIndices","Uint16Array","indices","edgeThreshold","vx","vy","vz","positionsMap","precision","pow","lenUniquePositions","weldVertices","numIndices","ia","ib","ic","face","buildFaces","edge1","edge2","index1","index2","edge","normal1","normal2","edgeIndices","thresholdDot","edges","largeIndex","faceIndex","face1","face2","dot2","Uint32Array","isTriangleMeshSolid","vertexIndexMapping","compareIndexPositions","posA","posB","newIndices","sort","uniqueVertexIndex","a2","b2","temp","compareEdges","e1","e2","sameEdgeCount","XKTMesh","_createClass","cfg","_classCallCheck","meshId","meshIndex","geometry","color","metallic","roughness","opacity","textureSet","entity","XKTGeometry","geometryId","primitiveType","geometryIndex","numInstances","positionsQuantized","normalsOctEncoded","colorsCompressed","uvs","uvsCompressed","solid","XKTEntity","entityId","meshes","entityIndex","hasReusedGeometries","XKTTile","entities","KDNode","XKTMetaObject","metaObjectId","propertySetIds","metaObjectType","metaObjectName","parentMetaObjectId","XKTPropertySet","propertySetId","propertySetType","propertySetName","properties","XKTTexture","textureId","textureIndex","imageData","channel","width","height","src","compressed","mediaType","minFilter","magFilter","wrapS","wrapT","wrapR","XKTTextureSet","textureSetId","textureSetIndex","materialType","materialIndex","colorTexture","metallicRoughnessTexture","normalsTexture","emissiveTexture","occlusionTexture","_regeneratorRuntime","Op","hasOwn","desc","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","_typeof","__await","then","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","Error","done","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_defineProperties","props","descriptor","input","hint","prim","toPrimitive","res","String","_toPrimitive","tempVec4a","tempVec4b","tempMat4","tempMat4b","kdTreeDimLength","TEXTURE_ENCODING_OPTIONS","useSRGB","qualityLevel","encodeUASTC","mipmaps","XKTModel","instance","Constructor","modelId","projectId","revisionId","author","createdAt","creatingApplication","schema","minTileSize","modelAABB","propertySets","propertySetsList","metaObjects","metaObjectsList","reusedGeometriesDecodeMatrix","geometries","geometriesList","textures","texturesList","textureSets","textureSetsList","meshesList","entitiesList","tilesList","finalized","protoProps","_finalize","params","propertySet","metaObject","_rootMetaObject","fileExt","split","texture","colorTextureId","metallicRoughnessTextureId","normalsTextureId","emissiveTextureId","occlusionTextureId","triangles","lines","line_strip","_createDefaultIndices","colors","xktGeometryCfg","uv","Uint8Array","mergedPositions","mergedIndices","mergeVertices","rotation","mesh","meshIds","meshIdIdx","meshIdLen","warn","createMetaObject","_callee","rootKDNode","_context","log","_removeUnusedTextures","_compressTextures","_bakeSingleUseGeometryPositions","_bakeAndOctEncodeNormals","_createEntityAABBs","_createKDTree","_createTilesFromKDTree","_createReusedGeometriesDecodeMatrix","_flagSolidGeometries","args","apply","_this","countTextures","_loop","encodingOptions","load","ImageLoader","image","encode","KTX2BasisWriter","encodedData","encodedImageData","entityAABB","_insertEntityIntoKDTree","kdNode","nodeAABB","dim","aabbLeft","aabbRight","_createTilesFromKDNode","_createTileFromEntities","tileAABB","tileCenter","tileCenterNeg","rtcAABB","reused","k","lenk","tile","reusedGeometriesAABB","countReusedGeometries","numGeometries","maxNumPositions","maxNumIndices","XKT_VERSION","NUM_TEXTURE_ATTRIBUTES","NUM_MATERIAL_ATTRIBUTES","writeXKTModelToArrayBuffer","xktModel","metaModelJSON","stats","options","data","metaModelDataStr","numPropertySets","numMetaObjects","numTextures","numTextureSets","numMeshes","numEntities","numTiles","lenColors","lenUVs","lenIndices","lenEdgeIndices","lenMatrices","lenTextures","xktTexture","byteLength","numCompressedTextures","metadata","textureData","eachTextureDataPortion","eachTextureAttributes","eachTextureSetTextures","Int32Array","matrices","eachGeometryPrimitiveType","eachGeometryPositionsPortion","eachGeometryNormalsPortion","eachGeometryColorsPortion","eachGeometryUVsPortion","eachGeometryIndicesPortion","eachGeometryEdgeIndicesPortion","eachMeshGeometriesPortion","eachMeshMatricesPortion","eachMeshTextureSet","eachMeshMaterialAttributes","eachEntityId","eachEntityMeshesPortion","eachTileAABB","eachTileEntitiesPortion","countPositions","countNormals","countColors","countUVs","countIndices","countEdgeIndices","id","propertySetsIndex","propertySetJSON","metaObjectsIndex","metaObjectJSON","parent","external","portionIdx","textureAttrIdx","eachTextureSetTexturesIndex","countEntityMeshesPortion","eachMeshMaterialAttributesIndex","matricesIndex","tileIndex","tileEntities","numTileEntities","entityMeshes","numEntityMeshes","tileAABBIndex","getModelData","deflatedData","deflate","buffer","zip","pako","deflateJSON","JSON","stringify","replace","chr","charCodeAt","substr","deflateData","texturesSize","arrayBuffer","elements","indexData","dataLen","elementsize","indexBuf","dataArray","offset","element","toArrayBuffer","createArrayBuffer","strings","earcut","holeIndices","minX","minY","maxX","maxY","invSize","hasHoles","outerLen","outerNode","linkedList","list","queue","steiner","getLeftmost","compareX","eliminateHole","filterPoints","eliminateHoles","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","again","area","ear","pass","zOrder","prevZ","nextZ","e","tail","numMerges","pSize","qSize","inSize","sortLinked","indexCurve","isEarHashed","isEar","cureLocalIntersections","splitEarcut","pointInTriangle","minTX","minTY","maxTX","maxTY","minZ","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","hole","hx","hy","mx","my","tanMin","Infinity","sectorContainsSector","findHoleBridge","leftmost","ay","bx","by","cx","cy","px","py","intersectsPolygon","inside","middleInside","o1","sign","o2","o3","o4","onSegment","Node","an","bp","sum","deviation","polygonArea","trianglesArea","vertices","holes","dimensions","holeIndex","tempVec2a","tempVec3c","parseCityJSONIntoXKTModel","_ref","_ref$center","center","_ref$transform","transform","_ref$stats","vertices2","copyVertices","cityJSONTransform","vertex","transformVertices","centerVertices","customTransformVertices","sourceFormat","schemaVersion","version","title","created","numTriangles","numVertices","numObjects","rootMetaObjectId","modelMetaObjectId","ctx","msg","nextId","cityObjects","CityObjects","objectId","parseCityObject","parseCityJSON","centerPos","cityObject","parents","objectMaterial","surfaceMaterials","appearance","materials","geometryMaterial","material","themeIds","theme","surfaceMaterial","parseGeometrySurfacesWithOwnMaterials","parseGeometrySurfacesWithSharedMaterial","createEntity","parseSurfacesWithOwnMaterials","boundaries","shells","solids","surfaces","surface","diffuseColor","transparency","sharedIndices","geometryCfg","newFace","extractLocalIndices","_toConsumableArray","pList","getNormalOfPositions","pv","to2D","unshift","tr","createGeometry","createMesh","parseSurfacesWithSharedMaterial","primitiveCfg","boundary","newBoundary","index","includes","vertexIndex","indexOf","nexti","_p","_n","re","x3","tmp2","y3","utils","isString","parseGLTFIntoXKTModel","baseUri","metaModelData","_ref$includeTextures","includeTextures","_ref$includeNormals","includeNormals","getAttachment","numNormals","numUVs","parse","GLTFLoader","gltfData","metaModelCorrections","getMetaModelCorrections","geometryCreated","parseTexture","parseTextures","_textureSetId","parseTextureSet","_attributes","parseMaterialAttributes","parseMaterials","scene","scenes","nodes","countMeshUsage","parseNode","parseScene","parseDefaultScene","errMsg","eachRootStats","eachChildRoot","metaObjectsMap","metaObjectParent","rootMetaObject","numChildren","countChildren","source","sampler","createTexture","flipY","_textureId","textureSetCfg","normalTexture","normalTextureId","metallicPBR","pbrMetallicRoughness","baseColorTexture","extensions","specularPBR","specularTexture","specularColorTexture","createTextureSet","materialAttributes","diffuseFactor","common","technique","blinn","phong","lambert","diffuse","transparent","baseColorFactor","metallicFactor","roughnessFactor","node","instances","children","childNode","deferredMeshIds","depth","localMatrix","translation","numPrimitives","primitives","primitive","_xktGeometryId","xktGeometryId","mode","attributes","POSITION","NORMAL","COLOR_0","TEXCOORD_0","xktMeshId","meshCfg","nodeName","xktEntityId","rootMetaObjectStats","atob2","atob","Buffer","from","WEBGL_COMPONENT_TYPES","Int16Array","WEBGL_TYPE_SIZES","parseGLTFJSONIntoXKTModel","reuseGeometries","gltf","createXKTGeometryIds","nextMeshId","buffers","all","map","bufferInfo","_arrayBuffer","_buffer","uri","dataUriRegexResult","match","isBase64","decodeURIComponent","ArrayBuffer","view","parseArrayBuffer","parseBuffer","parseBuffers","bufferViewsInfo","bufferViews","parseBufferView","parseBufferViews","freeBuffers","materialsInfo","materialInfo","parseMaterial","_materialData","defaultSceneInfo","sceneInfo","glTFNode","bufferViewInfo","_typedArray","byteOffset","gltfMeshId","meshInfo","numPrimitivesInMesh","primitiveInfo","geometryHash","createPrimitiveGeometryHash","geometryArrays","parsePrimitiveGeometry","childNodeIdx","childGLTFNode","join","accessors","indicesIndex","accessorInfo","parseAccessorTypedArray","positionsIndex","normalsIndex","colorsIndex","bufferView","itemSize","TypedArray","componentType","itemBytes","BYTES_PER_ELEMENT","byteStride","count","parseIFCIntoXKTModel","WebIFC","_ref$autoNormals","autoNormals","includeTypes","excludeTypes","wasmPath","ifcAPI","IfcAPI","SetWasmPath","Init","modelID","OpenModel","ifcProjectId","GetLineIDsWithType","IFCPROJECT","GetLine","ifcProject","parseSpatialChildren","parseMetadata","flatMeshes","LoadAllGeometry","size","createObject","IFCSPACE","ifcSpaceId","flatMesh","GetFlatMesh","parseGeometry","IFCRELDEFINESBYPROPERTIES","relID","rel","relatingPropertyDefinition","RelatingPropertyDefinition","GlobalId","relatedObjects","RelatedObjects","HasProperties","Name","nominalValue","NominalValue","property","valueType","Description","description","createPropertySet","parsePropertySets","ifcElement","parseRelatedItemsOfType","expressID","IFCRELAGGREGATES","IFCRELCONTAINEDINSPATIALSTRUCTURE","relation","related","relatedItems","isArray","element2","flatMeshExpressID","placedGeometries","placedGeometry","geometryExpressID","GetGeometry","vertexData","GetVertexArray","GetVertexData","GetVertexDataSize","GetIndexArray","GetIndexData","GetIndexDataSize","flatTransformation","MAX_VERTICES","parseLASIntoXKTModel","_ref$colorDepth","colorDepth","_ref$fp","fp64","_ref$skip","skip","_ref$log","LASLoader","las","parsedData","loaderData","pointsFormatId","readAttributes","intensity","readIntensities","readColorsAndIntensities","pointsChunks","chunkArray","positionsValue","readPositions","colorsChunks","attributesPosition","attributesColor","attributesIntensity","colorSize","intensities","colorsCompressedSize","l","chunkSize","parseMetaModelIntoXKTModel","includeTypesMap","excludeTypesMap","newObject","countMetaObjects","parsePCDIntoXKTModel","_ref$littleEndian","littleEndian","textData","TextDecoder","decode","il","fromCharCode","escape","decodeText","header","result1","search","result2","exec","headerLen","str","fields","viewpoint","parseFloat","parseInt","sizeSum","rowSize","parseHeader","line","rgb","g","sizes","compressedSize","decompressedSize","decompressed","inData","outLength","ctrl","ref","inLength","outData","inPtr","outPtr","decompressLZF","dataview","DataView","getFloat32","getUint8","row","parsePLYIntoXKTModel","_x","_parsePLYIntoXKTModel","hasColors","colorsValue","PLYLoader","t0","parseSTLIntoXKTModel","_parseSTLIntoXKTModel","splitMeshes","smoothNormals","smoothNormalsAngleThreshold","binData","ensureBinary","isBinary","parseBinary","parseASCII","reader","getUint32","defaultR","defaultG","defaultB","lastR","lastG","lastB","newMesh","normalX","normalY","normalZ","packedColor","getUint16","vertexstart","addMesh","normalx","normaly","normalz","verticesPerFace","normalsPerFace","text","faceRegex","faceCounter","floatRegex","vertexRegex","RegExp","normalRegex","nextGeometryId","ni","acc","posi","vertexMap","vertexNormals","vertexNormalAccum","numVerts","ii","jj","faceToVertexNormals","buildBoxGeometry","xSize","ySize","zSize","centerX","centerY","centerZ","buildBoxLinesGeometry","buildCylinderGeometry","radiusTop","radiusBottom","radialSegments","heightSegments","h","currentRadius","currentHeight","first","second","startIndex","tu","tv","openEnded","heightHalf","heightLength","radialAngle","PI","radialLength","radiusChange","atan","buildGridGeometry","divisions","step","halfSize","buildPlaneGeometry","xSegments","zSegments","halfWidth","halfHeight","planeX","planeZ","planeX1","planeZ1","segmentWidth","segmentHeight","offset2","buildSphereGeometry","lod","widthSegments","sinTheta","cosTheta","phi","sinPhi","buildTorusGeometry","tube","tubeSegments","arc","letters","buildVectorTextGeometry","penUp","pointsLen","origin","xOrigin","yOrigin","zOrigin","trim","countVerts","iLine","buf","fs","path","convert2xkt","configs","sourceData","metaModelSource","output","outputXKTModel","outputXKT","_ref$reuseGeometries","_ref$minTileSize","outputStats","_ref$rotateX","rotateX","sourceSize","xktSize","compressionRatio","conversionTime","_log","startTime","Date","sourceConfigs","ext","fileName","extname","substring","getFileExtension","fileTypeConfigs","readFileSync","sourceFileSizeBytes","toFixed","overrideOption","convert","dirname","option1","option2","parser","converterParams","createDefaultMetaObjects","finalize","xktArrayBuffer","xktContent","targetFileSizeBytes","outputDir","existsSync","mkdirSync","recursive","writeFileSync","installFilePolyfills"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/ast/source/convert2xkt.js.json b/docs/ast/source/convert2xkt.js.json index c78b341..bb1c986 100644 --- a/docs/ast/source/convert2xkt.js.json +++ b/docs/ast/source/convert2xkt.js.json @@ -1,28 +1,28 @@ { "type": "File", "start": 0, - "end": 18153, + "end": 18394, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 439, + "line": 450, "column": 21 } }, "program": { "type": "Program", "start": 0, - "end": 18153, + "end": 18394, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 439, + "line": 450, "column": 21 } }, @@ -1133,14 +1133,14 @@ { "type": "Identifier", "start": 5090, - "end": 18130, + "end": 18371, "loc": { "start": { "line": 75, "column": 0 }, "end": { - "line": 437, + "line": 448, "column": 1 } }, @@ -2602,14 +2602,14 @@ "body": { "type": "BlockStatement", "start": 6004, - "end": 18130, + "end": 18371, "loc": { "start": { "line": 98, "column": 24 }, "end": { - "line": 437, + "line": 448, "column": 1 } }, @@ -4832,44 +4832,574 @@ } }, { - "type": "ReturnStatement", + "type": "FunctionDeclaration", "start": 6605, - "end": 18128, + "end": 6787, "loc": { "start": { "line": 123, "column": 4 }, "end": { - "line": 436, + "line": 129, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 6614, + "end": 6630, + "loc": { + "start": { + "line": 123, + "column": 13 + }, + "end": { + "line": 123, + "column": 29 + }, + "identifierName": "getFileExtension" + }, + "name": "getFileExtension" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6631, + "end": 6639, + "loc": { + "start": { + "line": 123, + "column": 30 + }, + "end": { + "line": 123, + "column": 38 + }, + "identifierName": "fileName" + }, + "name": "fileName" + } + ], + "body": { + "type": "BlockStatement", + "start": 6641, + "end": 6787, + "loc": { + "start": { + "line": 123, + "column": 40 + }, + "end": { + "line": 129, + "column": 5 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 6650, + "end": 6682, + "loc": { + "start": { + "line": 124, + "column": 7 + }, + "end": { + "line": 124, + "column": 39 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6654, + "end": 6681, + "loc": { + "start": { + "line": 124, + "column": 11 + }, + "end": { + "line": 124, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 6654, + "end": 6657, + "loc": { + "start": { + "line": 124, + "column": 11 + }, + "end": { + "line": 124, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "init": { + "type": "CallExpression", + "start": 6661, + "end": 6681, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 38 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6661, + "end": 6673, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 30 + } + }, + "object": { + "type": "Identifier", + "start": 6661, + "end": 6665, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 22 + }, + "identifierName": "path" + }, + "name": "path" + }, + "property": { + "type": "Identifier", + "start": 6666, + "end": 6673, + "loc": { + "start": { + "line": 124, + "column": 23 + }, + "end": { + "line": 124, + "column": 30 + }, + "identifierName": "extname" + }, + "name": "extname" + }, + "computed": false + }, + "arguments": [ + { + "type": "Identifier", + "start": 6674, + "end": 6680, + "loc": { + "start": { + "line": 124, + "column": 31 + }, + "end": { + "line": 124, + "column": 37 + }, + "identifierName": "source" + }, + "name": "source" + } + ] + } + } + ], + "kind": "let" + }, + { + "type": "IfStatement", + "start": 6690, + "end": 6762, + "loc": { + "start": { + "line": 125, + "column": 7 + }, + "end": { + "line": 127, + "column": 8 + } + }, + "test": { + "type": "BinaryExpression", + "start": 6694, + "end": 6715, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 32 + } + }, + "left": { + "type": "CallExpression", + "start": 6694, + "end": 6707, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 24 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6694, + "end": 6704, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 21 + } + }, + "object": { + "type": "Identifier", + "start": 6694, + "end": 6697, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "property": { + "type": "Identifier", + "start": 6698, + "end": 6704, + "loc": { + "start": { + "line": 125, + "column": 15 + }, + "end": { + "line": 125, + "column": 21 + }, + "identifierName": "charAt" + }, + "name": "charAt" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 6705, + "end": 6706, + "loc": { + "start": { + "line": 125, + "column": 22 + }, + "end": { + "line": 125, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + }, + "operator": "===", + "right": { + "type": "StringLiteral", + "start": 6712, + "end": 6715, + "loc": { + "start": { + "line": 125, + "column": 29 + }, + "end": { + "line": 125, + "column": 32 + } + }, + "extra": { + "rawValue": ".", + "raw": "\".\"" + }, + "value": "." + } + }, + "consequent": { + "type": "BlockStatement", + "start": 6717, + "end": 6762, + "loc": { + "start": { + "line": 125, + "column": 34 + }, + "end": { + "line": 127, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6730, + "end": 6753, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 34 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 6730, + "end": 6752, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 33 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 6730, + "end": 6733, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "right": { + "type": "CallExpression", + "start": 6736, + "end": 6752, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 33 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6736, + "end": 6749, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 30 + } + }, + "object": { + "type": "Identifier", + "start": 6736, + "end": 6739, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 20 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "property": { + "type": "Identifier", + "start": 6740, + "end": 6749, + "loc": { + "start": { + "line": 126, + "column": 21 + }, + "end": { + "line": 126, + "column": 30 + }, + "identifierName": "substring" + }, + "name": "substring" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 6750, + "end": 6751, + "loc": { + "start": { + "line": 126, + "column": 31 + }, + "end": { + "line": 126, + "column": 32 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + } + ], + "directives": [] + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "start": 6770, + "end": 6781, + "loc": { + "start": { + "line": 128, + "column": 7 + }, + "end": { + "line": 128, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 6777, + "end": 6780, + "loc": { + "start": { + "line": 128, + "column": 14 + }, + "end": { + "line": 128, + "column": 17 + }, + "identifierName": "ext" + }, + "name": "ext" + } + } + ], + "directives": [] + } + }, + { + "type": "ReturnStatement", + "start": 6793, + "end": 18369, + "loc": { + "start": { + "line": 131, + "column": 4 + }, + "end": { + "line": 447, "column": 7 } }, "argument": { "type": "NewExpression", - "start": 6612, - "end": 18127, + "start": 6800, + "end": 18368, "loc": { "start": { - "line": 123, + "line": 131, "column": 11 }, "end": { - "line": 436, + "line": 447, "column": 6 } }, "callee": { "type": "Identifier", - "start": 6616, - "end": 6623, + "start": 6804, + "end": 6811, "loc": { "start": { - "line": 123, + "line": 131, "column": 15 }, "end": { - "line": 123, + "line": 131, "column": 22 }, "identifierName": "Promise" @@ -4879,15 +5409,15 @@ "arguments": [ { "type": "FunctionExpression", - "start": 6624, - "end": 18126, + "start": 6812, + "end": 18367, "loc": { "start": { - "line": 123, + "line": 131, "column": 23 }, "end": { - "line": 436, + "line": 447, "column": 5 } }, @@ -4898,15 +5428,15 @@ "params": [ { "type": "Identifier", - "start": 6634, - "end": 6641, + "start": 6822, + "end": 6829, "loc": { "start": { - "line": 123, + "line": 131, "column": 33 }, "end": { - "line": 123, + "line": 131, "column": 40 }, "identifierName": "resolve" @@ -4915,15 +5445,15 @@ }, { "type": "Identifier", - "start": 6643, - "end": 6649, + "start": 6831, + "end": 6837, "loc": { "start": { - "line": 123, + "line": 131, "column": 42 }, "end": { - "line": 123, + "line": 131, "column": 48 }, "identifierName": "reject" @@ -4933,59 +5463,59 @@ ], "body": { "type": "BlockStatement", - "start": 6651, - "end": 18126, + "start": 6839, + "end": 18367, "loc": { "start": { - "line": 123, + "line": 131, "column": 50 }, "end": { - "line": 436, + "line": 447, "column": 5 } }, "body": [ { "type": "VariableDeclaration", - "start": 6661, - "end": 6678, + "start": 6849, + "end": 6866, "loc": { "start": { - "line": 124, + "line": 132, "column": 8 }, "end": { - "line": 124, + "line": 132, "column": 25 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 6667, - "end": 6677, + "start": 6855, + "end": 6865, "loc": { "start": { - "line": 124, + "line": 132, "column": 14 }, "end": { - "line": 124, + "line": 132, "column": 24 } }, "id": { "type": "Identifier", - "start": 6667, - "end": 6671, + "start": 6855, + "end": 6859, "loc": { "start": { - "line": 124, + "line": 132, "column": 14 }, "end": { - "line": 124, + "line": 132, "column": 18 }, "identifierName": "_log" @@ -4994,15 +5524,15 @@ }, "init": { "type": "Identifier", - "start": 6674, - "end": 6677, + "start": 6862, + "end": 6865, "loc": { "start": { - "line": 124, + "line": 132, "column": 21 }, "end": { - "line": 124, + "line": 132, "column": 24 }, "identifierName": "log" @@ -5015,44 +5545,44 @@ }, { "type": "ExpressionStatement", - "start": 6687, - "end": 6754, + "start": 6875, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "expression": { "type": "AssignmentExpression", - "start": 6687, - "end": 6754, + "start": 6875, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "operator": "=", "left": { "type": "Identifier", - "start": 6687, - "end": 6690, + "start": 6875, + "end": 6878, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 125, + "line": 133, "column": 11 }, "identifierName": "log" @@ -5061,15 +5591,15 @@ }, "right": { "type": "ArrowFunctionExpression", - "start": 6693, - "end": 6754, + "start": 6881, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 14 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, @@ -5080,15 +5610,15 @@ "params": [ { "type": "Identifier", - "start": 6694, - "end": 6697, + "start": 6882, + "end": 6885, "loc": { "start": { - "line": 125, + "line": 133, "column": 15 }, "end": { - "line": 125, + "line": 133, "column": 18 }, "identifierName": "msg" @@ -5098,58 +5628,58 @@ ], "body": { "type": "BlockStatement", - "start": 6702, - "end": 6754, + "start": 6890, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 23 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6716, - "end": 6744, + "start": 6904, + "end": 6932, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 40 } }, "expression": { "type": "CallExpression", - "start": 6716, - "end": 6744, + "start": 6904, + "end": 6932, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 40 } }, "callee": { "type": "Identifier", - "start": 6716, - "end": 6720, + "start": 6904, + "end": 6908, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 16 }, "identifierName": "_log" @@ -5159,30 +5689,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 6721, - "end": 6743, + "start": 6909, + "end": 6931, "loc": { "start": { - "line": 126, + "line": 134, "column": 17 }, "end": { - "line": 126, + "line": 134, "column": 39 } }, "expressions": [ { "type": "Identifier", - "start": 6738, - "end": 6741, + "start": 6926, + "end": 6929, "loc": { "start": { - "line": 126, + "line": 134, "column": 34 }, "end": { - "line": 126, + "line": 134, "column": 37 }, "identifierName": "msg" @@ -5193,15 +5723,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 6722, - "end": 6736, + "start": 6910, + "end": 6924, "loc": { "start": { - "line": 126, + "line": 134, "column": 18 }, "end": { - "line": 126, + "line": 134, "column": 32 } }, @@ -5213,15 +5743,15 @@ }, { "type": "TemplateElement", - "start": 6742, - "end": 6742, + "start": 6930, + "end": 6930, "loc": { "start": { - "line": 126, + "line": 134, "column": 38 }, "end": { - "line": 126, + "line": 134, "column": 38 } }, @@ -5244,43 +5774,43 @@ }, { "type": "IfStatement", - "start": 6764, - "end": 6886, + "start": 6952, + "end": 7074, "loc": { "start": { - "line": 129, + "line": 137, "column": 8 }, "end": { - "line": 132, + "line": 140, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 6768, - "end": 6790, + "start": 6956, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 12 }, "end": { - "line": 129, + "line": 137, "column": 34 } }, "left": { "type": "UnaryExpression", - "start": 6768, - "end": 6775, + "start": 6956, + "end": 6963, "loc": { "start": { - "line": 129, + "line": 137, "column": 12 }, "end": { - "line": 129, + "line": 137, "column": 19 } }, @@ -5288,15 +5818,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6769, - "end": 6775, + "start": 6957, + "end": 6963, "loc": { "start": { - "line": 129, + "line": 137, "column": 13 }, "end": { - "line": 129, + "line": 137, "column": 19 }, "identifierName": "source" @@ -5310,15 +5840,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 6779, - "end": 6790, + "start": 6967, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 23 }, "end": { - "line": 129, + "line": 137, "column": 34 } }, @@ -5326,15 +5856,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6780, - "end": 6790, + "start": 6968, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 24 }, "end": { - "line": 129, + "line": 137, "column": 34 }, "identifierName": "sourceData" @@ -5348,58 +5878,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 6792, - "end": 6886, + "start": 6980, + "end": 7074, "loc": { "start": { - "line": 129, + "line": 137, "column": 36 }, "end": { - "line": 132, + "line": 140, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6806, - "end": 6856, + "start": 6994, + "end": 7044, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 62 } }, "expression": { "type": "CallExpression", - "start": 6806, - "end": 6855, + "start": 6994, + "end": 7043, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 61 } }, "callee": { "type": "Identifier", - "start": 6806, - "end": 6812, + "start": 6994, + "end": 7000, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 18 }, "identifierName": "reject" @@ -5409,15 +5939,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6813, - "end": 6854, + "start": 7001, + "end": 7042, "loc": { "start": { - "line": 130, + "line": 138, "column": 19 }, "end": { - "line": 130, + "line": 138, "column": 60 } }, @@ -5432,15 +5962,15 @@ }, { "type": "ReturnStatement", - "start": 6869, - "end": 6876, + "start": 7057, + "end": 7064, "loc": { "start": { - "line": 131, + "line": 139, "column": 12 }, "end": { - "line": 131, + "line": 139, "column": 19 } }, @@ -5453,43 +5983,43 @@ }, { "type": "IfStatement", - "start": 6896, - "end": 7043, + "start": 7084, + "end": 7231, "loc": { "start": { - "line": 134, + "line": 142, "column": 8 }, "end": { - "line": 137, + "line": 145, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 6900, - "end": 6927, + "start": 7088, + "end": 7115, "loc": { "start": { - "line": 134, + "line": 142, "column": 12 }, "end": { - "line": 134, + "line": 142, "column": 39 } }, "left": { "type": "UnaryExpression", - "start": 6900, - "end": 6913, + "start": 7088, + "end": 7101, "loc": { "start": { - "line": 134, + "line": 142, "column": 12 }, "end": { - "line": 134, + "line": 142, "column": 25 } }, @@ -5497,15 +6027,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6901, - "end": 6913, + "start": 7089, + "end": 7101, "loc": { "start": { - "line": 134, + "line": 142, "column": 13 }, "end": { - "line": 134, + "line": 142, "column": 25 }, "identifierName": "sourceFormat" @@ -5519,15 +6049,15 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 6917, - "end": 6927, + "start": 7105, + "end": 7115, "loc": { "start": { - "line": 134, + "line": 142, "column": 29 }, "end": { - "line": 134, + "line": 142, "column": 39 }, "identifierName": "sourceData" @@ -5537,58 +6067,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 6929, - "end": 7043, + "start": 7117, + "end": 7231, "loc": { "start": { - "line": 134, + "line": 142, "column": 41 }, "end": { - "line": 137, + "line": 145, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6943, - "end": 7013, + "start": 7131, + "end": 7201, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 82 } }, "expression": { "type": "CallExpression", - "start": 6943, - "end": 7012, + "start": 7131, + "end": 7200, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 81 } }, "callee": { "type": "Identifier", - "start": 6943, - "end": 6949, + "start": 7131, + "end": 7137, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 18 }, "identifierName": "reject" @@ -5598,15 +6128,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6950, - "end": 7011, + "start": 7138, + "end": 7199, "loc": { "start": { - "line": 135, + "line": 143, "column": 19 }, "end": { - "line": 135, + "line": 143, "column": 80 } }, @@ -5621,15 +6151,15 @@ }, { "type": "ReturnStatement", - "start": 7026, - "end": 7033, + "start": 7214, + "end": 7221, "loc": { "start": { - "line": 136, + "line": 144, "column": 12 }, "end": { - "line": 136, + "line": 144, "column": 19 } }, @@ -5642,57 +6172,57 @@ }, { "type": "IfStatement", - "start": 7053, - "end": 7208, + "start": 7241, + "end": 7396, "loc": { "start": { - "line": 139, + "line": 147, "column": 8 }, "end": { - "line": 142, + "line": 150, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 7057, - "end": 7097, + "start": 7245, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 52 } }, "left": { "type": "LogicalExpression", - "start": 7057, - "end": 7083, + "start": 7245, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 38 } }, "left": { "type": "UnaryExpression", - "start": 7057, - "end": 7064, + "start": 7245, + "end": 7252, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 19 } }, @@ -5700,15 +6230,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7058, - "end": 7064, + "start": 7246, + "end": 7252, "loc": { "start": { - "line": 139, + "line": 147, "column": 13 }, "end": { - "line": 139, + "line": 147, "column": 19 }, "identifierName": "output" @@ -5722,15 +6252,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 7068, - "end": 7083, + "start": 7256, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 23 }, "end": { - "line": 139, + "line": 147, "column": 38 } }, @@ -5738,15 +6268,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7069, - "end": 7083, + "start": 7257, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 24 }, "end": { - "line": 139, + "line": 147, "column": 38 }, "identifierName": "outputXKTModel" @@ -5761,15 +6291,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 7087, - "end": 7097, + "start": 7275, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 42 }, "end": { - "line": 139, + "line": 147, "column": 52 } }, @@ -5777,15 +6307,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7088, - "end": 7097, + "start": 7276, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 43 }, "end": { - "line": 139, + "line": 147, "column": 52 }, "identifierName": "outputXKT" @@ -5799,58 +6329,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7099, - "end": 7208, + "start": 7287, + "end": 7396, "loc": { "start": { - "line": 139, + "line": 147, "column": 54 }, "end": { - "line": 142, + "line": 150, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7113, - "end": 7178, + "start": 7301, + "end": 7366, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 77 } }, "expression": { "type": "CallExpression", - "start": 7113, - "end": 7177, + "start": 7301, + "end": 7365, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 76 } }, "callee": { "type": "Identifier", - "start": 7113, - "end": 7119, + "start": 7301, + "end": 7307, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 18 }, "identifierName": "reject" @@ -5860,15 +6390,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 7120, - "end": 7176, + "start": 7308, + "end": 7364, "loc": { "start": { - "line": 140, + "line": 148, "column": 19 }, "end": { - "line": 140, + "line": 148, "column": 75 } }, @@ -5883,15 +6413,15 @@ }, { "type": "ReturnStatement", - "start": 7191, - "end": 7198, + "start": 7379, + "end": 7386, "loc": { "start": { - "line": 141, + "line": 149, "column": 12 }, "end": { - "line": 141, + "line": 149, "column": 19 } }, @@ -5904,29 +6434,29 @@ }, { "type": "IfStatement", - "start": 7218, - "end": 7291, + "start": 7406, + "end": 7479, "loc": { "start": { - "line": 144, + "line": 152, "column": 8 }, "end": { - "line": 146, + "line": 154, "column": 9 } }, "test": { "type": "Identifier", - "start": 7222, - "end": 7228, + "start": 7410, + "end": 7416, "loc": { "start": { - "line": 144, + "line": 152, "column": 12 }, "end": { - "line": 144, + "line": 152, "column": 18 }, "identifierName": "source" @@ -5935,58 +6465,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7230, - "end": 7291, + "start": 7418, + "end": 7479, "loc": { "start": { - "line": 144, + "line": 152, "column": 20 }, "end": { - "line": 146, + "line": 154, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7244, - "end": 7281, + "start": 7432, + "end": 7469, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 7244, - "end": 7280, + "start": 7432, + "end": 7468, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 48 } }, "callee": { "type": "Identifier", - "start": 7244, - "end": 7247, + "start": 7432, + "end": 7435, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 15 }, "identifierName": "log" @@ -5996,29 +6526,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 7248, - "end": 7279, + "start": 7436, + "end": 7467, "loc": { "start": { - "line": 145, + "line": 153, "column": 16 }, "end": { - "line": 145, + "line": 153, "column": 47 } }, "left": { "type": "StringLiteral", - "start": 7248, - "end": 7270, + "start": 7436, + "end": 7458, "loc": { "start": { - "line": 145, + "line": 153, "column": 16 }, "end": { - "line": 145, + "line": 153, "column": 38 } }, @@ -6031,15 +6561,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 7273, - "end": 7279, + "start": 7461, + "end": 7467, "loc": { "start": { - "line": 145, + "line": 153, "column": 41 }, "end": { - "line": 145, + "line": 153, "column": 47 }, "identifierName": "source" @@ -6057,44 +6587,44 @@ }, { "type": "VariableDeclaration", - "start": 7301, - "end": 7330, + "start": 7489, + "end": 7518, "loc": { "start": { - "line": 148, + "line": 156, "column": 8 }, "end": { - "line": 148, + "line": 156, "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7307, - "end": 7329, + "start": 7495, + "end": 7517, "loc": { "start": { - "line": 148, + "line": 156, "column": 14 }, "end": { - "line": 148, + "line": 156, "column": 36 } }, "id": { "type": "Identifier", - "start": 7307, - "end": 7316, + "start": 7495, + "end": 7504, "loc": { "start": { - "line": 148, + "line": 156, "column": 14 }, "end": { - "line": 148, + "line": 156, "column": 23 }, "identifierName": "startTime" @@ -6103,29 +6633,29 @@ }, "init": { "type": "NewExpression", - "start": 7319, - "end": 7329, + "start": 7507, + "end": 7517, "loc": { "start": { - "line": 148, + "line": 156, "column": 26 }, "end": { - "line": 148, + "line": 156, "column": 36 } }, "callee": { "type": "Identifier", - "start": 7323, - "end": 7327, + "start": 7511, + "end": 7515, "loc": { "start": { - "line": 148, + "line": 156, "column": 30 }, "end": { - "line": 148, + "line": 156, "column": 34 }, "identifierName": "Date" @@ -6140,44 +6670,44 @@ }, { "type": "VariableDeclaration", - "start": 7340, - "end": 7390, + "start": 7528, + "end": 7578, "loc": { "start": { - "line": 150, + "line": 158, "column": 8 }, "end": { - "line": 150, + "line": 158, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7346, - "end": 7389, + "start": 7534, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 14 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, "id": { "type": "Identifier", - "start": 7346, - "end": 7359, + "start": 7534, + "end": 7547, "loc": { "start": { - "line": 150, + "line": 158, "column": 14 }, "end": { - "line": 150, + "line": 158, "column": 27 }, "identifierName": "sourceConfigs" @@ -6186,43 +6716,43 @@ }, "init": { "type": "LogicalExpression", - "start": 7362, - "end": 7389, + "start": 7550, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, "left": { "type": "MemberExpression", - "start": 7362, - "end": 7383, + "start": 7550, + "end": 7571, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 51 } }, "object": { "type": "Identifier", - "start": 7362, - "end": 7369, + "start": 7550, + "end": 7557, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 37 }, "identifierName": "configs" @@ -6231,15 +6761,15 @@ }, "property": { "type": "Identifier", - "start": 7370, - "end": 7383, + "start": 7558, + "end": 7571, "loc": { "start": { - "line": 150, + "line": 158, "column": 38 }, "end": { - "line": 150, + "line": 158, "column": 51 }, "identifierName": "sourceConfigs" @@ -6251,15 +6781,15 @@ "operator": "||", "right": { "type": "ObjectExpression", - "start": 7387, - "end": 7389, + "start": 7575, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 55 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, @@ -6272,44 +6802,44 @@ }, { "type": "VariableDeclaration", - "start": 7399, - "end": 7448, + "start": 7587, + "end": 7640, "loc": { "start": { - "line": 151, + "line": 159, "column": 8 }, "end": { - "line": 151, - "column": 57 + "line": 159, + "column": 61 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7405, - "end": 7447, + "start": 7593, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 14 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "id": { "type": "Identifier", - "start": 7405, - "end": 7408, + "start": 7593, + "end": 7596, "loc": { "start": { - "line": 151, + "line": 159, "column": 14 }, "end": { - "line": 151, + "line": 159, "column": 17 }, "identifierName": "ext" @@ -6318,29 +6848,29 @@ }, "init": { "type": "LogicalExpression", - "start": 7411, - "end": 7447, + "start": 7599, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 20 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "left": { "type": "Identifier", - "start": 7411, - "end": 7423, + "start": 7599, + "end": 7611, "loc": { "start": { - "line": 151, + "line": 159, "column": 20 }, "end": { - "line": 151, + "line": 159, "column": 32 }, "identifierName": "sourceFormat" @@ -6350,81 +6880,48 @@ "operator": "||", "right": { "type": "CallExpression", - "start": 7427, - "end": 7447, + "start": 7615, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 36 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "callee": { - "type": "MemberExpression", - "start": 7427, - "end": 7439, + "type": "Identifier", + "start": 7615, + "end": 7631, "loc": { "start": { - "line": 151, + "line": 159, "column": 36 }, "end": { - "line": 151, - "column": 48 - } - }, - "object": { - "type": "Identifier", - "start": 7427, - "end": 7431, - "loc": { - "start": { - "line": 151, - "column": 36 - }, - "end": { - "line": 151, - "column": 40 - }, - "identifierName": "path" - }, - "name": "path" - }, - "property": { - "type": "Identifier", - "start": 7432, - "end": 7439, - "loc": { - "start": { - "line": 151, - "column": 41 - }, - "end": { - "line": 151, - "column": 48 - }, - "identifierName": "extname" + "line": 159, + "column": 52 }, - "name": "extname" + "identifierName": "getFileExtension" }, - "computed": false + "name": "getFileExtension" }, "arguments": [ { "type": "Identifier", - "start": 7440, - "end": 7446, + "start": 7632, + "end": 7638, "loc": { "start": { - "line": 151, - "column": 49 + "line": 159, + "column": 53 }, "end": { - "line": 151, - "column": 55 + "line": 159, + "column": 59 }, "identifierName": "source" }, @@ -6437,46 +6934,171 @@ ], "kind": "const" }, + { + "type": "ExpressionStatement", + "start": 7650, + "end": 7688, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 46 + } + }, + "expression": { + "type": "CallExpression", + "start": 7650, + "end": 7687, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 45 + } + }, + "callee": { + "type": "Identifier", + "start": 7650, + "end": 7653, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 11 + }, + "identifierName": "log" + }, + "name": "log" + }, + "arguments": [ + { + "type": "TemplateLiteral", + "start": 7654, + "end": 7686, + "loc": { + "start": { + "line": 161, + "column": 12 + }, + "end": { + "line": 161, + "column": 44 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 7680, + "end": 7683, + "loc": { + "start": { + "line": 161, + "column": 38 + }, + "end": { + "line": 161, + "column": 41 + }, + "identifierName": "ext" + }, + "name": "ext" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 7655, + "end": 7678, + "loc": { + "start": { + "line": 161, + "column": 13 + }, + "end": { + "line": 161, + "column": 36 + } + }, + "value": { + "raw": "Input file extension: \"", + "cooked": "Input file extension: \"" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 7684, + "end": 7685, + "loc": { + "start": { + "line": 161, + "column": 42 + }, + "end": { + "line": 161, + "column": 43 + } + }, + "value": { + "raw": "\"", + "cooked": "\"" + }, + "tail": true + } + ] + } + ] + } + }, { "type": "VariableDeclaration", - "start": 7457, - "end": 7498, + "start": 7698, + "end": 7739, "loc": { "start": { - "line": 152, + "line": 163, "column": 8 }, "end": { - "line": 152, + "line": 163, "column": 49 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7461, - "end": 7497, + "start": 7702, + "end": 7738, "loc": { "start": { - "line": 152, + "line": 163, "column": 12 }, "end": { - "line": 152, + "line": 163, "column": 48 } }, "id": { "type": "Identifier", - "start": 7461, - "end": 7476, + "start": 7702, + "end": 7717, "loc": { "start": { - "line": 152, + "line": 163, "column": 12 }, "end": { - "line": 152, + "line": 163, "column": 27 }, "identifierName": "fileTypeConfigs" @@ -6485,29 +7107,29 @@ }, "init": { "type": "MemberExpression", - "start": 7479, - "end": 7497, + "start": 7720, + "end": 7738, "loc": { "start": { - "line": 152, + "line": 163, "column": 30 }, "end": { - "line": 152, + "line": 163, "column": 48 } }, "object": { "type": "Identifier", - "start": 7479, - "end": 7492, + "start": 7720, + "end": 7733, "loc": { "start": { - "line": 152, + "line": 163, "column": 30 }, "end": { - "line": 152, + "line": 163, "column": 43 }, "identifierName": "sourceConfigs" @@ -6516,15 +7138,15 @@ }, "property": { "type": "Identifier", - "start": 7493, - "end": 7496, + "start": 7734, + "end": 7737, "loc": { "start": { - "line": 152, + "line": 163, "column": 44 }, "end": { - "line": 152, + "line": 163, "column": 47 }, "identifierName": "ext" @@ -6539,29 +7161,29 @@ }, { "type": "IfStatement", - "start": 7508, - "end": 7764, + "start": 7749, + "end": 8005, "loc": { "start": { - "line": 154, + "line": 165, "column": 8 }, "end": { - "line": 157, + "line": 168, "column": 9 } }, "test": { "type": "UnaryExpression", - "start": 7512, - "end": 7528, + "start": 7753, + "end": 7769, "loc": { "start": { - "line": 154, + "line": 165, "column": 12 }, "end": { - "line": 154, + "line": 165, "column": 28 } }, @@ -6569,15 +7191,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7513, - "end": 7528, + "start": 7754, + "end": 7769, "loc": { "start": { - "line": 154, + "line": 165, "column": 13 }, "end": { - "line": 154, + "line": 165, "column": 28 }, "identifierName": "fileTypeConfigs" @@ -6590,58 +7212,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7530, - "end": 7764, + "start": 7771, + "end": 8005, "loc": { "start": { - "line": 154, + "line": 165, "column": 30 }, "end": { - "line": 157, + "line": 168, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7544, - "end": 7720, + "start": 7785, + "end": 7961, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 188 } }, "expression": { "type": "CallExpression", - "start": 7544, - "end": 7719, + "start": 7785, + "end": 7960, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 187 } }, "callee": { "type": "Identifier", - "start": 7544, - "end": 7547, + "start": 7785, + "end": 7788, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 15 }, "identifierName": "log" @@ -6651,30 +7273,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 7548, - "end": 7718, + "start": 7789, + "end": 7959, "loc": { "start": { - "line": 155, + "line": 166, "column": 16 }, "end": { - "line": 155, + "line": 166, "column": 186 } }, "expressions": [ { "type": "Identifier", - "start": 7623, - "end": 7626, + "start": 7864, + "end": 7867, "loc": { "start": { - "line": 155, + "line": 166, "column": 91 }, "end": { - "line": 155, + "line": 166, "column": 94 }, "identifierName": "ext" @@ -6685,15 +7307,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 7549, - "end": 7621, + "start": 7790, + "end": 7862, "loc": { "start": { - "line": 155, + "line": 166, "column": 17 }, "end": { - "line": 155, + "line": 166, "column": 89 } }, @@ -6705,15 +7327,15 @@ }, { "type": "TemplateElement", - "start": 7627, - "end": 7717, + "start": 7868, + "end": 7958, "loc": { "start": { - "line": 155, + "line": 166, "column": 95 }, "end": { - "line": 155, + "line": 166, "column": 185 } }, @@ -6730,44 +7352,44 @@ }, { "type": "ExpressionStatement", - "start": 7733, - "end": 7754, + "start": 7974, + "end": 7995, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 33 } }, "expression": { "type": "AssignmentExpression", - "start": 7733, - "end": 7753, + "start": 7974, + "end": 7994, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 32 } }, "operator": "=", "left": { "type": "Identifier", - "start": 7733, - "end": 7748, + "start": 7974, + "end": 7989, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 27 }, "identifierName": "fileTypeConfigs" @@ -6776,15 +7398,15 @@ }, "right": { "type": "ObjectExpression", - "start": 7751, - "end": 7753, + "start": 7992, + "end": 7994, "loc": { "start": { - "line": 156, + "line": 167, "column": 30 }, "end": { - "line": 156, + "line": 167, "column": 32 } }, @@ -6799,29 +7421,29 @@ }, { "type": "FunctionDeclaration", - "start": 7773, - "end": 7941, + "start": 8014, + "end": 8182, "loc": { "start": { - "line": 158, + "line": 169, "column": 8 }, "end": { - "line": 163, + "line": 174, "column": 9 } }, "id": { "type": "Identifier", - "start": 7782, - "end": 7796, + "start": 8023, + "end": 8037, "loc": { "start": { - "line": 158, + "line": 169, "column": 17 }, "end": { - "line": 158, + "line": 169, "column": 31 }, "identifierName": "overrideOption" @@ -6834,15 +7456,15 @@ "params": [ { "type": "Identifier", - "start": 7797, - "end": 7804, + "start": 8038, + "end": 8045, "loc": { "start": { - "line": 158, + "line": 169, "column": 32 }, "end": { - "line": 158, + "line": 169, "column": 39 }, "identifierName": "option1" @@ -6851,15 +7473,15 @@ }, { "type": "Identifier", - "start": 7806, - "end": 7813, + "start": 8047, + "end": 8054, "loc": { "start": { - "line": 158, + "line": 169, "column": 41 }, "end": { - "line": 158, + "line": 169, "column": 48 }, "identifierName": "option2" @@ -6869,58 +7491,58 @@ ], "body": { "type": "BlockStatement", - "start": 7815, - "end": 7941, + "start": 8056, + "end": 8182, "loc": { "start": { - "line": 158, + "line": 169, "column": 50 }, "end": { - "line": 163, + "line": 174, "column": 9 } }, "body": [ { "type": "IfStatement", - "start": 7829, - "end": 7903, + "start": 8070, + "end": 8144, "loc": { "start": { - "line": 159, + "line": 170, "column": 12 }, "end": { - "line": 161, + "line": 172, "column": 13 } }, "test": { "type": "BinaryExpression", - "start": 7833, - "end": 7854, + "start": 8074, + "end": 8095, "loc": { "start": { - "line": 159, + "line": 170, "column": 16 }, "end": { - "line": 159, + "line": 170, "column": 37 } }, "left": { "type": "Identifier", - "start": 7833, - "end": 7840, + "start": 8074, + "end": 8081, "loc": { "start": { - "line": 159, + "line": 170, "column": 16 }, "end": { - "line": 159, + "line": 170, "column": 23 }, "identifierName": "option1" @@ -6930,15 +7552,15 @@ "operator": "!==", "right": { "type": "Identifier", - "start": 7845, - "end": 7854, + "start": 8086, + "end": 8095, "loc": { "start": { - "line": 159, + "line": 170, "column": 28 }, "end": { - "line": 159, + "line": 170, "column": 37 }, "identifierName": "undefined" @@ -6948,44 +7570,44 @@ }, "consequent": { "type": "BlockStatement", - "start": 7856, - "end": 7903, + "start": 8097, + "end": 8144, "loc": { "start": { - "line": 159, + "line": 170, "column": 39 }, "end": { - "line": 161, + "line": 172, "column": 13 } }, "body": [ { "type": "ReturnStatement", - "start": 7874, - "end": 7889, + "start": 8115, + "end": 8130, "loc": { "start": { - "line": 160, + "line": 171, "column": 16 }, "end": { - "line": 160, + "line": 171, "column": 31 } }, "argument": { "type": "Identifier", - "start": 7881, - "end": 7888, + "start": 8122, + "end": 8129, "loc": { "start": { - "line": 160, + "line": 171, "column": 23 }, "end": { - "line": 160, + "line": 171, "column": 30 }, "identifierName": "option1" @@ -7000,29 +7622,29 @@ }, { "type": "ReturnStatement", - "start": 7916, - "end": 7931, + "start": 8157, + "end": 8172, "loc": { "start": { - "line": 162, + "line": 173, "column": 12 }, "end": { - "line": 162, + "line": 173, "column": 27 } }, "argument": { "type": "Identifier", - "start": 7923, - "end": 7930, + "start": 8164, + "end": 8171, "loc": { "start": { - "line": 162, + "line": 173, "column": 19 }, "end": { - "line": 162, + "line": 173, "column": 26 }, "identifierName": "option2" @@ -7036,29 +7658,29 @@ }, { "type": "IfStatement", - "start": 7951, - "end": 8146, + "start": 8192, + "end": 8387, "loc": { "start": { - "line": 165, + "line": 176, "column": 8 }, "end": { - "line": 172, + "line": 183, "column": 9 } }, "test": { "type": "UnaryExpression", - "start": 7955, - "end": 7966, + "start": 8196, + "end": 8207, "loc": { "start": { - "line": 165, + "line": 176, "column": 12 }, "end": { - "line": 165, + "line": 176, "column": 23 } }, @@ -7066,15 +7688,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7956, - "end": 7966, + "start": 8197, + "end": 8207, "loc": { "start": { - "line": 165, + "line": 176, "column": 13 }, "end": { - "line": 165, + "line": 176, "column": 23 }, "identifierName": "sourceData" @@ -7087,88 +7709,88 @@ }, "consequent": { "type": "BlockStatement", - "start": 7968, - "end": 8146, + "start": 8209, + "end": 8387, "loc": { "start": { - "line": 165, + "line": 176, "column": 25 }, "end": { - "line": 172, + "line": 183, "column": 9 } }, "body": [ { "type": "TryStatement", - "start": 7982, - "end": 8136, + "start": 8223, + "end": 8377, "loc": { "start": { - "line": 166, + "line": 177, "column": 12 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 7986, - "end": 8055, + "start": 8227, + "end": 8296, "loc": { "start": { - "line": 166, + "line": 177, "column": 16 }, "end": { - "line": 168, + "line": 179, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8004, - "end": 8041, + "start": 8245, + "end": 8282, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 53 } }, "expression": { "type": "AssignmentExpression", - "start": 8004, - "end": 8040, + "start": 8245, + "end": 8281, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 52 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8004, - "end": 8014, + "start": 8245, + "end": 8255, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 26 }, "identifierName": "sourceData" @@ -7177,43 +7799,43 @@ }, "right": { "type": "CallExpression", - "start": 8017, - "end": 8040, + "start": 8258, + "end": 8281, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 52 } }, "callee": { "type": "MemberExpression", - "start": 8017, - "end": 8032, + "start": 8258, + "end": 8273, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 44 } }, "object": { "type": "Identifier", - "start": 8017, - "end": 8019, + "start": 8258, + "end": 8260, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 31 }, "identifierName": "fs" @@ -7222,15 +7844,15 @@ }, "property": { "type": "Identifier", - "start": 8020, - "end": 8032, + "start": 8261, + "end": 8273, "loc": { "start": { - "line": 167, + "line": 178, "column": 32 }, "end": { - "line": 167, + "line": 178, "column": 44 }, "identifierName": "readFileSync" @@ -7242,15 +7864,15 @@ "arguments": [ { "type": "Identifier", - "start": 8033, - "end": 8039, + "start": 8274, + "end": 8280, "loc": { "start": { - "line": 167, + "line": 178, "column": 45 }, "end": { - "line": 167, + "line": 178, "column": 51 }, "identifierName": "source" @@ -7266,29 +7888,29 @@ }, "handler": { "type": "CatchClause", - "start": 8056, - "end": 8136, + "start": 8297, + "end": 8377, "loc": { "start": { - "line": 168, + "line": 179, "column": 14 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "param": { "type": "Identifier", - "start": 8063, - "end": 8066, + "start": 8304, + "end": 8307, "loc": { "start": { - "line": 168, + "line": 179, "column": 21 }, "end": { - "line": 168, + "line": 179, "column": 24 }, "identifierName": "err" @@ -7297,58 +7919,58 @@ }, "body": { "type": "BlockStatement", - "start": 8068, - "end": 8136, + "start": 8309, + "end": 8377, "loc": { "start": { - "line": 168, + "line": 179, "column": 26 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8086, - "end": 8098, + "start": 8327, + "end": 8339, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 8086, - "end": 8097, + "start": 8327, + "end": 8338, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 27 } }, "callee": { "type": "Identifier", - "start": 8086, - "end": 8092, + "start": 8327, + "end": 8333, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 22 }, "identifierName": "reject" @@ -7358,15 +7980,15 @@ "arguments": [ { "type": "Identifier", - "start": 8093, - "end": 8096, + "start": 8334, + "end": 8337, "loc": { "start": { - "line": 169, + "line": 180, "column": 23 }, "end": { - "line": 169, + "line": 180, "column": 26 }, "identifierName": "err" @@ -7378,15 +8000,15 @@ }, { "type": "ReturnStatement", - "start": 8115, - "end": 8122, + "start": 8356, + "end": 8363, "loc": { "start": { - "line": 170, + "line": 181, "column": 16 }, "end": { - "line": 170, + "line": 181, "column": 23 } }, @@ -7406,44 +8028,44 @@ }, { "type": "VariableDeclaration", - "start": 8156, - "end": 8206, + "start": 8397, + "end": 8447, "loc": { "start": { - "line": 174, + "line": 185, "column": 8 }, "end": { - "line": 174, + "line": 185, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8162, - "end": 8205, + "start": 8403, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 14 }, "end": { - "line": 174, + "line": 185, "column": 57 } }, "id": { "type": "Identifier", - "start": 8162, - "end": 8181, + "start": 8403, + "end": 8422, "loc": { "start": { - "line": 174, + "line": 185, "column": 14 }, "end": { - "line": 174, + "line": 185, "column": 33 }, "identifierName": "sourceFileSizeBytes" @@ -7452,29 +8074,29 @@ }, "init": { "type": "MemberExpression", - "start": 8184, - "end": 8205, + "start": 8425, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 36 }, "end": { - "line": 174, + "line": 185, "column": 57 } }, "object": { "type": "Identifier", - "start": 8184, - "end": 8194, + "start": 8425, + "end": 8435, "loc": { "start": { - "line": 174, + "line": 185, "column": 36 }, "end": { - "line": 174, + "line": 185, "column": 46 }, "identifierName": "sourceData" @@ -7483,15 +8105,15 @@ }, "property": { "type": "Identifier", - "start": 8195, - "end": 8205, + "start": 8436, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 47 }, "end": { - "line": 174, + "line": 185, "column": 57 }, "identifierName": "byteLength" @@ -7506,43 +8128,43 @@ }, { "type": "ExpressionStatement", - "start": 8216, - "end": 8291, + "start": 8457, + "end": 8532, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 83 } }, "expression": { "type": "CallExpression", - "start": 8216, - "end": 8290, + "start": 8457, + "end": 8531, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 82 } }, "callee": { "type": "Identifier", - "start": 8216, - "end": 8219, + "start": 8457, + "end": 8460, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 11 }, "identifierName": "log" @@ -7552,43 +8174,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 8220, - "end": 8289, + "start": 8461, + "end": 8530, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 81 } }, "left": { "type": "BinaryExpression", - "start": 8220, - "end": 8281, + "start": 8461, + "end": 8522, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 73 } }, "left": { "type": "StringLiteral", - "start": 8220, - "end": 8239, + "start": 8461, + "end": 8480, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 31 } }, @@ -7601,57 +8223,57 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 8242, - "end": 8281, + "start": 8483, + "end": 8522, "loc": { "start": { - "line": 176, + "line": 187, "column": 34 }, "end": { - "line": 176, + "line": 187, "column": 73 } }, "callee": { "type": "MemberExpression", - "start": 8242, - "end": 8278, + "start": 8483, + "end": 8519, "loc": { "start": { - "line": 176, + "line": 187, "column": 34 }, "end": { - "line": 176, + "line": 187, "column": 70 } }, "object": { "type": "BinaryExpression", - "start": 8243, - "end": 8269, + "start": 8484, + "end": 8510, "loc": { "start": { - "line": 176, + "line": 187, "column": 35 }, "end": { - "line": 176, + "line": 187, "column": 61 } }, "left": { "type": "Identifier", - "start": 8243, - "end": 8262, + "start": 8484, + "end": 8503, "loc": { "start": { - "line": 176, + "line": 187, "column": 35 }, "end": { - "line": 176, + "line": 187, "column": 54 }, "identifierName": "sourceFileSizeBytes" @@ -7661,15 +8283,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 8265, - "end": 8269, + "start": 8506, + "end": 8510, "loc": { "start": { - "line": 176, + "line": 187, "column": 57 }, "end": { - "line": 176, + "line": 187, "column": 61 } }, @@ -7681,20 +8303,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 8242 + "parenStart": 8483 } }, "property": { "type": "Identifier", - "start": 8271, - "end": 8278, + "start": 8512, + "end": 8519, "loc": { "start": { - "line": 176, + "line": 187, "column": 63 }, "end": { - "line": 176, + "line": 187, "column": 70 }, "identifierName": "toFixed" @@ -7706,15 +8328,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 8279, - "end": 8280, + "start": 8520, + "end": 8521, "loc": { "start": { - "line": 176, + "line": 187, "column": 71 }, "end": { - "line": 176, + "line": 187, "column": 72 } }, @@ -7730,15 +8352,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 8284, - "end": 8289, + "start": 8525, + "end": 8530, "loc": { "start": { - "line": 176, + "line": 187, "column": 76 }, "end": { - "line": 176, + "line": 187, "column": 81 } }, @@ -7754,43 +8376,43 @@ }, { "type": "IfStatement", - "start": 8301, - "end": 8671, + "start": 8542, + "end": 8912, "loc": { "start": { - "line": 178, + "line": 189, "column": 8 }, "end": { - "line": 188, + "line": 199, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 8305, - "end": 8341, + "start": 8546, + "end": 8582, "loc": { "start": { - "line": 178, + "line": 189, "column": 12 }, "end": { - "line": 178, + "line": 189, "column": 48 } }, "left": { "type": "UnaryExpression", - "start": 8305, - "end": 8322, + "start": 8546, + "end": 8563, "loc": { "start": { - "line": 178, + "line": 189, "column": 12 }, "end": { - "line": 178, + "line": 189, "column": 29 } }, @@ -7798,15 +8420,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 8306, - "end": 8322, + "start": 8547, + "end": 8563, "loc": { "start": { - "line": 178, + "line": 189, "column": 13 }, "end": { - "line": 178, + "line": 189, "column": 29 }, "identifierName": "metaModelDataStr" @@ -7820,15 +8442,15 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 8326, - "end": 8341, + "start": 8567, + "end": 8582, "loc": { "start": { - "line": 178, + "line": 189, "column": 33 }, "end": { - "line": 178, + "line": 189, "column": 48 }, "identifierName": "metaModelSource" @@ -7838,58 +8460,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 8343, - "end": 8604, + "start": 8584, + "end": 8845, "loc": { "start": { - "line": 178, + "line": 189, "column": 50 }, "end": { - "line": 186, + "line": 197, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 8357, - "end": 8412, + "start": 8598, + "end": 8653, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 67 } }, "expression": { "type": "CallExpression", - "start": 8357, - "end": 8411, + "start": 8598, + "end": 8652, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 66 } }, "callee": { "type": "Identifier", - "start": 8357, - "end": 8360, + "start": 8598, + "end": 8601, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 15 }, "identifierName": "log" @@ -7899,29 +8521,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 8361, - "end": 8410, + "start": 8602, + "end": 8651, "loc": { "start": { - "line": 179, + "line": 190, "column": 16 }, "end": { - "line": 179, + "line": 190, "column": 65 } }, "left": { "type": "StringLiteral", - "start": 8361, - "end": 8392, + "start": 8602, + "end": 8633, "loc": { "start": { - "line": 179, + "line": 190, "column": 16 }, "end": { - "line": 179, + "line": 190, "column": 47 } }, @@ -7934,15 +8556,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 8395, - "end": 8410, + "start": 8636, + "end": 8651, "loc": { "start": { - "line": 179, + "line": 190, "column": 50 }, "end": { - "line": 179, + "line": 190, "column": 65 }, "identifierName": "metaModelSource" @@ -7955,73 +8577,73 @@ }, { "type": "TryStatement", - "start": 8425, - "end": 8594, + "start": 8666, + "end": 8835, "loc": { "start": { - "line": 180, + "line": 191, "column": 12 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 8429, - "end": 8513, + "start": 8670, + "end": 8754, "loc": { "start": { - "line": 180, + "line": 191, "column": 16 }, "end": { - "line": 182, + "line": 193, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8447, - "end": 8499, + "start": 8688, + "end": 8740, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 68 } }, "expression": { "type": "AssignmentExpression", - "start": 8447, - "end": 8498, + "start": 8688, + "end": 8739, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 67 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8447, - "end": 8463, + "start": 8688, + "end": 8704, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 32 }, "identifierName": "metaModelDataStr" @@ -8030,43 +8652,43 @@ }, "right": { "type": "CallExpression", - "start": 8466, - "end": 8498, + "start": 8707, + "end": 8739, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 67 } }, "callee": { "type": "MemberExpression", - "start": 8466, - "end": 8481, + "start": 8707, + "end": 8722, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 50 } }, "object": { "type": "Identifier", - "start": 8466, - "end": 8468, + "start": 8707, + "end": 8709, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 37 }, "identifierName": "fs" @@ -8075,15 +8697,15 @@ }, "property": { "type": "Identifier", - "start": 8469, - "end": 8481, + "start": 8710, + "end": 8722, "loc": { "start": { - "line": 181, + "line": 192, "column": 38 }, "end": { - "line": 181, + "line": 192, "column": 50 }, "identifierName": "readFileSync" @@ -8095,15 +8717,15 @@ "arguments": [ { "type": "Identifier", - "start": 8482, - "end": 8497, + "start": 8723, + "end": 8738, "loc": { "start": { - "line": 181, + "line": 192, "column": 51 }, "end": { - "line": 181, + "line": 192, "column": 66 }, "identifierName": "metaModelSource" @@ -8119,29 +8741,29 @@ }, "handler": { "type": "CatchClause", - "start": 8514, - "end": 8594, + "start": 8755, + "end": 8835, "loc": { "start": { - "line": 182, + "line": 193, "column": 14 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "param": { "type": "Identifier", - "start": 8521, - "end": 8524, + "start": 8762, + "end": 8765, "loc": { "start": { - "line": 182, + "line": 193, "column": 21 }, "end": { - "line": 182, + "line": 193, "column": 24 }, "identifierName": "err" @@ -8150,58 +8772,58 @@ }, "body": { "type": "BlockStatement", - "start": 8526, - "end": 8594, + "start": 8767, + "end": 8835, "loc": { "start": { - "line": 182, + "line": 193, "column": 26 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8544, - "end": 8556, + "start": 8785, + "end": 8797, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 8544, - "end": 8555, + "start": 8785, + "end": 8796, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 27 } }, "callee": { "type": "Identifier", - "start": 8544, - "end": 8550, + "start": 8785, + "end": 8791, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 22 }, "identifierName": "reject" @@ -8211,15 +8833,15 @@ "arguments": [ { "type": "Identifier", - "start": 8551, - "end": 8554, + "start": 8792, + "end": 8795, "loc": { "start": { - "line": 183, + "line": 194, "column": 23 }, "end": { - "line": 183, + "line": 194, "column": 26 }, "identifierName": "err" @@ -8231,15 +8853,15 @@ }, { "type": "ReturnStatement", - "start": 8573, - "end": 8580, + "start": 8814, + "end": 8821, "loc": { "start": { - "line": 184, + "line": 195, "column": 16 }, "end": { - "line": 184, + "line": 195, "column": 23 } }, @@ -8257,58 +8879,58 @@ }, "alternate": { "type": "BlockStatement", - "start": 8610, - "end": 8671, + "start": 8851, + "end": 8912, "loc": { "start": { - "line": 186, + "line": 197, "column": 15 }, "end": { - "line": 188, + "line": 199, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 8624, - "end": 8661, + "start": 8865, + "end": 8902, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 8624, - "end": 8660, + "start": 8865, + "end": 8901, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 48 } }, "callee": { "type": "Identifier", - "start": 8624, - "end": 8627, + "start": 8865, + "end": 8868, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 15 }, "identifierName": "log" @@ -8318,15 +8940,15 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 8628, - "end": 8659, + "start": 8869, + "end": 8900, "loc": { "start": { - "line": 187, + "line": 198, "column": 16 }, "end": { - "line": 187, + "line": 198, "column": 47 } }, @@ -8334,15 +8956,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 8629, - "end": 8658, + "start": 8870, + "end": 8899, "loc": { "start": { - "line": 187, + "line": 198, "column": 17 }, "end": { - "line": 187, + "line": 198, "column": 46 } }, @@ -8363,44 +8985,44 @@ }, { "type": "VariableDeclaration", - "start": 8681, - "end": 8699, + "start": 8922, + "end": 8940, "loc": { "start": { - "line": 190, + "line": 201, "column": 8 }, "end": { - "line": 190, + "line": 201, "column": 26 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8685, - "end": 8698, + "start": 8926, + "end": 8939, "loc": { "start": { - "line": 190, + "line": 201, "column": 12 }, "end": { - "line": 190, + "line": 201, "column": 25 } }, "id": { "type": "Identifier", - "start": 8685, - "end": 8698, + "start": 8926, + "end": 8939, "loc": { "start": { - "line": 190, + "line": 201, "column": 12 }, "end": { - "line": 190, + "line": 201, "column": 25 }, "identifierName": "metaModelJSON" @@ -8414,29 +9036,29 @@ }, { "type": "IfStatement", - "start": 8709, - "end": 8956, + "start": 8950, + "end": 9197, "loc": { "start": { - "line": 192, + "line": 203, "column": 8 }, "end": { - "line": 199, + "line": 210, "column": 9 } }, "test": { "type": "Identifier", - "start": 8713, - "end": 8729, + "start": 8954, + "end": 8970, "loc": { "start": { - "line": 192, + "line": 203, "column": 12 }, "end": { - "line": 192, + "line": 203, "column": 28 }, "identifierName": "metaModelDataStr" @@ -8445,88 +9067,88 @@ }, "consequent": { "type": "BlockStatement", - "start": 8731, - "end": 8956, + "start": 8972, + "end": 9197, "loc": { "start": { - "line": 192, + "line": 203, "column": 30 }, "end": { - "line": 199, + "line": 210, "column": 9 } }, "body": [ { "type": "TryStatement", - "start": 8745, - "end": 8946, + "start": 8986, + "end": 9187, "loc": { "start": { - "line": 193, + "line": 204, "column": 12 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 8749, - "end": 8826, + "start": 8990, + "end": 9067, "loc": { "start": { - "line": 193, + "line": 204, "column": 16 }, "end": { - "line": 195, + "line": 206, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8767, - "end": 8812, + "start": 9008, + "end": 9053, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 61 } }, "expression": { "type": "AssignmentExpression", - "start": 8767, - "end": 8811, + "start": 9008, + "end": 9052, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 60 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8767, - "end": 8780, + "start": 9008, + "end": 9021, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 29 }, "identifierName": "metaModelJSON" @@ -8535,43 +9157,43 @@ }, "right": { "type": "CallExpression", - "start": 8783, - "end": 8811, + "start": 9024, + "end": 9052, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 60 } }, "callee": { "type": "MemberExpression", - "start": 8783, - "end": 8793, + "start": 9024, + "end": 9034, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 42 } }, "object": { "type": "Identifier", - "start": 8783, - "end": 8787, + "start": 9024, + "end": 9028, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 36 }, "identifierName": "JSON" @@ -8580,15 +9202,15 @@ }, "property": { "type": "Identifier", - "start": 8788, - "end": 8793, + "start": 9029, + "end": 9034, "loc": { "start": { - "line": 194, + "line": 205, "column": 37 }, "end": { - "line": 194, + "line": 205, "column": 42 }, "identifierName": "parse" @@ -8600,15 +9222,15 @@ "arguments": [ { "type": "Identifier", - "start": 8794, - "end": 8810, + "start": 9035, + "end": 9051, "loc": { "start": { - "line": 194, + "line": 205, "column": 43 }, "end": { - "line": 194, + "line": 205, "column": 59 }, "identifierName": "metaModelDataStr" @@ -8624,29 +9246,29 @@ }, "handler": { "type": "CatchClause", - "start": 8827, - "end": 8946, + "start": 9068, + "end": 9187, "loc": { "start": { - "line": 195, + "line": 206, "column": 14 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "param": { "type": "Identifier", - "start": 8834, - "end": 8835, + "start": 9075, + "end": 9076, "loc": { "start": { - "line": 195, + "line": 206, "column": 21 }, "end": { - "line": 195, + "line": 206, "column": 22 }, "identifierName": "e" @@ -8655,59 +9277,59 @@ }, "body": { "type": "BlockStatement", - "start": 8837, - "end": 8946, + "start": 9078, + "end": 9187, "loc": { "start": { - "line": 195, + "line": 206, "column": 24 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8855, - "end": 8874, + "start": 9096, + "end": 9115, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 35 } }, "expression": { "type": "AssignmentExpression", - "start": 8855, - "end": 8873, + "start": 9096, + "end": 9114, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 34 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8855, - "end": 8868, + "start": 9096, + "end": 9109, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 29 }, "identifierName": "metaModelJSON" @@ -8716,15 +9338,15 @@ }, "right": { "type": "ObjectExpression", - "start": 8871, - "end": 8873, + "start": 9112, + "end": 9114, "loc": { "start": { - "line": 196, + "line": 207, "column": 32 }, "end": { - "line": 196, + "line": 207, "column": 34 } }, @@ -8734,43 +9356,43 @@ }, { "type": "ExpressionStatement", - "start": 8891, - "end": 8932, + "start": 9132, + "end": 9173, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 57 } }, "expression": { "type": "CallExpression", - "start": 8891, - "end": 8931, + "start": 9132, + "end": 9172, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 56 } }, "callee": { "type": "Identifier", - "start": 8891, - "end": 8894, + "start": 9132, + "end": 9135, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 19 }, "identifierName": "log" @@ -8780,30 +9402,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 8895, - "end": 8930, + "start": 9136, + "end": 9171, "loc": { "start": { - "line": 197, + "line": 208, "column": 20 }, "end": { - "line": 197, + "line": 208, "column": 55 } }, "expressions": [ { "type": "Identifier", - "start": 8927, - "end": 8928, + "start": 9168, + "end": 9169, "loc": { "start": { - "line": 197, + "line": 208, "column": 52 }, "end": { - "line": 197, + "line": 208, "column": 53 }, "identifierName": "e" @@ -8814,15 +9436,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 8896, - "end": 8925, + "start": 9137, + "end": 9166, "loc": { "start": { - "line": 197, + "line": 208, "column": 21 }, "end": { - "line": 197, + "line": 208, "column": 50 } }, @@ -8834,15 +9456,15 @@ }, { "type": "TemplateElement", - "start": 8929, - "end": 8929, + "start": 9170, + "end": 9170, "loc": { "start": { - "line": 197, + "line": 208, "column": 54 }, "end": { - "line": 197, + "line": 208, "column": 54 } }, @@ -8871,44 +9493,44 @@ }, { "type": "ExpressionStatement", - "start": 8966, - "end": 9037, + "start": 9207, + "end": 9278, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 79 } }, "expression": { "type": "AssignmentExpression", - "start": 8966, - "end": 9036, + "start": 9207, + "end": 9277, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 78 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8966, - "end": 8977, + "start": 9207, + "end": 9218, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 19 }, "identifierName": "minTileSize" @@ -8917,29 +9539,29 @@ }, "right": { "type": "CallExpression", - "start": 8980, - "end": 9036, + "start": 9221, + "end": 9277, "loc": { "start": { - "line": 201, + "line": 212, "column": 22 }, "end": { - "line": 201, + "line": 212, "column": 78 } }, "callee": { "type": "Identifier", - "start": 8980, - "end": 8994, + "start": 9221, + "end": 9235, "loc": { "start": { - "line": 201, + "line": 212, "column": 22 }, "end": { - "line": 201, + "line": 212, "column": 36 }, "identifierName": "overrideOption" @@ -8949,29 +9571,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 8995, - "end": 9022, + "start": 9236, + "end": 9263, "loc": { "start": { - "line": 201, + "line": 212, "column": 37 }, "end": { - "line": 201, + "line": 212, "column": 64 } }, "object": { "type": "Identifier", - "start": 8995, - "end": 9010, + "start": 9236, + "end": 9251, "loc": { "start": { - "line": 201, + "line": 212, "column": 37 }, "end": { - "line": 201, + "line": 212, "column": 52 }, "identifierName": "fileTypeConfigs" @@ -8980,15 +9602,15 @@ }, "property": { "type": "Identifier", - "start": 9011, - "end": 9022, + "start": 9252, + "end": 9263, "loc": { "start": { - "line": 201, + "line": 212, "column": 53 }, "end": { - "line": 201, + "line": 212, "column": 64 }, "identifierName": "minTileSize" @@ -8999,15 +9621,15 @@ }, { "type": "Identifier", - "start": 9024, - "end": 9035, + "start": 9265, + "end": 9276, "loc": { "start": { - "line": 201, + "line": 212, "column": 66 }, "end": { - "line": 201, + "line": 212, "column": 77 }, "identifierName": "minTileSize" @@ -9020,44 +9642,44 @@ }, { "type": "ExpressionStatement", - "start": 9046, - "end": 9105, + "start": 9287, + "end": 9346, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 67 } }, "expression": { "type": "AssignmentExpression", - "start": 9046, - "end": 9104, + "start": 9287, + "end": 9345, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 66 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9046, - "end": 9053, + "start": 9287, + "end": 9294, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 15 }, "identifierName": "rotateX" @@ -9066,29 +9688,29 @@ }, "right": { "type": "CallExpression", - "start": 9056, - "end": 9104, + "start": 9297, + "end": 9345, "loc": { "start": { - "line": 202, + "line": 213, "column": 18 }, "end": { - "line": 202, + "line": 213, "column": 66 } }, "callee": { "type": "Identifier", - "start": 9056, - "end": 9070, + "start": 9297, + "end": 9311, "loc": { "start": { - "line": 202, + "line": 213, "column": 18 }, "end": { - "line": 202, + "line": 213, "column": 32 }, "identifierName": "overrideOption" @@ -9098,29 +9720,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9071, - "end": 9094, + "start": 9312, + "end": 9335, "loc": { "start": { - "line": 202, + "line": 213, "column": 33 }, "end": { - "line": 202, + "line": 213, "column": 56 } }, "object": { "type": "Identifier", - "start": 9071, - "end": 9086, + "start": 9312, + "end": 9327, "loc": { "start": { - "line": 202, + "line": 213, "column": 33 }, "end": { - "line": 202, + "line": 213, "column": 48 }, "identifierName": "fileTypeConfigs" @@ -9129,15 +9751,15 @@ }, "property": { "type": "Identifier", - "start": 9087, - "end": 9094, + "start": 9328, + "end": 9335, "loc": { "start": { - "line": 202, + "line": 213, "column": 49 }, "end": { - "line": 202, + "line": 213, "column": 56 }, "identifierName": "rotateX" @@ -9148,15 +9770,15 @@ }, { "type": "Identifier", - "start": 9096, - "end": 9103, + "start": 9337, + "end": 9344, "loc": { "start": { - "line": 202, + "line": 213, "column": 58 }, "end": { - "line": 202, + "line": 213, "column": 65 }, "identifierName": "rotateX" @@ -9169,44 +9791,44 @@ }, { "type": "ExpressionStatement", - "start": 9114, - "end": 9197, + "start": 9355, + "end": 9438, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 91 } }, "expression": { "type": "AssignmentExpression", - "start": 9114, - "end": 9196, + "start": 9355, + "end": 9437, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 90 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9114, - "end": 9129, + "start": 9355, + "end": 9370, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 23 }, "identifierName": "reuseGeometries" @@ -9215,29 +9837,29 @@ }, "right": { "type": "CallExpression", - "start": 9132, - "end": 9196, + "start": 9373, + "end": 9437, "loc": { "start": { - "line": 203, + "line": 214, "column": 26 }, "end": { - "line": 203, + "line": 214, "column": 90 } }, "callee": { "type": "Identifier", - "start": 9132, - "end": 9146, + "start": 9373, + "end": 9387, "loc": { "start": { - "line": 203, + "line": 214, "column": 26 }, "end": { - "line": 203, + "line": 214, "column": 40 }, "identifierName": "overrideOption" @@ -9247,29 +9869,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9147, - "end": 9178, + "start": 9388, + "end": 9419, "loc": { "start": { - "line": 203, + "line": 214, "column": 41 }, "end": { - "line": 203, + "line": 214, "column": 72 } }, "object": { "type": "Identifier", - "start": 9147, - "end": 9162, + "start": 9388, + "end": 9403, "loc": { "start": { - "line": 203, + "line": 214, "column": 41 }, "end": { - "line": 203, + "line": 214, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -9278,15 +9900,15 @@ }, "property": { "type": "Identifier", - "start": 9163, - "end": 9178, + "start": 9404, + "end": 9419, "loc": { "start": { - "line": 203, + "line": 214, "column": 57 }, "end": { - "line": 203, + "line": 214, "column": 72 }, "identifierName": "reuseGeometries" @@ -9297,15 +9919,15 @@ }, { "type": "Identifier", - "start": 9180, - "end": 9195, + "start": 9421, + "end": 9436, "loc": { "start": { - "line": 203, + "line": 214, "column": 74 }, "end": { - "line": 203, + "line": 214, "column": 89 }, "identifierName": "reuseGeometries" @@ -9318,44 +9940,44 @@ }, { "type": "ExpressionStatement", - "start": 9206, - "end": 9289, + "start": 9447, + "end": 9530, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 91 } }, "expression": { "type": "AssignmentExpression", - "start": 9206, - "end": 9288, + "start": 9447, + "end": 9529, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 90 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9206, - "end": 9221, + "start": 9447, + "end": 9462, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 23 }, "identifierName": "includeTextures" @@ -9364,29 +9986,29 @@ }, "right": { "type": "CallExpression", - "start": 9224, - "end": 9288, + "start": 9465, + "end": 9529, "loc": { "start": { - "line": 204, + "line": 215, "column": 26 }, "end": { - "line": 204, + "line": 215, "column": 90 } }, "callee": { "type": "Identifier", - "start": 9224, - "end": 9238, + "start": 9465, + "end": 9479, "loc": { "start": { - "line": 204, + "line": 215, "column": 26 }, "end": { - "line": 204, + "line": 215, "column": 40 }, "identifierName": "overrideOption" @@ -9396,29 +10018,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9239, - "end": 9270, + "start": 9480, + "end": 9511, "loc": { "start": { - "line": 204, + "line": 215, "column": 41 }, "end": { - "line": 204, + "line": 215, "column": 72 } }, "object": { "type": "Identifier", - "start": 9239, - "end": 9254, + "start": 9480, + "end": 9495, "loc": { "start": { - "line": 204, + "line": 215, "column": 41 }, "end": { - "line": 204, + "line": 215, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -9427,15 +10049,15 @@ }, "property": { "type": "Identifier", - "start": 9255, - "end": 9270, + "start": 9496, + "end": 9511, "loc": { "start": { - "line": 204, + "line": 215, "column": 57 }, "end": { - "line": 204, + "line": 215, "column": 72 }, "identifierName": "includeTextures" @@ -9446,15 +10068,15 @@ }, { "type": "Identifier", - "start": 9272, - "end": 9287, + "start": 9513, + "end": 9528, "loc": { "start": { - "line": 204, + "line": 215, "column": 74 }, "end": { - "line": 204, + "line": 215, "column": 89 }, "identifierName": "includeTextures" @@ -9467,44 +10089,44 @@ }, { "type": "ExpressionStatement", - "start": 9298, - "end": 9378, + "start": 9539, + "end": 9619, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 88 } }, "expression": { "type": "AssignmentExpression", - "start": 9298, - "end": 9377, + "start": 9539, + "end": 9618, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 87 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9298, - "end": 9312, + "start": 9539, + "end": 9553, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 22 }, "identifierName": "includeNormals" @@ -9513,29 +10135,29 @@ }, "right": { "type": "CallExpression", - "start": 9315, - "end": 9377, + "start": 9556, + "end": 9618, "loc": { "start": { - "line": 205, + "line": 216, "column": 25 }, "end": { - "line": 205, + "line": 216, "column": 87 } }, "callee": { "type": "Identifier", - "start": 9315, - "end": 9329, + "start": 9556, + "end": 9570, "loc": { "start": { - "line": 205, + "line": 216, "column": 25 }, "end": { - "line": 205, + "line": 216, "column": 39 }, "identifierName": "overrideOption" @@ -9545,29 +10167,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9330, - "end": 9360, + "start": 9571, + "end": 9601, "loc": { "start": { - "line": 205, + "line": 216, "column": 40 }, "end": { - "line": 205, + "line": 216, "column": 70 } }, "object": { "type": "Identifier", - "start": 9330, - "end": 9345, + "start": 9571, + "end": 9586, "loc": { "start": { - "line": 205, + "line": 216, "column": 40 }, "end": { - "line": 205, + "line": 216, "column": 55 }, "identifierName": "fileTypeConfigs" @@ -9576,15 +10198,15 @@ }, "property": { "type": "Identifier", - "start": 9346, - "end": 9360, + "start": 9587, + "end": 9601, "loc": { "start": { - "line": 205, + "line": 216, "column": 56 }, "end": { - "line": 205, + "line": 216, "column": 70 }, "identifierName": "includeNormals" @@ -9595,15 +10217,15 @@ }, { "type": "Identifier", - "start": 9362, - "end": 9376, + "start": 9603, + "end": 9617, "loc": { "start": { - "line": 205, + "line": 216, "column": 72 }, "end": { - "line": 205, + "line": 216, "column": 86 }, "identifierName": "includeNormals" @@ -9616,44 +10238,44 @@ }, { "type": "ExpressionStatement", - "start": 9387, - "end": 9461, + "start": 9628, + "end": 9702, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 82 } }, "expression": { "type": "AssignmentExpression", - "start": 9387, - "end": 9460, + "start": 9628, + "end": 9701, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 81 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9387, - "end": 9399, + "start": 9628, + "end": 9640, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 20 }, "identifierName": "includeTypes" @@ -9662,29 +10284,29 @@ }, "right": { "type": "CallExpression", - "start": 9402, - "end": 9460, + "start": 9643, + "end": 9701, "loc": { "start": { - "line": 206, + "line": 217, "column": 23 }, "end": { - "line": 206, + "line": 217, "column": 81 } }, "callee": { "type": "Identifier", - "start": 9402, - "end": 9416, + "start": 9643, + "end": 9657, "loc": { "start": { - "line": 206, + "line": 217, "column": 23 }, "end": { - "line": 206, + "line": 217, "column": 37 }, "identifierName": "overrideOption" @@ -9694,29 +10316,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9417, - "end": 9445, + "start": 9658, + "end": 9686, "loc": { "start": { - "line": 206, + "line": 217, "column": 38 }, "end": { - "line": 206, + "line": 217, "column": 66 } }, "object": { "type": "Identifier", - "start": 9417, - "end": 9432, + "start": 9658, + "end": 9673, "loc": { "start": { - "line": 206, + "line": 217, "column": 38 }, "end": { - "line": 206, + "line": 217, "column": 53 }, "identifierName": "fileTypeConfigs" @@ -9725,15 +10347,15 @@ }, "property": { "type": "Identifier", - "start": 9433, - "end": 9445, + "start": 9674, + "end": 9686, "loc": { "start": { - "line": 206, + "line": 217, "column": 54 }, "end": { - "line": 206, + "line": 217, "column": 66 }, "identifierName": "includeTypes" @@ -9744,15 +10366,15 @@ }, { "type": "Identifier", - "start": 9447, - "end": 9459, + "start": 9688, + "end": 9700, "loc": { "start": { - "line": 206, + "line": 217, "column": 68 }, "end": { - "line": 206, + "line": 217, "column": 80 }, "identifierName": "includeTypes" @@ -9765,44 +10387,44 @@ }, { "type": "ExpressionStatement", - "start": 9470, - "end": 9544, + "start": 9711, + "end": 9785, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 82 } }, "expression": { "type": "AssignmentExpression", - "start": 9470, - "end": 9543, + "start": 9711, + "end": 9784, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 81 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9470, - "end": 9482, + "start": 9711, + "end": 9723, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 20 }, "identifierName": "excludeTypes" @@ -9811,29 +10433,29 @@ }, "right": { "type": "CallExpression", - "start": 9485, - "end": 9543, + "start": 9726, + "end": 9784, "loc": { "start": { - "line": 207, + "line": 218, "column": 23 }, "end": { - "line": 207, + "line": 218, "column": 81 } }, "callee": { "type": "Identifier", - "start": 9485, - "end": 9499, + "start": 9726, + "end": 9740, "loc": { "start": { - "line": 207, + "line": 218, "column": 23 }, "end": { - "line": 207, + "line": 218, "column": 37 }, "identifierName": "overrideOption" @@ -9843,29 +10465,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9500, - "end": 9528, + "start": 9741, + "end": 9769, "loc": { "start": { - "line": 207, + "line": 218, "column": 38 }, "end": { - "line": 207, + "line": 218, "column": 66 } }, "object": { "type": "Identifier", - "start": 9500, - "end": 9515, + "start": 9741, + "end": 9756, "loc": { "start": { - "line": 207, + "line": 218, "column": 38 }, "end": { - "line": 207, + "line": 218, "column": 53 }, "identifierName": "fileTypeConfigs" @@ -9874,15 +10496,15 @@ }, "property": { "type": "Identifier", - "start": 9516, - "end": 9528, + "start": 9757, + "end": 9769, "loc": { "start": { - "line": 207, + "line": 218, "column": 54 }, "end": { - "line": 207, + "line": 218, "column": 66 }, "identifierName": "excludeTypes" @@ -9893,15 +10515,15 @@ }, { "type": "Identifier", - "start": 9530, - "end": 9542, + "start": 9771, + "end": 9783, "loc": { "start": { - "line": 207, + "line": 218, "column": 68 }, "end": { - "line": 207, + "line": 218, "column": 80 }, "identifierName": "excludeTypes" @@ -9914,43 +10536,43 @@ }, { "type": "IfStatement", - "start": 9554, - "end": 9643, + "start": 9795, + "end": 9884, "loc": { "start": { - "line": 209, + "line": 220, "column": 8 }, "end": { - "line": 211, + "line": 222, "column": 9 } }, "test": { "type": "BinaryExpression", - "start": 9558, - "end": 9583, + "start": 9799, + "end": 9824, "loc": { "start": { - "line": 209, + "line": 220, "column": 12 }, "end": { - "line": 209, + "line": 220, "column": 37 } }, "left": { "type": "Identifier", - "start": 9558, - "end": 9573, + "start": 9799, + "end": 9814, "loc": { "start": { - "line": 209, + "line": 220, "column": 12 }, "end": { - "line": 209, + "line": 220, "column": 27 }, "identifierName": "reuseGeometries" @@ -9960,15 +10582,15 @@ "operator": "===", "right": { "type": "BooleanLiteral", - "start": 9578, - "end": 9583, + "start": 9819, + "end": 9824, "loc": { "start": { - "line": 209, + "line": 220, "column": 32 }, "end": { - "line": 209, + "line": 220, "column": 37 } }, @@ -9977,58 +10599,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 9585, - "end": 9643, + "start": 9826, + "end": 9884, "loc": { "start": { - "line": 209, + "line": 220, "column": 39 }, "end": { - "line": 211, + "line": 222, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 9599, - "end": 9633, + "start": 9840, + "end": 9874, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 46 } }, "expression": { "type": "CallExpression", - "start": 9599, - "end": 9632, + "start": 9840, + "end": 9873, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 45 } }, "callee": { "type": "Identifier", - "start": 9599, - "end": 9602, + "start": 9840, + "end": 9843, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 15 }, "identifierName": "log" @@ -10038,15 +10660,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 9603, - "end": 9631, + "start": 9844, + "end": 9872, "loc": { "start": { - "line": 210, + "line": 221, "column": 16 }, "end": { - "line": 210, + "line": 221, "column": 44 } }, @@ -10066,44 +10688,44 @@ }, { "type": "VariableDeclaration", - "start": 9653, - "end": 9743, + "start": 9894, + "end": 9984, "loc": { "start": { - "line": 213, + "line": 224, "column": 8 }, "end": { - "line": 216, + "line": 227, "column": 11 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 9659, - "end": 9742, + "start": 9900, + "end": 9983, "loc": { "start": { - "line": 213, + "line": 224, "column": 14 }, "end": { - "line": 216, + "line": 227, "column": 10 } }, "id": { "type": "Identifier", - "start": 9659, - "end": 9667, + "start": 9900, + "end": 9908, "loc": { "start": { - "line": 213, + "line": 224, "column": 14 }, "end": { - "line": 213, + "line": 224, "column": 22 }, "identifierName": "xktModel" @@ -10112,29 +10734,29 @@ }, "init": { "type": "NewExpression", - "start": 9670, - "end": 9742, + "start": 9911, + "end": 9983, "loc": { "start": { - "line": 213, + "line": 224, "column": 25 }, "end": { - "line": 216, + "line": 227, "column": 10 } }, "callee": { "type": "Identifier", - "start": 9674, - "end": 9682, + "start": 9915, + "end": 9923, "loc": { "start": { - "line": 213, + "line": 224, "column": 29 }, "end": { - "line": 213, + "line": 224, "column": 37 }, "identifierName": "XKTModel" @@ -10144,30 +10766,30 @@ "arguments": [ { "type": "ObjectExpression", - "start": 9683, - "end": 9741, + "start": 9924, + "end": 9982, "loc": { "start": { - "line": 213, + "line": 224, "column": 38 }, "end": { - "line": 216, + "line": 227, "column": 9 } }, "properties": [ { "type": "ObjectProperty", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 } }, @@ -10176,15 +10798,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 }, "identifierName": "minTileSize" @@ -10193,15 +10815,15 @@ }, "value": { "type": "Identifier", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 }, "identifierName": "minTileSize" @@ -10214,15 +10836,15 @@ }, { "type": "ObjectProperty", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 } }, @@ -10231,15 +10853,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 }, "identifierName": "modelAABB" @@ -10248,15 +10870,15 @@ }, "value": { "type": "Identifier", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 }, "identifierName": "modelAABB" @@ -10277,29 +10899,29 @@ }, { "type": "SwitchStatement", - "start": 9753, - "end": 14441, + "start": 9994, + "end": 14682, "loc": { "start": { - "line": 218, + "line": 229, "column": 8 }, "end": { - "line": 355, + "line": 366, "column": 9 } }, "discriminant": { "type": "Identifier", - "start": 9761, - "end": 9764, + "start": 10002, + "end": 10005, "loc": { "start": { - "line": 218, + "line": 229, "column": 16 }, "end": { - "line": 218, + "line": 229, "column": 19 }, "identifierName": "ext" @@ -10309,58 +10931,58 @@ "cases": [ { "type": "SwitchCase", - "start": 9780, - "end": 10158, + "start": 10021, + "end": 10399, "loc": { "start": { - "line": 219, + "line": 230, "column": 12 }, "end": { - "line": 229, + "line": 240, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 9809, - "end": 10135, + "start": 10050, + "end": 10376, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 228, + "line": 239, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 9809, - "end": 10134, + "start": 10050, + "end": 10375, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 228, + "line": 239, "column": 18 } }, "callee": { "type": "Identifier", - "start": 9809, - "end": 9816, + "start": 10050, + "end": 10057, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 220, + "line": 231, "column": 23 }, "identifierName": "convert" @@ -10370,15 +10992,15 @@ "arguments": [ { "type": "Identifier", - "start": 9817, - "end": 9842, + "start": 10058, + "end": 10083, "loc": { "start": { - "line": 220, + "line": 231, "column": 24 }, "end": { - "line": 220, + "line": 231, "column": 49 }, "identifierName": "parseCityJSONIntoXKTModel" @@ -10387,30 +11009,30 @@ }, { "type": "ObjectExpression", - "start": 9844, - "end": 10133, + "start": 10085, + "end": 10374, "loc": { "start": { - "line": 220, + "line": 231, "column": 51 }, "end": { - "line": 228, + "line": 239, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 9866, - "end": 9894, + "start": 10107, + "end": 10135, "loc": { "start": { - "line": 221, + "line": 232, "column": 20 }, "end": { - "line": 221, + "line": 232, "column": 48 } }, @@ -10419,15 +11041,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9866, - "end": 9870, + "start": 10107, + "end": 10111, "loc": { "start": { - "line": 221, + "line": 232, "column": 20 }, "end": { - "line": 221, + "line": 232, "column": 24 }, "identifierName": "data" @@ -10436,43 +11058,43 @@ }, "value": { "type": "CallExpression", - "start": 9872, - "end": 9894, + "start": 10113, + "end": 10135, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 48 } }, "callee": { "type": "MemberExpression", - "start": 9872, - "end": 9882, + "start": 10113, + "end": 10123, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 36 } }, "object": { "type": "Identifier", - "start": 9872, - "end": 9876, + "start": 10113, + "end": 10117, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 30 }, "identifierName": "JSON" @@ -10481,15 +11103,15 @@ }, "property": { "type": "Identifier", - "start": 9877, - "end": 9882, + "start": 10118, + "end": 10123, "loc": { "start": { - "line": 221, + "line": 232, "column": 31 }, "end": { - "line": 221, + "line": 232, "column": 36 }, "identifierName": "parse" @@ -10501,15 +11123,15 @@ "arguments": [ { "type": "Identifier", - "start": 9883, - "end": 9893, + "start": 10124, + "end": 10134, "loc": { "start": { - "line": 221, + "line": 232, "column": 37 }, "end": { - "line": 221, + "line": 232, "column": 47 }, "identifierName": "sourceData" @@ -10521,15 +11143,15 @@ }, { "type": "ObjectProperty", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 } }, @@ -10538,15 +11160,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 }, "identifierName": "xktModel" @@ -10555,15 +11177,15 @@ }, "value": { "type": "Identifier", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 }, "identifierName": "xktModel" @@ -10576,15 +11198,15 @@ }, { "type": "ObjectProperty", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 } }, @@ -10593,15 +11215,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 }, "identifierName": "stats" @@ -10610,15 +11232,15 @@ }, "value": { "type": "Identifier", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 }, "identifierName": "stats" @@ -10631,15 +11253,15 @@ }, { "type": "ObjectProperty", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 } }, @@ -10648,15 +11270,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 }, "identifierName": "rotateX" @@ -10665,15 +11287,15 @@ }, "value": { "type": "Identifier", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 }, "identifierName": "rotateX" @@ -10686,15 +11308,15 @@ }, { "type": "ObjectProperty", - "start": 10002, - "end": 10032, + "start": 10243, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 20 }, "end": { - "line": 225, + "line": 236, "column": 50 } }, @@ -10703,15 +11325,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10002, - "end": 10008, + "start": 10243, + "end": 10249, "loc": { "start": { - "line": 225, + "line": 236, "column": 20 }, "end": { - "line": 225, + "line": 236, "column": 26 }, "identifierName": "center" @@ -10720,29 +11342,29 @@ }, "value": { "type": "MemberExpression", - "start": 10010, - "end": 10032, + "start": 10251, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 28 }, "end": { - "line": 225, + "line": 236, "column": 50 } }, "object": { "type": "Identifier", - "start": 10010, - "end": 10025, + "start": 10251, + "end": 10266, "loc": { "start": { - "line": 225, + "line": 236, "column": 28 }, "end": { - "line": 225, + "line": 236, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -10751,15 +11373,15 @@ }, "property": { "type": "Identifier", - "start": 10026, - "end": 10032, + "start": 10267, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 44 }, "end": { - "line": 225, + "line": 236, "column": 50 }, "identifierName": "center" @@ -10771,15 +11393,15 @@ }, { "type": "ObjectProperty", - "start": 10054, - "end": 10090, + "start": 10295, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 20 }, "end": { - "line": 226, + "line": 237, "column": 56 } }, @@ -10788,15 +11410,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10054, - "end": 10063, + "start": 10295, + "end": 10304, "loc": { "start": { - "line": 226, + "line": 237, "column": 20 }, "end": { - "line": 226, + "line": 237, "column": 29 }, "identifierName": "transform" @@ -10805,29 +11427,29 @@ }, "value": { "type": "MemberExpression", - "start": 10065, - "end": 10090, + "start": 10306, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 31 }, "end": { - "line": 226, + "line": 237, "column": 56 } }, "object": { "type": "Identifier", - "start": 10065, - "end": 10080, + "start": 10306, + "end": 10321, "loc": { "start": { - "line": 226, + "line": 237, "column": 31 }, "end": { - "line": 226, + "line": 237, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -10836,15 +11458,15 @@ }, "property": { "type": "Identifier", - "start": 10081, - "end": 10090, + "start": 10322, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 47 }, "end": { - "line": 226, + "line": 237, "column": 56 }, "identifierName": "transform" @@ -10856,15 +11478,15 @@ }, { "type": "ObjectProperty", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 } }, @@ -10873,15 +11495,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 }, "identifierName": "log" @@ -10890,15 +11512,15 @@ }, "value": { "type": "Identifier", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 }, "identifierName": "log" @@ -10916,15 +11538,15 @@ }, { "type": "BreakStatement", - "start": 10152, - "end": 10158, + "start": 10393, + "end": 10399, "loc": { "start": { - "line": 229, + "line": 240, "column": 16 }, "end": { - "line": 229, + "line": 240, "column": 22 } }, @@ -10933,15 +11555,15 @@ ], "test": { "type": "StringLiteral", - "start": 9785, - "end": 9791, + "start": 10026, + "end": 10032, "loc": { "start": { - "line": 219, + "line": 230, "column": 17 }, "end": { - "line": 219, + "line": 230, "column": 23 } }, @@ -10954,59 +11576,59 @@ }, { "type": "SwitchCase", - "start": 10172, - "end": 10616, + "start": 10413, + "end": 10857, "loc": { "start": { - "line": 231, + "line": 242, "column": 12 }, "end": { - "line": 243, + "line": 254, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 10200, - "end": 10239, + "start": 10441, + "end": 10480, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 55 } }, "expression": { "type": "AssignmentExpression", - "start": 10200, - "end": 10238, + "start": 10441, + "end": 10479, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 54 } }, "operator": "=", "left": { "type": "Identifier", - "start": 10200, - "end": 10210, + "start": 10441, + "end": 10451, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 26 }, "identifierName": "sourceData" @@ -11015,29 +11637,29 @@ }, "right": { "type": "CallExpression", - "start": 10213, - "end": 10238, + "start": 10454, + "end": 10479, "loc": { "start": { - "line": 232, + "line": 243, "column": 29 }, "end": { - "line": 232, + "line": 243, "column": 54 } }, "callee": { "type": "Identifier", - "start": 10213, - "end": 10226, + "start": 10454, + "end": 10467, "loc": { "start": { - "line": 232, + "line": 243, "column": 29 }, "end": { - "line": 232, + "line": 243, "column": 42 }, "identifierName": "toArrayBuffer" @@ -11047,15 +11669,15 @@ "arguments": [ { "type": "Identifier", - "start": 10227, - "end": 10237, + "start": 10468, + "end": 10478, "loc": { "start": { - "line": 232, + "line": 243, "column": 43 }, "end": { - "line": 232, + "line": 243, "column": 53 }, "identifierName": "sourceData" @@ -11068,43 +11690,43 @@ }, { "type": "ExpressionStatement", - "start": 10256, - "end": 10593, + "start": 10497, + "end": 10834, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 242, + "line": 253, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 10256, - "end": 10592, + "start": 10497, + "end": 10833, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 242, + "line": 253, "column": 18 } }, "callee": { "type": "Identifier", - "start": 10256, - "end": 10263, + "start": 10497, + "end": 10504, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 233, + "line": 244, "column": 23 }, "identifierName": "convert" @@ -11114,15 +11736,15 @@ "arguments": [ { "type": "Identifier", - "start": 10264, - "end": 10285, + "start": 10505, + "end": 10526, "loc": { "start": { - "line": 233, + "line": 244, "column": 24 }, "end": { - "line": 233, + "line": 244, "column": 45 }, "identifierName": "parseGLTFIntoXKTModel" @@ -11131,30 +11753,30 @@ }, { "type": "ObjectExpression", - "start": 10287, - "end": 10591, + "start": 10528, + "end": 10832, "loc": { "start": { - "line": 233, + "line": 244, "column": 47 }, "end": { - "line": 242, + "line": 253, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 10309, - "end": 10325, + "start": 10550, + "end": 10566, "loc": { "start": { - "line": 234, + "line": 245, "column": 20 }, "end": { - "line": 234, + "line": 245, "column": 36 } }, @@ -11163,15 +11785,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10309, - "end": 10313, + "start": 10550, + "end": 10554, "loc": { "start": { - "line": 234, + "line": 245, "column": 20 }, "end": { - "line": 234, + "line": 245, "column": 24 }, "identifierName": "data" @@ -11180,15 +11802,15 @@ }, "value": { "type": "Identifier", - "start": 10315, - "end": 10325, + "start": 10556, + "end": 10566, "loc": { "start": { - "line": 234, + "line": 245, "column": 26 }, "end": { - "line": 234, + "line": 245, "column": 36 }, "identifierName": "sourceData" @@ -11198,15 +11820,15 @@ }, { "type": "ObjectProperty", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 } }, @@ -11215,15 +11837,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 }, "identifierName": "reuseGeometries" @@ -11232,15 +11854,15 @@ }, "value": { "type": "Identifier", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 }, "identifierName": "reuseGeometries" @@ -11253,15 +11875,15 @@ }, { "type": "ObjectProperty", - "start": 10384, - "end": 10405, + "start": 10625, + "end": 10646, "loc": { "start": { - "line": 236, + "line": 247, "column": 20 }, "end": { - "line": 236, + "line": 247, "column": 41 } }, @@ -11270,15 +11892,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10384, - "end": 10399, + "start": 10625, + "end": 10640, "loc": { "start": { - "line": 236, + "line": 247, "column": 20 }, "end": { - "line": 236, + "line": 247, "column": 35 }, "identifierName": "includeTextures" @@ -11287,15 +11909,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 10401, - "end": 10405, + "start": 10642, + "end": 10646, "loc": { "start": { - "line": 236, + "line": 247, "column": 37 }, "end": { - "line": 236, + "line": 247, "column": 41 } }, @@ -11304,15 +11926,15 @@ }, { "type": "ObjectProperty", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 } }, @@ -11321,15 +11943,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 }, "identifierName": "includeNormals" @@ -11338,15 +11960,15 @@ }, "value": { "type": "Identifier", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 }, "identifierName": "includeNormals" @@ -11359,15 +11981,15 @@ }, { "type": "ObjectProperty", - "start": 10463, - "end": 10491, + "start": 10704, + "end": 10732, "loc": { "start": { - "line": 238, + "line": 249, "column": 20 }, "end": { - "line": 238, + "line": 249, "column": 48 } }, @@ -11376,15 +11998,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10463, - "end": 10476, + "start": 10704, + "end": 10717, "loc": { "start": { - "line": 238, + "line": 249, "column": 20 }, "end": { - "line": 238, + "line": 249, "column": 33 }, "identifierName": "metaModelData" @@ -11393,15 +12015,15 @@ }, "value": { "type": "Identifier", - "start": 10478, - "end": 10491, + "start": 10719, + "end": 10732, "loc": { "start": { - "line": 238, + "line": 249, "column": 35 }, "end": { - "line": 238, + "line": 249, "column": 48 }, "identifierName": "metaModelJSON" @@ -11411,15 +12033,15 @@ }, { "type": "ObjectProperty", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 } }, @@ -11428,15 +12050,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 }, "identifierName": "xktModel" @@ -11445,15 +12067,15 @@ }, "value": { "type": "Identifier", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 }, "identifierName": "xktModel" @@ -11466,15 +12088,15 @@ }, { "type": "ObjectProperty", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 } }, @@ -11483,15 +12105,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 }, "identifierName": "stats" @@ -11500,15 +12122,15 @@ }, "value": { "type": "Identifier", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 }, "identifierName": "stats" @@ -11521,15 +12143,15 @@ }, { "type": "ObjectProperty", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 } }, @@ -11538,15 +12160,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 }, "identifierName": "log" @@ -11555,15 +12177,15 @@ }, "value": { "type": "Identifier", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 }, "identifierName": "log" @@ -11581,15 +12203,15 @@ }, { "type": "BreakStatement", - "start": 10610, - "end": 10616, + "start": 10851, + "end": 10857, "loc": { "start": { - "line": 243, + "line": 254, "column": 16 }, "end": { - "line": 243, + "line": 254, "column": 22 } }, @@ -11598,15 +12220,15 @@ ], "test": { "type": "StringLiteral", - "start": 10177, - "end": 10182, + "start": 10418, + "end": 10423, "loc": { "start": { - "line": 231, + "line": 242, "column": 17 }, "end": { - "line": 231, + "line": 242, "column": 22 } }, @@ -11619,59 +12241,59 @@ }, { "type": "SwitchCase", - "start": 10630, - "end": 11191, + "start": 10871, + "end": 11432, "loc": { "start": { - "line": 245, + "line": 256, "column": 12 }, "end": { - "line": 259, + "line": 270, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 10659, - "end": 10698, + "start": 10900, + "end": 10939, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 55 } }, "expression": { "type": "AssignmentExpression", - "start": 10659, - "end": 10697, + "start": 10900, + "end": 10938, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 54 } }, "operator": "=", "left": { "type": "Identifier", - "start": 10659, - "end": 10669, + "start": 10900, + "end": 10910, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 26 }, "identifierName": "sourceData" @@ -11680,29 +12302,29 @@ }, "right": { "type": "CallExpression", - "start": 10672, - "end": 10697, + "start": 10913, + "end": 10938, "loc": { "start": { - "line": 246, + "line": 257, "column": 29 }, "end": { - "line": 246, + "line": 257, "column": 54 } }, "callee": { "type": "Identifier", - "start": 10672, - "end": 10685, + "start": 10913, + "end": 10926, "loc": { "start": { - "line": 246, + "line": 257, "column": 29 }, "end": { - "line": 246, + "line": 257, "column": 42 }, "identifierName": "toArrayBuffer" @@ -11712,15 +12334,15 @@ "arguments": [ { "type": "Identifier", - "start": 10686, - "end": 10696, + "start": 10927, + "end": 10937, "loc": { "start": { - "line": 246, + "line": 257, "column": 43 }, "end": { - "line": 246, + "line": 257, "column": 53 }, "identifierName": "sourceData" @@ -11733,44 +12355,44 @@ }, { "type": "VariableDeclaration", - "start": 10715, - "end": 10771, + "start": 10956, + "end": 11012, "loc": { "start": { - "line": 247, + "line": 258, "column": 16 }, "end": { - "line": 247, + "line": 258, "column": 72 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 10721, - "end": 10770, + "start": 10962, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 22 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, "id": { "type": "Identifier", - "start": 10721, - "end": 10733, + "start": 10962, + "end": 10974, "loc": { "start": { - "line": 247, + "line": 258, "column": 22 }, "end": { - "line": 247, + "line": 258, "column": 34 }, "identifierName": "gltfBasePath" @@ -11779,29 +12401,29 @@ }, "init": { "type": "ConditionalExpression", - "start": 10736, - "end": 10770, + "start": 10977, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 37 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, "test": { "type": "Identifier", - "start": 10736, - "end": 10742, + "start": 10977, + "end": 10983, "loc": { "start": { - "line": 247, + "line": 258, "column": 37 }, "end": { - "line": 247, + "line": 258, "column": 43 }, "identifierName": "source" @@ -11810,43 +12432,43 @@ }, "consequent": { "type": "CallExpression", - "start": 10745, - "end": 10765, + "start": 10986, + "end": 11006, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 66 } }, "callee": { "type": "MemberExpression", - "start": 10745, - "end": 10757, + "start": 10986, + "end": 10998, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 58 } }, "object": { "type": "Identifier", - "start": 10745, - "end": 10749, + "start": 10986, + "end": 10990, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 50 }, "identifierName": "path" @@ -11855,15 +12477,15 @@ }, "property": { "type": "Identifier", - "start": 10750, - "end": 10757, + "start": 10991, + "end": 10998, "loc": { "start": { - "line": 247, + "line": 258, "column": 51 }, "end": { - "line": 247, + "line": 258, "column": 58 }, "identifierName": "dirname" @@ -11875,15 +12497,15 @@ "arguments": [ { "type": "Identifier", - "start": 10758, - "end": 10764, + "start": 10999, + "end": 11005, "loc": { "start": { - "line": 247, + "line": 258, "column": 59 }, "end": { - "line": 247, + "line": 258, "column": 65 }, "identifierName": "source" @@ -11894,15 +12516,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 10768, - "end": 10770, + "start": 11009, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 69 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, @@ -11919,43 +12541,43 @@ }, { "type": "ExpressionStatement", - "start": 10788, - "end": 11168, + "start": 11029, + "end": 11409, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 258, + "line": 269, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 10788, - "end": 11167, + "start": 11029, + "end": 11408, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 258, + "line": 269, "column": 18 } }, "callee": { "type": "Identifier", - "start": 10788, - "end": 10795, + "start": 11029, + "end": 11036, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 248, + "line": 259, "column": 23 }, "identifierName": "convert" @@ -11965,15 +12587,15 @@ "arguments": [ { "type": "Identifier", - "start": 10796, - "end": 10817, + "start": 11037, + "end": 11058, "loc": { "start": { - "line": 248, + "line": 259, "column": 24 }, "end": { - "line": 248, + "line": 259, "column": 45 }, "identifierName": "parseGLTFIntoXKTModel" @@ -11982,30 +12604,30 @@ }, { "type": "ObjectExpression", - "start": 10819, - "end": 11166, + "start": 11060, + "end": 11407, "loc": { "start": { - "line": 248, + "line": 259, "column": 47 }, "end": { - "line": 258, + "line": 269, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 10841, - "end": 10862, + "start": 11082, + "end": 11103, "loc": { "start": { - "line": 249, + "line": 260, "column": 20 }, "end": { - "line": 249, + "line": 260, "column": 41 } }, @@ -12014,15 +12636,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10841, - "end": 10848, + "start": 11082, + "end": 11089, "loc": { "start": { - "line": 249, + "line": 260, "column": 20 }, "end": { - "line": 249, + "line": 260, "column": 27 }, "identifierName": "baseUri" @@ -12031,15 +12653,15 @@ }, "value": { "type": "Identifier", - "start": 10850, - "end": 10862, + "start": 11091, + "end": 11103, "loc": { "start": { - "line": 249, + "line": 260, "column": 29 }, "end": { - "line": 249, + "line": 260, "column": 41 }, "identifierName": "gltfBasePath" @@ -12049,15 +12671,15 @@ }, { "type": "ObjectProperty", - "start": 10884, - "end": 10900, + "start": 11125, + "end": 11141, "loc": { "start": { - "line": 250, + "line": 261, "column": 20 }, "end": { - "line": 250, + "line": 261, "column": 36 } }, @@ -12066,15 +12688,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10884, - "end": 10888, + "start": 11125, + "end": 11129, "loc": { "start": { - "line": 250, + "line": 261, "column": 20 }, "end": { - "line": 250, + "line": 261, "column": 24 }, "identifierName": "data" @@ -12083,15 +12705,15 @@ }, "value": { "type": "Identifier", - "start": 10890, - "end": 10900, + "start": 11131, + "end": 11141, "loc": { "start": { - "line": 250, + "line": 261, "column": 26 }, "end": { - "line": 250, + "line": 261, "column": 36 }, "identifierName": "sourceData" @@ -12101,15 +12723,15 @@ }, { "type": "ObjectProperty", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 } }, @@ -12118,15 +12740,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 }, "identifierName": "reuseGeometries" @@ -12135,15 +12757,15 @@ }, "value": { "type": "Identifier", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 }, "identifierName": "reuseGeometries" @@ -12156,15 +12778,15 @@ }, { "type": "ObjectProperty", - "start": 10959, - "end": 10980, + "start": 11200, + "end": 11221, "loc": { "start": { - "line": 252, + "line": 263, "column": 20 }, "end": { - "line": 252, + "line": 263, "column": 41 } }, @@ -12173,15 +12795,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10959, - "end": 10974, + "start": 11200, + "end": 11215, "loc": { "start": { - "line": 252, + "line": 263, "column": 20 }, "end": { - "line": 252, + "line": 263, "column": 35 }, "identifierName": "includeTextures" @@ -12190,15 +12812,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 10976, - "end": 10980, + "start": 11217, + "end": 11221, "loc": { "start": { - "line": 252, + "line": 263, "column": 37 }, "end": { - "line": 252, + "line": 263, "column": 41 } }, @@ -12207,15 +12829,15 @@ }, { "type": "ObjectProperty", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 } }, @@ -12224,15 +12846,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 }, "identifierName": "includeNormals" @@ -12241,15 +12863,15 @@ }, "value": { "type": "Identifier", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 }, "identifierName": "includeNormals" @@ -12262,15 +12884,15 @@ }, { "type": "ObjectProperty", - "start": 11038, - "end": 11066, + "start": 11279, + "end": 11307, "loc": { "start": { - "line": 254, + "line": 265, "column": 20 }, "end": { - "line": 254, + "line": 265, "column": 48 } }, @@ -12279,15 +12901,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11038, - "end": 11051, + "start": 11279, + "end": 11292, "loc": { "start": { - "line": 254, + "line": 265, "column": 20 }, "end": { - "line": 254, + "line": 265, "column": 33 }, "identifierName": "metaModelData" @@ -12296,15 +12918,15 @@ }, "value": { "type": "Identifier", - "start": 11053, - "end": 11066, + "start": 11294, + "end": 11307, "loc": { "start": { - "line": 254, + "line": 265, "column": 35 }, "end": { - "line": 254, + "line": 265, "column": 48 }, "identifierName": "metaModelJSON" @@ -12314,15 +12936,15 @@ }, { "type": "ObjectProperty", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 } }, @@ -12331,15 +12953,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 }, "identifierName": "xktModel" @@ -12348,15 +12970,15 @@ }, "value": { "type": "Identifier", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 }, "identifierName": "xktModel" @@ -12369,15 +12991,15 @@ }, { "type": "ObjectProperty", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 } }, @@ -12386,15 +13008,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 }, "identifierName": "stats" @@ -12403,15 +13025,15 @@ }, "value": { "type": "Identifier", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 }, "identifierName": "stats" @@ -12424,15 +13046,15 @@ }, { "type": "ObjectProperty", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 } }, @@ -12441,15 +13063,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 }, "identifierName": "log" @@ -12458,15 +13080,15 @@ }, "value": { "type": "Identifier", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 }, "identifierName": "log" @@ -12484,15 +13106,15 @@ }, { "type": "BreakStatement", - "start": 11185, - "end": 11191, + "start": 11426, + "end": 11432, "loc": { "start": { - "line": 259, + "line": 270, "column": 16 }, "end": { - "line": 259, + "line": 270, "column": 22 } }, @@ -12503,15 +13125,15 @@ ], "test": { "type": "StringLiteral", - "start": 10635, - "end": 10641, + "start": 10876, + "end": 10882, "loc": { "start": { - "line": 245, + "line": 256, "column": 17 }, "end": { - "line": 245, + "line": 256, "column": 23 } }, @@ -12525,15 +13147,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -12541,15 +13163,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -12557,15 +13179,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -12573,15 +13195,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -12589,15 +13211,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -12605,15 +13227,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -12621,15 +13243,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -12637,15 +13259,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -12653,15 +13275,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -12669,15 +13291,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -12685,15 +13307,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -12701,15 +13323,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -12717,15 +13339,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -12733,15 +13355,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -12749,15 +13371,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -12765,15 +13387,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -12781,15 +13403,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -12797,15 +13419,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -12813,15 +13435,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -12829,15 +13451,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -12845,15 +13467,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -12861,15 +13483,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -12878,58 +13500,58 @@ }, { "type": "SwitchCase", - "start": 12216, - "end": 12569, + "start": 12457, + "end": 12810, "loc": { "start": { - "line": 284, + "line": 295, "column": 12 }, "end": { - "line": 295, + "line": 306, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 12244, - "end": 12546, + "start": 12485, + "end": 12787, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 294, + "line": 305, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 12244, - "end": 12545, + "start": 12485, + "end": 12786, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 294, + "line": 305, "column": 18 } }, "callee": { "type": "Identifier", - "start": 12244, - "end": 12251, + "start": 12485, + "end": 12492, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 285, + "line": 296, "column": 23 }, "identifierName": "convert" @@ -12939,15 +13561,15 @@ "arguments": [ { "type": "Identifier", - "start": 12252, - "end": 12272, + "start": 12493, + "end": 12513, "loc": { "start": { - "line": 285, + "line": 296, "column": 24 }, "end": { - "line": 285, + "line": 296, "column": 44 }, "identifierName": "parseIFCIntoXKTModel" @@ -12956,30 +13578,30 @@ }, { "type": "ObjectExpression", - "start": 12274, - "end": 12544, + "start": 12515, + "end": 12785, "loc": { "start": { - "line": 285, + "line": 296, "column": 46 }, "end": { - "line": 294, + "line": 305, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 } }, @@ -12988,15 +13610,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 }, "identifierName": "WebIFC" @@ -13005,15 +13627,15 @@ }, "value": { "type": "Identifier", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 }, "identifierName": "WebIFC" @@ -13026,15 +13648,15 @@ }, { "type": "ObjectProperty", - "start": 12324, - "end": 12340, + "start": 12565, + "end": 12581, "loc": { "start": { - "line": 287, + "line": 298, "column": 20 }, "end": { - "line": 287, + "line": 298, "column": 36 } }, @@ -13043,15 +13665,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12324, - "end": 12328, + "start": 12565, + "end": 12569, "loc": { "start": { - "line": 287, + "line": 298, "column": 20 }, "end": { - "line": 287, + "line": 298, "column": 24 }, "identifierName": "data" @@ -13060,15 +13682,15 @@ }, "value": { "type": "Identifier", - "start": 12330, - "end": 12340, + "start": 12571, + "end": 12581, "loc": { "start": { - "line": 287, + "line": 298, "column": 26 }, "end": { - "line": 287, + "line": 298, "column": 36 }, "identifierName": "sourceData" @@ -13078,15 +13700,15 @@ }, { "type": "ObjectProperty", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 } }, @@ -13095,15 +13717,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 }, "identifierName": "xktModel" @@ -13112,15 +13734,15 @@ }, "value": { "type": "Identifier", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 }, "identifierName": "xktModel" @@ -13133,15 +13755,15 @@ }, { "type": "ObjectProperty", - "start": 12392, - "end": 12406, + "start": 12633, + "end": 12647, "loc": { "start": { - "line": 289, + "line": 300, "column": 20 }, "end": { - "line": 289, + "line": 300, "column": 34 } }, @@ -13150,15 +13772,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12392, - "end": 12400, + "start": 12633, + "end": 12641, "loc": { "start": { - "line": 289, + "line": 300, "column": 20 }, "end": { - "line": 289, + "line": 300, "column": 28 }, "identifierName": "wasmPath" @@ -13167,15 +13789,15 @@ }, "value": { "type": "StringLiteral", - "start": 12402, - "end": 12406, + "start": 12643, + "end": 12647, "loc": { "start": { - "line": 289, + "line": 300, "column": 30 }, "end": { - "line": 289, + "line": 300, "column": 34 } }, @@ -13188,15 +13810,15 @@ }, { "type": "ObjectProperty", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 } }, @@ -13205,15 +13827,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 }, "identifierName": "includeTypes" @@ -13222,15 +13844,15 @@ }, "value": { "type": "Identifier", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 }, "identifierName": "includeTypes" @@ -13243,15 +13865,15 @@ }, { "type": "ObjectProperty", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 } }, @@ -13260,15 +13882,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 }, "identifierName": "excludeTypes" @@ -13277,15 +13899,15 @@ }, "value": { "type": "Identifier", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 }, "identifierName": "excludeTypes" @@ -13298,15 +13920,15 @@ }, { "type": "ObjectProperty", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 } }, @@ -13315,15 +13937,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 }, "identifierName": "stats" @@ -13332,15 +13954,15 @@ }, "value": { "type": "Identifier", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 }, "identifierName": "stats" @@ -13353,15 +13975,15 @@ }, { "type": "ObjectProperty", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 } }, @@ -13370,15 +13992,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 }, "identifierName": "log" @@ -13387,15 +14009,15 @@ }, "value": { "type": "Identifier", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 }, "identifierName": "log" @@ -13413,15 +14035,15 @@ }, { "type": "BreakStatement", - "start": 12563, - "end": 12569, + "start": 12804, + "end": 12810, "loc": { "start": { - "line": 295, + "line": 306, "column": 16 }, "end": { - "line": 295, + "line": 306, "column": 22 } }, @@ -13430,15 +14052,15 @@ ], "test": { "type": "StringLiteral", - "start": 12221, - "end": 12226, + "start": 12462, + "end": 12467, "loc": { "start": { - "line": 284, + "line": 295, "column": 17 }, "end": { - "line": 284, + "line": 295, "column": 22 } }, @@ -13453,15 +14075,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -13469,15 +14091,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -13485,15 +14107,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -13501,15 +14123,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -13517,15 +14139,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -13533,15 +14155,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -13549,15 +14171,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -13565,15 +14187,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -13581,15 +14203,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -13597,15 +14219,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -13613,15 +14235,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -13629,15 +14251,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -13645,15 +14267,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -13661,15 +14283,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -13677,15 +14299,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -13693,15 +14315,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -13709,15 +14331,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -13725,15 +14347,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -13741,15 +14363,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -13757,15 +14379,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -13773,15 +14395,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -13789,15 +14411,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -13806,58 +14428,58 @@ }, { "type": "SwitchCase", - "start": 12583, - "end": 13089, + "start": 12824, + "end": 13330, "loc": { "start": { - "line": 297, + "line": 308, "column": 12 }, "end": { - "line": 309, + "line": 320, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 12611, - "end": 13066, + "start": 12852, + "end": 13307, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 308, + "line": 319, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 12611, - "end": 13065, + "start": 12852, + "end": 13306, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 308, + "line": 319, "column": 18 } }, "callee": { "type": "Identifier", - "start": 12611, - "end": 12618, + "start": 12852, + "end": 12859, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 298, + "line": 309, "column": 23 }, "identifierName": "convert" @@ -13867,15 +14489,15 @@ "arguments": [ { "type": "Identifier", - "start": 12619, - "end": 12639, + "start": 12860, + "end": 12880, "loc": { "start": { - "line": 298, + "line": 309, "column": 24 }, "end": { - "line": 298, + "line": 309, "column": 44 }, "identifierName": "parseLASIntoXKTModel" @@ -13884,30 +14506,30 @@ }, { "type": "ObjectExpression", - "start": 12641, - "end": 13064, + "start": 12882, + "end": 13305, "loc": { "start": { - "line": 298, + "line": 309, "column": 46 }, "end": { - "line": 308, + "line": 319, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 12663, - "end": 12679, + "start": 12904, + "end": 12920, "loc": { "start": { - "line": 299, + "line": 310, "column": 20 }, "end": { - "line": 299, + "line": 310, "column": 36 } }, @@ -13916,15 +14538,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12663, - "end": 12667, + "start": 12904, + "end": 12908, "loc": { "start": { - "line": 299, + "line": 310, "column": 20 }, "end": { - "line": 299, + "line": 310, "column": 24 }, "identifierName": "data" @@ -13933,15 +14555,15 @@ }, "value": { "type": "Identifier", - "start": 12669, - "end": 12679, + "start": 12910, + "end": 12920, "loc": { "start": { - "line": 299, + "line": 310, "column": 26 }, "end": { - "line": 299, + "line": 310, "column": 36 }, "identifierName": "sourceData" @@ -13951,15 +14573,15 @@ }, { "type": "ObjectProperty", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 } }, @@ -13968,15 +14590,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 }, "identifierName": "xktModel" @@ -13985,15 +14607,15 @@ }, "value": { "type": "Identifier", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 }, "identifierName": "xktModel" @@ -14006,15 +14628,15 @@ }, { "type": "ObjectProperty", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 } }, @@ -14023,15 +14645,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 }, "identifierName": "stats" @@ -14040,15 +14662,15 @@ }, "value": { "type": "Identifier", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 }, "identifierName": "stats" @@ -14061,15 +14683,15 @@ }, { "type": "ObjectProperty", - "start": 12758, - "end": 12784, + "start": 12999, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 20 }, "end": { - "line": 302, + "line": 313, "column": 46 } }, @@ -14078,15 +14700,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12758, - "end": 12762, + "start": 12999, + "end": 13003, "loc": { "start": { - "line": 302, + "line": 313, "column": 20 }, "end": { - "line": 302, + "line": 313, "column": 24 }, "identifierName": "fp64" @@ -14095,29 +14717,29 @@ }, "value": { "type": "MemberExpression", - "start": 12764, - "end": 12784, + "start": 13005, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 26 }, "end": { - "line": 302, + "line": 313, "column": 46 } }, "object": { "type": "Identifier", - "start": 12764, - "end": 12779, + "start": 13005, + "end": 13020, "loc": { "start": { - "line": 302, + "line": 313, "column": 26 }, "end": { - "line": 302, + "line": 313, "column": 41 }, "identifierName": "fileTypeConfigs" @@ -14126,15 +14748,15 @@ }, "property": { "type": "Identifier", - "start": 12780, - "end": 12784, + "start": 13021, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 42 }, "end": { - "line": 302, + "line": 313, "column": 46 }, "identifierName": "fp64" @@ -14146,15 +14768,15 @@ }, { "type": "ObjectProperty", - "start": 12806, - "end": 12844, + "start": 13047, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 20 }, "end": { - "line": 303, + "line": 314, "column": 58 } }, @@ -14163,15 +14785,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12806, - "end": 12816, + "start": 13047, + "end": 13057, "loc": { "start": { - "line": 303, + "line": 314, "column": 20 }, "end": { - "line": 303, + "line": 314, "column": 30 }, "identifierName": "colorDepth" @@ -14180,29 +14802,29 @@ }, "value": { "type": "MemberExpression", - "start": 12818, - "end": 12844, + "start": 13059, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 32 }, "end": { - "line": 303, + "line": 314, "column": 58 } }, "object": { "type": "Identifier", - "start": 12818, - "end": 12833, + "start": 13059, + "end": 13074, "loc": { "start": { - "line": 303, + "line": 314, "column": 32 }, "end": { - "line": 303, + "line": 314, "column": 47 }, "identifierName": "fileTypeConfigs" @@ -14211,15 +14833,15 @@ }, "property": { "type": "Identifier", - "start": 12834, - "end": 12844, + "start": 13075, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 48 }, "end": { - "line": 303, + "line": 314, "column": 58 }, "identifierName": "colorDepth" @@ -14231,15 +14853,15 @@ }, { "type": "ObjectProperty", - "start": 12866, - "end": 12896, + "start": 13107, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 20 }, "end": { - "line": 304, + "line": 315, "column": 50 } }, @@ -14248,15 +14870,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12866, - "end": 12872, + "start": 13107, + "end": 13113, "loc": { "start": { - "line": 304, + "line": 315, "column": 20 }, "end": { - "line": 304, + "line": 315, "column": 26 }, "identifierName": "center" @@ -14265,29 +14887,29 @@ }, "value": { "type": "MemberExpression", - "start": 12874, - "end": 12896, + "start": 13115, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 28 }, "end": { - "line": 304, + "line": 315, "column": 50 } }, "object": { "type": "Identifier", - "start": 12874, - "end": 12889, + "start": 13115, + "end": 13130, "loc": { "start": { - "line": 304, + "line": 315, "column": 28 }, "end": { - "line": 304, + "line": 315, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -14296,15 +14918,15 @@ }, "property": { "type": "Identifier", - "start": 12890, - "end": 12896, + "start": 13131, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 44 }, "end": { - "line": 304, + "line": 315, "column": 50 }, "identifierName": "center" @@ -14316,15 +14938,15 @@ }, { "type": "ObjectProperty", - "start": 12918, - "end": 12954, + "start": 13159, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 20 }, "end": { - "line": 305, + "line": 316, "column": 56 } }, @@ -14333,15 +14955,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12918, - "end": 12927, + "start": 13159, + "end": 13168, "loc": { "start": { - "line": 305, + "line": 316, "column": 20 }, "end": { - "line": 305, + "line": 316, "column": 29 }, "identifierName": "transform" @@ -14350,29 +14972,29 @@ }, "value": { "type": "MemberExpression", - "start": 12929, - "end": 12954, + "start": 13170, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 31 }, "end": { - "line": 305, + "line": 316, "column": 56 } }, "object": { "type": "Identifier", - "start": 12929, - "end": 12944, + "start": 13170, + "end": 13185, "loc": { "start": { - "line": 305, + "line": 316, "column": 31 }, "end": { - "line": 305, + "line": 316, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -14381,15 +15003,15 @@ }, "property": { "type": "Identifier", - "start": 12945, - "end": 12954, + "start": 13186, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 47 }, "end": { - "line": 305, + "line": 316, "column": 56 }, "identifierName": "transform" @@ -14401,15 +15023,15 @@ }, { "type": "ObjectProperty", - "start": 12976, - "end": 13021, + "start": 13217, + "end": 13262, "loc": { "start": { - "line": 306, + "line": 317, "column": 20 }, "end": { - "line": 306, + "line": 317, "column": 65 } }, @@ -14418,15 +15040,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12976, - "end": 12980, + "start": 13217, + "end": 13221, "loc": { "start": { - "line": 306, + "line": 317, "column": 20 }, "end": { - "line": 306, + "line": 317, "column": 24 }, "identifierName": "skip" @@ -14435,29 +15057,29 @@ }, "value": { "type": "CallExpression", - "start": 12982, - "end": 13021, + "start": 13223, + "end": 13262, "loc": { "start": { - "line": 306, + "line": 317, "column": 26 }, "end": { - "line": 306, + "line": 317, "column": 65 } }, "callee": { "type": "Identifier", - "start": 12982, - "end": 12996, + "start": 13223, + "end": 13237, "loc": { "start": { - "line": 306, + "line": 317, "column": 26 }, "end": { - "line": 306, + "line": 317, "column": 40 }, "identifierName": "overrideOption" @@ -14467,29 +15089,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 12997, - "end": 13017, + "start": 13238, + "end": 13258, "loc": { "start": { - "line": 306, + "line": 317, "column": 41 }, "end": { - "line": 306, + "line": 317, "column": 61 } }, "object": { "type": "Identifier", - "start": 12997, - "end": 13012, + "start": 13238, + "end": 13253, "loc": { "start": { - "line": 306, + "line": 317, "column": 41 }, "end": { - "line": 306, + "line": 317, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -14498,15 +15120,15 @@ }, "property": { "type": "Identifier", - "start": 13013, - "end": 13017, + "start": 13254, + "end": 13258, "loc": { "start": { - "line": 306, + "line": 317, "column": 57 }, "end": { - "line": 306, + "line": 317, "column": 61 }, "identifierName": "skip" @@ -14517,15 +15139,15 @@ }, { "type": "NumericLiteral", - "start": 13019, - "end": 13020, + "start": 13260, + "end": 13261, "loc": { "start": { - "line": 306, + "line": 317, "column": 63 }, "end": { - "line": 306, + "line": 317, "column": 64 } }, @@ -14540,15 +15162,15 @@ }, { "type": "ObjectProperty", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 } }, @@ -14557,15 +15179,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 }, "identifierName": "log" @@ -14574,15 +15196,15 @@ }, "value": { "type": "Identifier", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 }, "identifierName": "log" @@ -14600,15 +15222,15 @@ }, { "type": "BreakStatement", - "start": 13083, - "end": 13089, + "start": 13324, + "end": 13330, "loc": { "start": { - "line": 309, + "line": 320, "column": 16 }, "end": { - "line": 309, + "line": 320, "column": 22 } }, @@ -14617,15 +15239,15 @@ ], "test": { "type": "StringLiteral", - "start": 12588, - "end": 12593, + "start": 12829, + "end": 12834, "loc": { "start": { - "line": 297, + "line": 308, "column": 17 }, "end": { - "line": 297, + "line": 308, "column": 22 } }, @@ -14638,58 +15260,58 @@ }, { "type": "SwitchCase", - "start": 13103, - "end": 13609, + "start": 13344, + "end": 13850, "loc": { "start": { - "line": 311, + "line": 322, "column": 12 }, "end": { - "line": 323, + "line": 334, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13131, - "end": 13586, + "start": 13372, + "end": 13827, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 322, + "line": 333, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13131, - "end": 13585, + "start": 13372, + "end": 13826, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 322, + "line": 333, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13131, - "end": 13138, + "start": 13372, + "end": 13379, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 312, + "line": 323, "column": 23 }, "identifierName": "convert" @@ -14699,15 +15321,15 @@ "arguments": [ { "type": "Identifier", - "start": 13139, - "end": 13159, + "start": 13380, + "end": 13400, "loc": { "start": { - "line": 312, + "line": 323, "column": 24 }, "end": { - "line": 312, + "line": 323, "column": 44 }, "identifierName": "parseLASIntoXKTModel" @@ -14716,30 +15338,30 @@ }, { "type": "ObjectExpression", - "start": 13161, - "end": 13584, + "start": 13402, + "end": 13825, "loc": { "start": { - "line": 312, + "line": 323, "column": 46 }, "end": { - "line": 322, + "line": 333, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13183, - "end": 13199, + "start": 13424, + "end": 13440, "loc": { "start": { - "line": 313, + "line": 324, "column": 20 }, "end": { - "line": 313, + "line": 324, "column": 36 } }, @@ -14748,15 +15370,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13183, - "end": 13187, + "start": 13424, + "end": 13428, "loc": { "start": { - "line": 313, + "line": 324, "column": 20 }, "end": { - "line": 313, + "line": 324, "column": 24 }, "identifierName": "data" @@ -14765,15 +15387,15 @@ }, "value": { "type": "Identifier", - "start": 13189, - "end": 13199, + "start": 13430, + "end": 13440, "loc": { "start": { - "line": 313, + "line": 324, "column": 26 }, "end": { - "line": 313, + "line": 324, "column": 36 }, "identifierName": "sourceData" @@ -14783,15 +15405,15 @@ }, { "type": "ObjectProperty", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 } }, @@ -14800,15 +15422,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 }, "identifierName": "xktModel" @@ -14817,15 +15439,15 @@ }, "value": { "type": "Identifier", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 }, "identifierName": "xktModel" @@ -14838,15 +15460,15 @@ }, { "type": "ObjectProperty", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 } }, @@ -14855,15 +15477,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 }, "identifierName": "stats" @@ -14872,15 +15494,15 @@ }, "value": { "type": "Identifier", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 }, "identifierName": "stats" @@ -14893,15 +15515,15 @@ }, { "type": "ObjectProperty", - "start": 13278, - "end": 13304, + "start": 13519, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 20 }, "end": { - "line": 316, + "line": 327, "column": 46 } }, @@ -14910,15 +15532,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13278, - "end": 13282, + "start": 13519, + "end": 13523, "loc": { "start": { - "line": 316, + "line": 327, "column": 20 }, "end": { - "line": 316, + "line": 327, "column": 24 }, "identifierName": "fp64" @@ -14927,29 +15549,29 @@ }, "value": { "type": "MemberExpression", - "start": 13284, - "end": 13304, + "start": 13525, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 26 }, "end": { - "line": 316, + "line": 327, "column": 46 } }, "object": { "type": "Identifier", - "start": 13284, - "end": 13299, + "start": 13525, + "end": 13540, "loc": { "start": { - "line": 316, + "line": 327, "column": 26 }, "end": { - "line": 316, + "line": 327, "column": 41 }, "identifierName": "fileTypeConfigs" @@ -14958,15 +15580,15 @@ }, "property": { "type": "Identifier", - "start": 13300, - "end": 13304, + "start": 13541, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 42 }, "end": { - "line": 316, + "line": 327, "column": 46 }, "identifierName": "fp64" @@ -14978,15 +15600,15 @@ }, { "type": "ObjectProperty", - "start": 13326, - "end": 13364, + "start": 13567, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 20 }, "end": { - "line": 317, + "line": 328, "column": 58 } }, @@ -14995,15 +15617,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13326, - "end": 13336, + "start": 13567, + "end": 13577, "loc": { "start": { - "line": 317, + "line": 328, "column": 20 }, "end": { - "line": 317, + "line": 328, "column": 30 }, "identifierName": "colorDepth" @@ -15012,29 +15634,29 @@ }, "value": { "type": "MemberExpression", - "start": 13338, - "end": 13364, + "start": 13579, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 32 }, "end": { - "line": 317, + "line": 328, "column": 58 } }, "object": { "type": "Identifier", - "start": 13338, - "end": 13353, + "start": 13579, + "end": 13594, "loc": { "start": { - "line": 317, + "line": 328, "column": 32 }, "end": { - "line": 317, + "line": 328, "column": 47 }, "identifierName": "fileTypeConfigs" @@ -15043,15 +15665,15 @@ }, "property": { "type": "Identifier", - "start": 13354, - "end": 13364, + "start": 13595, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 48 }, "end": { - "line": 317, + "line": 328, "column": 58 }, "identifierName": "colorDepth" @@ -15063,15 +15685,15 @@ }, { "type": "ObjectProperty", - "start": 13386, - "end": 13416, + "start": 13627, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 20 }, "end": { - "line": 318, + "line": 329, "column": 50 } }, @@ -15080,15 +15702,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13386, - "end": 13392, + "start": 13627, + "end": 13633, "loc": { "start": { - "line": 318, + "line": 329, "column": 20 }, "end": { - "line": 318, + "line": 329, "column": 26 }, "identifierName": "center" @@ -15097,29 +15719,29 @@ }, "value": { "type": "MemberExpression", - "start": 13394, - "end": 13416, + "start": 13635, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 28 }, "end": { - "line": 318, + "line": 329, "column": 50 } }, "object": { "type": "Identifier", - "start": 13394, - "end": 13409, + "start": 13635, + "end": 13650, "loc": { "start": { - "line": 318, + "line": 329, "column": 28 }, "end": { - "line": 318, + "line": 329, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -15128,15 +15750,15 @@ }, "property": { "type": "Identifier", - "start": 13410, - "end": 13416, + "start": 13651, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 44 }, "end": { - "line": 318, + "line": 329, "column": 50 }, "identifierName": "center" @@ -15148,15 +15770,15 @@ }, { "type": "ObjectProperty", - "start": 13438, - "end": 13474, + "start": 13679, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 20 }, "end": { - "line": 319, + "line": 330, "column": 56 } }, @@ -15165,15 +15787,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13438, - "end": 13447, + "start": 13679, + "end": 13688, "loc": { "start": { - "line": 319, + "line": 330, "column": 20 }, "end": { - "line": 319, + "line": 330, "column": 29 }, "identifierName": "transform" @@ -15182,29 +15804,29 @@ }, "value": { "type": "MemberExpression", - "start": 13449, - "end": 13474, + "start": 13690, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 31 }, "end": { - "line": 319, + "line": 330, "column": 56 } }, "object": { "type": "Identifier", - "start": 13449, - "end": 13464, + "start": 13690, + "end": 13705, "loc": { "start": { - "line": 319, + "line": 330, "column": 31 }, "end": { - "line": 319, + "line": 330, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -15213,15 +15835,15 @@ }, "property": { "type": "Identifier", - "start": 13465, - "end": 13474, + "start": 13706, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 47 }, "end": { - "line": 319, + "line": 330, "column": 56 }, "identifierName": "transform" @@ -15233,15 +15855,15 @@ }, { "type": "ObjectProperty", - "start": 13496, - "end": 13541, + "start": 13737, + "end": 13782, "loc": { "start": { - "line": 320, + "line": 331, "column": 20 }, "end": { - "line": 320, + "line": 331, "column": 65 } }, @@ -15250,15 +15872,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13496, - "end": 13500, + "start": 13737, + "end": 13741, "loc": { "start": { - "line": 320, + "line": 331, "column": 20 }, "end": { - "line": 320, + "line": 331, "column": 24 }, "identifierName": "skip" @@ -15267,29 +15889,29 @@ }, "value": { "type": "CallExpression", - "start": 13502, - "end": 13541, + "start": 13743, + "end": 13782, "loc": { "start": { - "line": 320, + "line": 331, "column": 26 }, "end": { - "line": 320, + "line": 331, "column": 65 } }, "callee": { "type": "Identifier", - "start": 13502, - "end": 13516, + "start": 13743, + "end": 13757, "loc": { "start": { - "line": 320, + "line": 331, "column": 26 }, "end": { - "line": 320, + "line": 331, "column": 40 }, "identifierName": "overrideOption" @@ -15299,29 +15921,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 13517, - "end": 13537, + "start": 13758, + "end": 13778, "loc": { "start": { - "line": 320, + "line": 331, "column": 41 }, "end": { - "line": 320, + "line": 331, "column": 61 } }, "object": { "type": "Identifier", - "start": 13517, - "end": 13532, + "start": 13758, + "end": 13773, "loc": { "start": { - "line": 320, + "line": 331, "column": 41 }, "end": { - "line": 320, + "line": 331, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -15330,15 +15952,15 @@ }, "property": { "type": "Identifier", - "start": 13533, - "end": 13537, + "start": 13774, + "end": 13778, "loc": { "start": { - "line": 320, + "line": 331, "column": 57 }, "end": { - "line": 320, + "line": 331, "column": 61 }, "identifierName": "skip" @@ -15349,15 +15971,15 @@ }, { "type": "NumericLiteral", - "start": 13539, - "end": 13540, + "start": 13780, + "end": 13781, "loc": { "start": { - "line": 320, + "line": 331, "column": 63 }, "end": { - "line": 320, + "line": 331, "column": 64 } }, @@ -15372,15 +15994,15 @@ }, { "type": "ObjectProperty", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 } }, @@ -15389,15 +16011,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 }, "identifierName": "log" @@ -15406,15 +16028,15 @@ }, "value": { "type": "Identifier", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 }, "identifierName": "log" @@ -15432,15 +16054,15 @@ }, { "type": "BreakStatement", - "start": 13603, - "end": 13609, + "start": 13844, + "end": 13850, "loc": { "start": { - "line": 323, + "line": 334, "column": 16 }, "end": { - "line": 323, + "line": 334, "column": 22 } }, @@ -15449,15 +16071,15 @@ ], "test": { "type": "StringLiteral", - "start": 13108, - "end": 13113, + "start": 13349, + "end": 13354, "loc": { "start": { - "line": 311, + "line": 322, "column": 17 }, "end": { - "line": 311, + "line": 322, "column": 22 } }, @@ -15470,58 +16092,58 @@ }, { "type": "SwitchCase", - "start": 13623, - "end": 13844, + "start": 13864, + "end": 14085, "loc": { "start": { - "line": 325, + "line": 336, "column": 12 }, "end": { - "line": 332, + "line": 343, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13651, - "end": 13821, + "start": 13892, + "end": 14062, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 331, + "line": 342, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13651, - "end": 13820, + "start": 13892, + "end": 14061, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 331, + "line": 342, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13651, - "end": 13658, + "start": 13892, + "end": 13899, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 326, + "line": 337, "column": 23 }, "identifierName": "convert" @@ -15531,15 +16153,15 @@ "arguments": [ { "type": "Identifier", - "start": 13659, - "end": 13679, + "start": 13900, + "end": 13920, "loc": { "start": { - "line": 326, + "line": 337, "column": 24 }, "end": { - "line": 326, + "line": 337, "column": 44 }, "identifierName": "parsePCDIntoXKTModel" @@ -15548,30 +16170,30 @@ }, { "type": "ObjectExpression", - "start": 13681, - "end": 13819, + "start": 13922, + "end": 14060, "loc": { "start": { - "line": 326, + "line": 337, "column": 46 }, "end": { - "line": 331, + "line": 342, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13703, - "end": 13719, + "start": 13944, + "end": 13960, "loc": { "start": { - "line": 327, + "line": 338, "column": 20 }, "end": { - "line": 327, + "line": 338, "column": 36 } }, @@ -15580,15 +16202,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13703, - "end": 13707, + "start": 13944, + "end": 13948, "loc": { "start": { - "line": 327, + "line": 338, "column": 20 }, "end": { - "line": 327, + "line": 338, "column": 24 }, "identifierName": "data" @@ -15597,15 +16219,15 @@ }, "value": { "type": "Identifier", - "start": 13709, - "end": 13719, + "start": 13950, + "end": 13960, "loc": { "start": { - "line": 327, + "line": 338, "column": 26 }, "end": { - "line": 327, + "line": 338, "column": 36 }, "identifierName": "sourceData" @@ -15615,15 +16237,15 @@ }, { "type": "ObjectProperty", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 } }, @@ -15632,15 +16254,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 }, "identifierName": "xktModel" @@ -15649,15 +16271,15 @@ }, "value": { "type": "Identifier", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 }, "identifierName": "xktModel" @@ -15670,15 +16292,15 @@ }, { "type": "ObjectProperty", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 } }, @@ -15687,15 +16309,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 }, "identifierName": "stats" @@ -15704,15 +16326,15 @@ }, "value": { "type": "Identifier", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 }, "identifierName": "stats" @@ -15725,15 +16347,15 @@ }, { "type": "ObjectProperty", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 } }, @@ -15742,15 +16364,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 }, "identifierName": "log" @@ -15759,15 +16381,15 @@ }, "value": { "type": "Identifier", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 }, "identifierName": "log" @@ -15785,15 +16407,15 @@ }, { "type": "BreakStatement", - "start": 13838, - "end": 13844, + "start": 14079, + "end": 14085, "loc": { "start": { - "line": 332, + "line": 343, "column": 16 }, "end": { - "line": 332, + "line": 343, "column": 22 } }, @@ -15802,15 +16424,15 @@ ], "test": { "type": "StringLiteral", - "start": 13628, - "end": 13633, + "start": 13869, + "end": 13874, "loc": { "start": { - "line": 325, + "line": 336, "column": 17 }, "end": { - "line": 325, + "line": 336, "column": 22 } }, @@ -15823,58 +16445,58 @@ }, { "type": "SwitchCase", - "start": 13858, - "end": 14079, + "start": 14099, + "end": 14320, "loc": { "start": { - "line": 334, + "line": 345, "column": 12 }, "end": { - "line": 341, + "line": 352, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13886, - "end": 14056, + "start": 14127, + "end": 14297, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 340, + "line": 351, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13886, - "end": 14055, + "start": 14127, + "end": 14296, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 340, + "line": 351, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13886, - "end": 13893, + "start": 14127, + "end": 14134, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 335, + "line": 346, "column": 23 }, "identifierName": "convert" @@ -15884,15 +16506,15 @@ "arguments": [ { "type": "Identifier", - "start": 13894, - "end": 13914, + "start": 14135, + "end": 14155, "loc": { "start": { - "line": 335, + "line": 346, "column": 24 }, "end": { - "line": 335, + "line": 346, "column": 44 }, "identifierName": "parsePLYIntoXKTModel" @@ -15901,30 +16523,30 @@ }, { "type": "ObjectExpression", - "start": 13916, - "end": 14054, + "start": 14157, + "end": 14295, "loc": { "start": { - "line": 335, + "line": 346, "column": 46 }, "end": { - "line": 340, + "line": 351, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13938, - "end": 13954, + "start": 14179, + "end": 14195, "loc": { "start": { - "line": 336, + "line": 347, "column": 20 }, "end": { - "line": 336, + "line": 347, "column": 36 } }, @@ -15933,15 +16555,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13938, - "end": 13942, + "start": 14179, + "end": 14183, "loc": { "start": { - "line": 336, + "line": 347, "column": 20 }, "end": { - "line": 336, + "line": 347, "column": 24 }, "identifierName": "data" @@ -15950,15 +16572,15 @@ }, "value": { "type": "Identifier", - "start": 13944, - "end": 13954, + "start": 14185, + "end": 14195, "loc": { "start": { - "line": 336, + "line": 347, "column": 26 }, "end": { - "line": 336, + "line": 347, "column": 36 }, "identifierName": "sourceData" @@ -15968,15 +16590,15 @@ }, { "type": "ObjectProperty", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 } }, @@ -15985,15 +16607,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 }, "identifierName": "xktModel" @@ -16002,15 +16624,15 @@ }, "value": { "type": "Identifier", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 }, "identifierName": "xktModel" @@ -16023,15 +16645,15 @@ }, { "type": "ObjectProperty", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 } }, @@ -16040,15 +16662,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 }, "identifierName": "stats" @@ -16057,15 +16679,15 @@ }, "value": { "type": "Identifier", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 }, "identifierName": "stats" @@ -16078,15 +16700,15 @@ }, { "type": "ObjectProperty", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 } }, @@ -16095,15 +16717,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 }, "identifierName": "log" @@ -16112,15 +16734,15 @@ }, "value": { "type": "Identifier", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 }, "identifierName": "log" @@ -16138,15 +16760,15 @@ }, { "type": "BreakStatement", - "start": 14073, - "end": 14079, + "start": 14314, + "end": 14320, "loc": { "start": { - "line": 341, + "line": 352, "column": 16 }, "end": { - "line": 341, + "line": 352, "column": 22 } }, @@ -16155,15 +16777,15 @@ ], "test": { "type": "StringLiteral", - "start": 13863, - "end": 13868, + "start": 14104, + "end": 14109, "loc": { "start": { - "line": 334, + "line": 345, "column": 17 }, "end": { - "line": 334, + "line": 345, "column": 22 } }, @@ -16176,58 +16798,58 @@ }, { "type": "SwitchCase", - "start": 14093, - "end": 14314, + "start": 14334, + "end": 14555, "loc": { "start": { - "line": 343, + "line": 354, "column": 12 }, "end": { - "line": 350, + "line": 361, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 14121, - "end": 14291, + "start": 14362, + "end": 14532, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 349, + "line": 360, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 14121, - "end": 14290, + "start": 14362, + "end": 14531, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 349, + "line": 360, "column": 18 } }, "callee": { "type": "Identifier", - "start": 14121, - "end": 14128, + "start": 14362, + "end": 14369, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 344, + "line": 355, "column": 23 }, "identifierName": "convert" @@ -16237,15 +16859,15 @@ "arguments": [ { "type": "Identifier", - "start": 14129, - "end": 14149, + "start": 14370, + "end": 14390, "loc": { "start": { - "line": 344, + "line": 355, "column": 24 }, "end": { - "line": 344, + "line": 355, "column": 44 }, "identifierName": "parseSTLIntoXKTModel" @@ -16254,30 +16876,30 @@ }, { "type": "ObjectExpression", - "start": 14151, - "end": 14289, + "start": 14392, + "end": 14530, "loc": { "start": { - "line": 344, + "line": 355, "column": 46 }, "end": { - "line": 349, + "line": 360, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 14173, - "end": 14189, + "start": 14414, + "end": 14430, "loc": { "start": { - "line": 345, + "line": 356, "column": 20 }, "end": { - "line": 345, + "line": 356, "column": 36 } }, @@ -16286,15 +16908,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14173, - "end": 14177, + "start": 14414, + "end": 14418, "loc": { "start": { - "line": 345, + "line": 356, "column": 20 }, "end": { - "line": 345, + "line": 356, "column": 24 }, "identifierName": "data" @@ -16303,15 +16925,15 @@ }, "value": { "type": "Identifier", - "start": 14179, - "end": 14189, + "start": 14420, + "end": 14430, "loc": { "start": { - "line": 345, + "line": 356, "column": 26 }, "end": { - "line": 345, + "line": 356, "column": 36 }, "identifierName": "sourceData" @@ -16321,15 +16943,15 @@ }, { "type": "ObjectProperty", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 } }, @@ -16338,15 +16960,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 }, "identifierName": "xktModel" @@ -16355,15 +16977,15 @@ }, "value": { "type": "Identifier", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 }, "identifierName": "xktModel" @@ -16376,15 +16998,15 @@ }, { "type": "ObjectProperty", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 } }, @@ -16393,15 +17015,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 }, "identifierName": "stats" @@ -16410,15 +17032,15 @@ }, "value": { "type": "Identifier", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 }, "identifierName": "stats" @@ -16431,15 +17053,15 @@ }, { "type": "ObjectProperty", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 } }, @@ -16448,15 +17070,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 }, "identifierName": "log" @@ -16465,15 +17087,15 @@ }, "value": { "type": "Identifier", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 }, "identifierName": "log" @@ -16491,15 +17113,15 @@ }, { "type": "BreakStatement", - "start": 14308, - "end": 14314, + "start": 14549, + "end": 14555, "loc": { "start": { - "line": 350, + "line": 361, "column": 16 }, "end": { - "line": 350, + "line": 361, "column": 22 } }, @@ -16508,15 +17130,15 @@ ], "test": { "type": "StringLiteral", - "start": 14098, - "end": 14103, + "start": 14339, + "end": 14344, "loc": { "start": { - "line": 343, + "line": 354, "column": 17 }, "end": { - "line": 343, + "line": 354, "column": 22 } }, @@ -16529,58 +17151,58 @@ }, { "type": "SwitchCase", - "start": 14328, - "end": 14431, + "start": 14569, + "end": 14672, "loc": { "start": { - "line": 352, + "line": 363, "column": 12 }, "end": { - "line": 354, + "line": 365, "column": 23 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 14353, - "end": 14407, + "start": 14594, + "end": 14648, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 14353, - "end": 14406, + "start": 14594, + "end": 14647, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 69 } }, "callee": { "type": "Identifier", - "start": 14353, - "end": 14359, + "start": 14594, + "end": 14600, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 22 }, "identifierName": "reject" @@ -16590,30 +17212,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 14360, - "end": 14405, + "start": 14601, + "end": 14646, "loc": { "start": { - "line": 353, + "line": 364, "column": 23 }, "end": { - "line": 353, + "line": 364, "column": 68 } }, "expressions": [ { "type": "Identifier", - "start": 14398, - "end": 14401, + "start": 14639, + "end": 14642, "loc": { "start": { - "line": 353, + "line": 364, "column": 61 }, "end": { - "line": 353, + "line": 364, "column": 64 }, "identifierName": "ext" @@ -16624,15 +17246,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 14361, - "end": 14396, + "start": 14602, + "end": 14637, "loc": { "start": { - "line": 353, + "line": 364, "column": 24 }, "end": { - "line": 353, + "line": 364, "column": 59 } }, @@ -16644,15 +17266,15 @@ }, { "type": "TemplateElement", - "start": 14402, - "end": 14404, + "start": 14643, + "end": 14645, "loc": { "start": { - "line": 353, + "line": 364, "column": 65 }, "end": { - "line": 353, + "line": 364, "column": 67 } }, @@ -16669,15 +17291,15 @@ }, { "type": "ReturnStatement", - "start": 14424, - "end": 14431, + "start": 14665, + "end": 14672, "loc": { "start": { - "line": 354, + "line": 365, "column": 16 }, "end": { - "line": 354, + "line": 365, "column": 23 } }, @@ -16690,29 +17312,29 @@ }, { "type": "FunctionDeclaration", - "start": 14451, - "end": 18120, + "start": 14692, + "end": 18361, "loc": { "start": { - "line": 357, + "line": 368, "column": 8 }, "end": { - "line": 435, + "line": 446, "column": 9 } }, "id": { "type": "Identifier", - "start": 14460, - "end": 14467, + "start": 14701, + "end": 14708, "loc": { "start": { - "line": 357, + "line": 368, "column": 17 }, "end": { - "line": 357, + "line": 368, "column": 24 }, "identifierName": "convert" @@ -16725,15 +17347,15 @@ "params": [ { "type": "Identifier", - "start": 14468, - "end": 14474, + "start": 14709, + "end": 14715, "loc": { "start": { - "line": 357, + "line": 368, "column": 25 }, "end": { - "line": 357, + "line": 368, "column": 31 }, "identifierName": "parser" @@ -16742,15 +17364,15 @@ }, { "type": "Identifier", - "start": 14476, - "end": 14491, + "start": 14717, + "end": 14732, "loc": { "start": { - "line": 357, + "line": 368, "column": 33 }, "end": { - "line": 357, + "line": 368, "column": 48 }, "identifierName": "converterParams" @@ -16760,86 +17382,86 @@ ], "body": { "type": "BlockStatement", - "start": 14493, - "end": 18120, + "start": 14734, + "end": 18361, "loc": { "start": { - "line": 357, + "line": 368, "column": 50 }, "end": { - "line": 435, + "line": 446, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 14508, - "end": 18110, + "start": 14749, + "end": 18351, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 434, + "line": 445, "column": 15 } }, "expression": { "type": "CallExpression", - "start": 14508, - "end": 18109, + "start": 14749, + "end": 18350, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 434, + "line": 445, "column": 14 } }, "callee": { "type": "MemberExpression", - "start": 14508, - "end": 14536, + "start": 14749, + "end": 14777, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 40 } }, "object": { "type": "CallExpression", - "start": 14508, - "end": 14531, + "start": 14749, + "end": 14772, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 35 } }, "callee": { "type": "Identifier", - "start": 14508, - "end": 14514, + "start": 14749, + "end": 14755, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 18 }, "identifierName": "parser" @@ -16849,15 +17471,15 @@ "arguments": [ { "type": "Identifier", - "start": 14515, - "end": 14530, + "start": 14756, + "end": 14771, "loc": { "start": { - "line": 359, + "line": 370, "column": 19 }, "end": { - "line": 359, + "line": 370, "column": 34 }, "identifierName": "converterParams" @@ -16868,15 +17490,15 @@ }, "property": { "type": "Identifier", - "start": 14532, - "end": 14536, + "start": 14773, + "end": 14777, "loc": { "start": { - "line": 359, + "line": 370, "column": 36 }, "end": { - "line": 359, + "line": 370, "column": 40 }, "identifierName": "then" @@ -16888,15 +17510,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 14537, - "end": 18053, + "start": 14778, + "end": 18294, "loc": { "start": { - "line": 359, + "line": 370, "column": 41 }, "end": { - "line": 432, + "line": 443, "column": 13 } }, @@ -16907,44 +17529,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14543, - "end": 18053, + "start": 14784, + "end": 18294, "loc": { "start": { - "line": 359, + "line": 370, "column": 47 }, "end": { - "line": 432, + "line": 443, "column": 13 } }, "body": [ { "type": "IfStatement", - "start": 14562, - "end": 14720, + "start": 14803, + "end": 14961, "loc": { "start": { - "line": 361, + "line": 372, "column": 16 }, "end": { - "line": 364, + "line": 375, "column": 17 } }, "test": { "type": "UnaryExpression", - "start": 14566, - "end": 14580, + "start": 14807, + "end": 14821, "loc": { "start": { - "line": 361, + "line": 372, "column": 20 }, "end": { - "line": 361, + "line": 372, "column": 34 } }, @@ -16952,15 +17574,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 14567, - "end": 14580, + "start": 14808, + "end": 14821, "loc": { "start": { - "line": 361, + "line": 372, "column": 21 }, "end": { - "line": 361, + "line": 372, "column": 34 }, "identifierName": "metaModelJSON" @@ -16973,58 +17595,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 14582, - "end": 14720, + "start": 14823, + "end": 14961, "loc": { "start": { - "line": 361, + "line": 372, "column": 36 }, "end": { - "line": 364, + "line": 375, "column": 17 } }, "body": [ { "type": "ExpressionStatement", - "start": 14604, - "end": 14645, + "start": 14845, + "end": 14886, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 14604, - "end": 14644, + "start": 14845, + "end": 14885, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 60 } }, "callee": { "type": "Identifier", - "start": 14604, - "end": 14607, + "start": 14845, + "end": 14848, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 23 }, "identifierName": "log" @@ -17034,15 +17656,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14608, - "end": 14643, + "start": 14849, + "end": 14884, "loc": { "start": { - "line": 362, + "line": 373, "column": 24 }, "end": { - "line": 362, + "line": 373, "column": 59 } }, @@ -17057,57 +17679,57 @@ }, { "type": "ExpressionStatement", - "start": 14666, - "end": 14702, + "start": 14907, + "end": 14943, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 56 } }, "expression": { "type": "CallExpression", - "start": 14666, - "end": 14701, + "start": 14907, + "end": 14942, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 55 } }, "callee": { "type": "MemberExpression", - "start": 14666, - "end": 14699, + "start": 14907, + "end": 14940, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 53 } }, "object": { "type": "Identifier", - "start": 14666, - "end": 14674, + "start": 14907, + "end": 14915, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 28 }, "identifierName": "xktModel" @@ -17116,15 +17738,15 @@ }, "property": { "type": "Identifier", - "start": 14675, - "end": 14699, + "start": 14916, + "end": 14940, "loc": { "start": { - "line": 363, + "line": 374, "column": 29 }, "end": { - "line": 363, + "line": 374, "column": 53 }, "identifierName": "createDefaultMetaObjects" @@ -17143,43 +17765,43 @@ }, { "type": "ExpressionStatement", - "start": 14738, - "end": 14792, + "start": 14979, + "end": 15033, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 14738, - "end": 14791, + "start": 14979, + "end": 15032, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 69 } }, "callee": { "type": "Identifier", - "start": 14738, - "end": 14741, + "start": 14979, + "end": 14982, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 19 }, "identifierName": "log" @@ -17189,15 +17811,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14742, - "end": 14790, + "start": 14983, + "end": 15031, "loc": { "start": { - "line": 366, + "line": 377, "column": 20 }, "end": { - "line": 366, + "line": 377, "column": 68 } }, @@ -17212,85 +17834,85 @@ }, { "type": "ExpressionStatement", - "start": 14810, - "end": 18039, + "start": 15051, + "end": 18280, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 431, + "line": 442, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 14810, - "end": 18038, + "start": 15051, + "end": 18279, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 431, + "line": 442, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 14810, - "end": 14834, + "start": 15051, + "end": 15075, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 40 } }, "object": { "type": "CallExpression", - "start": 14810, - "end": 14829, + "start": 15051, + "end": 15070, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 35 } }, "callee": { "type": "MemberExpression", - "start": 14810, - "end": 14827, + "start": 15051, + "end": 15068, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 33 } }, "object": { "type": "Identifier", - "start": 14810, - "end": 14818, + "start": 15051, + "end": 15059, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 24 }, "identifierName": "xktModel" @@ -17299,15 +17921,15 @@ }, "property": { "type": "Identifier", - "start": 14819, - "end": 14827, + "start": 15060, + "end": 15068, "loc": { "start": { - "line": 368, + "line": 379, "column": 25 }, "end": { - "line": 368, + "line": 379, "column": 33 }, "identifierName": "finalize" @@ -17320,15 +17942,15 @@ }, "property": { "type": "Identifier", - "start": 14830, - "end": 14834, + "start": 15071, + "end": 15075, "loc": { "start": { - "line": 368, + "line": 379, "column": 36 }, "end": { - "line": 368, + "line": 379, "column": 40 }, "identifierName": "then" @@ -17340,15 +17962,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 14835, - "end": 18037, + "start": 15076, + "end": 18278, "loc": { "start": { - "line": 368, + "line": 379, "column": 41 }, "end": { - "line": 431, + "line": 442, "column": 17 } }, @@ -17359,58 +17981,58 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14841, - "end": 18037, + "start": 15082, + "end": 18278, "loc": { "start": { - "line": 368, + "line": 379, "column": 47 }, "end": { - "line": 431, + "line": 442, "column": 17 } }, "body": [ { "type": "ExpressionStatement", - "start": 14864, - "end": 14917, + "start": 15105, + "end": 15158, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 73 } }, "expression": { "type": "CallExpression", - "start": 14864, - "end": 14916, + "start": 15105, + "end": 15157, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 72 } }, "callee": { "type": "Identifier", - "start": 14864, - "end": 14867, + "start": 15105, + "end": 15108, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 23 }, "identifierName": "log" @@ -17420,15 +18042,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14868, - "end": 14915, + "start": 15109, + "end": 15156, "loc": { "start": { - "line": 370, + "line": 381, "column": 24 }, "end": { - "line": 370, + "line": 381, "column": 71 } }, @@ -17443,44 +18065,44 @@ }, { "type": "VariableDeclaration", - "start": 14939, - "end": 15034, + "start": 15180, + "end": 15275, "loc": { "start": { - "line": 372, + "line": 383, "column": 20 }, "end": { - "line": 372, + "line": 383, "column": 115 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 14945, - "end": 15033, + "start": 15186, + "end": 15274, "loc": { "start": { - "line": 372, + "line": 383, "column": 26 }, "end": { - "line": 372, + "line": 383, "column": 114 } }, "id": { "type": "Identifier", - "start": 14945, - "end": 14959, + "start": 15186, + "end": 15200, "loc": { "start": { - "line": 372, + "line": 383, "column": 26 }, "end": { - "line": 372, + "line": 383, "column": 40 }, "identifierName": "xktArrayBuffer" @@ -17489,29 +18111,29 @@ }, "init": { "type": "CallExpression", - "start": 14962, - "end": 15033, + "start": 15203, + "end": 15274, "loc": { "start": { - "line": 372, + "line": 383, "column": 43 }, "end": { - "line": 372, + "line": 383, "column": 114 } }, "callee": { "type": "Identifier", - "start": 14962, - "end": 14988, + "start": 15203, + "end": 15229, "loc": { "start": { - "line": 372, + "line": 383, "column": 43 }, "end": { - "line": 372, + "line": 383, "column": 69 }, "identifierName": "writeXKTModelToArrayBuffer" @@ -17521,15 +18143,15 @@ "arguments": [ { "type": "Identifier", - "start": 14989, - "end": 14997, + "start": 15230, + "end": 15238, "loc": { "start": { - "line": 372, + "line": 383, "column": 70 }, "end": { - "line": 372, + "line": 383, "column": 78 }, "identifierName": "xktModel" @@ -17538,15 +18160,15 @@ }, { "type": "Identifier", - "start": 14999, - "end": 15012, + "start": 15240, + "end": 15253, "loc": { "start": { - "line": 372, + "line": 383, "column": 80 }, "end": { - "line": 372, + "line": 383, "column": 93 }, "identifierName": "metaModelJSON" @@ -17555,15 +18177,15 @@ }, { "type": "Identifier", - "start": 15014, - "end": 15019, + "start": 15255, + "end": 15260, "loc": { "start": { - "line": 372, + "line": 383, "column": 95 }, "end": { - "line": 372, + "line": 383, "column": 100 }, "identifierName": "stats" @@ -17572,30 +18194,30 @@ }, { "type": "ObjectExpression", - "start": 15021, - "end": 15032, + "start": 15262, + "end": 15273, "loc": { "start": { - "line": 372, + "line": 383, "column": 102 }, "end": { - "line": 372, + "line": 383, "column": 113 } }, "properties": [ { "type": "ObjectProperty", - "start": 15022, - "end": 15031, + "start": 15263, + "end": 15272, "loc": { "start": { - "line": 372, + "line": 383, "column": 103 }, "end": { - "line": 372, + "line": 383, "column": 112 } }, @@ -17604,15 +18226,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 15022, - "end": 15025, + "start": 15263, + "end": 15266, "loc": { "start": { - "line": 372, + "line": 383, "column": 103 }, "end": { - "line": 372, + "line": 383, "column": 106 }, "identifierName": "zip" @@ -17621,15 +18243,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 15027, - "end": 15031, + "start": 15268, + "end": 15272, "loc": { "start": { - "line": 372, + "line": 383, "column": 108 }, "end": { - "line": 372, + "line": 383, "column": 112 } }, @@ -17646,44 +18268,44 @@ }, { "type": "VariableDeclaration", - "start": 15056, - "end": 15103, + "start": 15297, + "end": 15344, "loc": { "start": { - "line": 374, + "line": 385, "column": 20 }, "end": { - "line": 374, + "line": 385, "column": 67 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 15062, - "end": 15102, + "start": 15303, + "end": 15343, "loc": { "start": { - "line": 374, + "line": 385, "column": 26 }, "end": { - "line": 374, + "line": 385, "column": 66 } }, "id": { "type": "Identifier", - "start": 15062, - "end": 15072, + "start": 15303, + "end": 15313, "loc": { "start": { - "line": 374, + "line": 385, "column": 26 }, "end": { - "line": 374, + "line": 385, "column": 36 }, "identifierName": "xktContent" @@ -17692,43 +18314,43 @@ }, "init": { "type": "CallExpression", - "start": 15075, - "end": 15102, + "start": 15316, + "end": 15343, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 66 } }, "callee": { "type": "MemberExpression", - "start": 15075, - "end": 15086, + "start": 15316, + "end": 15327, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 50 } }, "object": { "type": "Identifier", - "start": 15075, - "end": 15081, + "start": 15316, + "end": 15322, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 45 }, "identifierName": "Buffer" @@ -17737,15 +18359,15 @@ }, "property": { "type": "Identifier", - "start": 15082, - "end": 15086, + "start": 15323, + "end": 15327, "loc": { "start": { - "line": 374, + "line": 385, "column": 46 }, "end": { - "line": 374, + "line": 385, "column": 50 }, "identifierName": "from" @@ -17757,15 +18379,15 @@ "arguments": [ { "type": "Identifier", - "start": 15087, - "end": 15101, + "start": 15328, + "end": 15342, "loc": { "start": { - "line": 374, + "line": 385, "column": 51 }, "end": { - "line": 374, + "line": 385, "column": 65 }, "identifierName": "xktArrayBuffer" @@ -17780,44 +18402,44 @@ }, { "type": "VariableDeclaration", - "start": 15125, - "end": 15179, + "start": 15366, + "end": 15420, "loc": { "start": { - "line": 376, + "line": 387, "column": 20 }, "end": { - "line": 376, + "line": 387, "column": 74 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 15131, - "end": 15178, + "start": 15372, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 26 }, "end": { - "line": 376, + "line": 387, "column": 73 } }, "id": { "type": "Identifier", - "start": 15131, - "end": 15150, + "start": 15372, + "end": 15391, "loc": { "start": { - "line": 376, + "line": 387, "column": 26 }, "end": { - "line": 376, + "line": 387, "column": 45 }, "identifierName": "targetFileSizeBytes" @@ -17826,29 +18448,29 @@ }, "init": { "type": "MemberExpression", - "start": 15153, - "end": 15178, + "start": 15394, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 48 }, "end": { - "line": 376, + "line": 387, "column": 73 } }, "object": { "type": "Identifier", - "start": 15153, - "end": 15167, + "start": 15394, + "end": 15408, "loc": { "start": { - "line": 376, + "line": 387, "column": 48 }, "end": { - "line": 376, + "line": 387, "column": 62 }, "identifierName": "xktArrayBuffer" @@ -17857,15 +18479,15 @@ }, "property": { "type": "Identifier", - "start": 15168, - "end": 15178, + "start": 15409, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 63 }, "end": { - "line": 376, + "line": 387, "column": 73 }, "identifierName": "byteLength" @@ -17880,58 +18502,58 @@ }, { "type": "ExpressionStatement", - "start": 15201, - "end": 15240, + "start": 15442, + "end": 15481, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 59 } }, "expression": { "type": "AssignmentExpression", - "start": 15201, - "end": 15239, + "start": 15442, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15201, - "end": 15218, + "start": 15442, + "end": 15459, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 37 } }, "object": { "type": "Identifier", - "start": 15201, - "end": 15206, + "start": 15442, + "end": 15447, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 25 }, "identifierName": "stats" @@ -17940,15 +18562,15 @@ }, "property": { "type": "Identifier", - "start": 15207, - "end": 15218, + "start": 15448, + "end": 15459, "loc": { "start": { - "line": 378, + "line": 389, "column": 26 }, "end": { - "line": 378, + "line": 389, "column": 37 }, "identifierName": "minTileSize" @@ -17959,29 +18581,29 @@ }, "right": { "type": "LogicalExpression", - "start": 15221, - "end": 15239, + "start": 15462, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 40 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, "left": { "type": "Identifier", - "start": 15221, - "end": 15232, + "start": 15462, + "end": 15473, "loc": { "start": { - "line": 378, + "line": 389, "column": 40 }, "end": { - "line": 378, + "line": 389, "column": 51 }, "identifierName": "minTileSize" @@ -17991,15 +18613,15 @@ "operator": "||", "right": { "type": "NumericLiteral", - "start": 15236, - "end": 15239, + "start": 15477, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 55 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, @@ -18014,58 +18636,58 @@ }, { "type": "ExpressionStatement", - "start": 15261, - "end": 15320, + "start": 15502, + "end": 15561, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 79 } }, "expression": { "type": "AssignmentExpression", - "start": 15261, - "end": 15319, + "start": 15502, + "end": 15560, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 78 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15261, - "end": 15277, + "start": 15502, + "end": 15518, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 36 } }, "object": { "type": "Identifier", - "start": 15261, - "end": 15266, + "start": 15502, + "end": 15507, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 25 }, "identifierName": "stats" @@ -18074,15 +18696,15 @@ }, "property": { "type": "Identifier", - "start": 15267, - "end": 15277, + "start": 15508, + "end": 15518, "loc": { "start": { - "line": 379, + "line": 390, "column": 26 }, "end": { - "line": 379, + "line": 390, "column": 36 }, "identifierName": "sourceSize" @@ -18093,57 +18715,57 @@ }, "right": { "type": "CallExpression", - "start": 15280, - "end": 15319, + "start": 15521, + "end": 15560, "loc": { "start": { - "line": 379, + "line": 390, "column": 39 }, "end": { - "line": 379, + "line": 390, "column": 78 } }, "callee": { "type": "MemberExpression", - "start": 15280, - "end": 15316, + "start": 15521, + "end": 15557, "loc": { "start": { - "line": 379, + "line": 390, "column": 39 }, "end": { - "line": 379, + "line": 390, "column": 75 } }, "object": { "type": "BinaryExpression", - "start": 15281, - "end": 15307, + "start": 15522, + "end": 15548, "loc": { "start": { - "line": 379, + "line": 390, "column": 40 }, "end": { - "line": 379, + "line": 390, "column": 66 } }, "left": { "type": "Identifier", - "start": 15281, - "end": 15300, + "start": 15522, + "end": 15541, "loc": { "start": { - "line": 379, + "line": 390, "column": 40 }, "end": { - "line": 379, + "line": 390, "column": 59 }, "identifierName": "sourceFileSizeBytes" @@ -18153,15 +18775,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 15303, - "end": 15307, + "start": 15544, + "end": 15548, "loc": { "start": { - "line": 379, + "line": 390, "column": 62 }, "end": { - "line": 379, + "line": 390, "column": 66 } }, @@ -18173,20 +18795,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15280 + "parenStart": 15521 } }, "property": { "type": "Identifier", - "start": 15309, - "end": 15316, + "start": 15550, + "end": 15557, "loc": { "start": { - "line": 379, + "line": 390, "column": 68 }, "end": { - "line": 379, + "line": 390, "column": 75 }, "identifierName": "toFixed" @@ -18198,15 +18820,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15317, - "end": 15318, + "start": 15558, + "end": 15559, "loc": { "start": { - "line": 379, + "line": 390, "column": 76 }, "end": { - "line": 379, + "line": 390, "column": 77 } }, @@ -18222,58 +18844,58 @@ }, { "type": "ExpressionStatement", - "start": 15341, - "end": 15397, + "start": 15582, + "end": 15638, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 76 } }, "expression": { "type": "AssignmentExpression", - "start": 15341, - "end": 15396, + "start": 15582, + "end": 15637, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 75 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15341, - "end": 15354, + "start": 15582, + "end": 15595, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 33 } }, "object": { "type": "Identifier", - "start": 15341, - "end": 15346, + "start": 15582, + "end": 15587, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 25 }, "identifierName": "stats" @@ -18282,15 +18904,15 @@ }, "property": { "type": "Identifier", - "start": 15347, - "end": 15354, + "start": 15588, + "end": 15595, "loc": { "start": { - "line": 380, + "line": 391, "column": 26 }, "end": { - "line": 380, + "line": 391, "column": 33 }, "identifierName": "xktSize" @@ -18301,57 +18923,57 @@ }, "right": { "type": "CallExpression", - "start": 15357, - "end": 15396, + "start": 15598, + "end": 15637, "loc": { "start": { - "line": 380, + "line": 391, "column": 36 }, "end": { - "line": 380, + "line": 391, "column": 75 } }, "callee": { "type": "MemberExpression", - "start": 15357, - "end": 15393, + "start": 15598, + "end": 15634, "loc": { "start": { - "line": 380, + "line": 391, "column": 36 }, "end": { - "line": 380, + "line": 391, "column": 72 } }, "object": { "type": "BinaryExpression", - "start": 15358, - "end": 15384, + "start": 15599, + "end": 15625, "loc": { "start": { - "line": 380, + "line": 391, "column": 37 }, "end": { - "line": 380, + "line": 391, "column": 63 } }, "left": { "type": "Identifier", - "start": 15358, - "end": 15377, + "start": 15599, + "end": 15618, "loc": { "start": { - "line": 380, + "line": 391, "column": 37 }, "end": { - "line": 380, + "line": 391, "column": 56 }, "identifierName": "targetFileSizeBytes" @@ -18361,15 +18983,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 15380, - "end": 15384, + "start": 15621, + "end": 15625, "loc": { "start": { - "line": 380, + "line": 391, "column": 59 }, "end": { - "line": 380, + "line": 391, "column": 63 } }, @@ -18381,20 +19003,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15357 + "parenStart": 15598 } }, "property": { "type": "Identifier", - "start": 15386, - "end": 15393, + "start": 15627, + "end": 15634, "loc": { "start": { - "line": 380, + "line": 391, "column": 65 }, "end": { - "line": 380, + "line": 391, "column": 72 }, "identifierName": "toFixed" @@ -18406,15 +19028,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15394, - "end": 15395, + "start": 15635, + "end": 15636, "loc": { "start": { - "line": 380, + "line": 391, "column": 73 }, "end": { - "line": 380, + "line": 391, "column": 74 } }, @@ -18430,58 +19052,58 @@ }, { "type": "ExpressionStatement", - "start": 15418, - "end": 15457, + "start": 15659, + "end": 15698, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 59 } }, "expression": { "type": "AssignmentExpression", - "start": 15418, - "end": 15456, + "start": 15659, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 58 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15418, - "end": 15434, + "start": 15659, + "end": 15675, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 36 } }, "object": { "type": "Identifier", - "start": 15418, - "end": 15423, + "start": 15659, + "end": 15664, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 25 }, "identifierName": "stats" @@ -18490,15 +19112,15 @@ }, "property": { "type": "Identifier", - "start": 15424, - "end": 15434, + "start": 15665, + "end": 15675, "loc": { "start": { - "line": 381, + "line": 392, "column": 26 }, "end": { - "line": 381, + "line": 392, "column": 36 }, "identifierName": "xktVersion" @@ -18509,29 +19131,29 @@ }, "right": { "type": "MemberExpression", - "start": 15437, - "end": 15456, + "start": 15678, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 39 }, "end": { - "line": 381, + "line": 392, "column": 58 } }, "object": { "type": "Identifier", - "start": 15437, - "end": 15445, + "start": 15678, + "end": 15686, "loc": { "start": { - "line": 381, + "line": 392, "column": 39 }, "end": { - "line": 381, + "line": 392, "column": 47 }, "identifierName": "XKT_INFO" @@ -18540,15 +19162,15 @@ }, "property": { "type": "Identifier", - "start": 15446, - "end": 15456, + "start": 15687, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 48 }, "end": { - "line": 381, + "line": 392, "column": 58 }, "identifierName": "xktVersion" @@ -18561,58 +19183,58 @@ }, { "type": "ExpressionStatement", - "start": 15478, - "end": 15558, + "start": 15719, + "end": 15799, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 100 } }, "expression": { "type": "AssignmentExpression", - "start": 15478, - "end": 15557, + "start": 15719, + "end": 15798, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 99 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15478, - "end": 15500, + "start": 15719, + "end": 15741, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 42 } }, "object": { "type": "Identifier", - "start": 15478, - "end": 15483, + "start": 15719, + "end": 15724, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 25 }, "identifierName": "stats" @@ -18621,15 +19243,15 @@ }, "property": { "type": "Identifier", - "start": 15484, - "end": 15500, + "start": 15725, + "end": 15741, "loc": { "start": { - "line": 382, + "line": 393, "column": 26 }, "end": { - "line": 382, + "line": 393, "column": 42 }, "identifierName": "compressionRatio" @@ -18640,57 +19262,57 @@ }, "right": { "type": "CallExpression", - "start": 15503, - "end": 15557, + "start": 15744, + "end": 15798, "loc": { "start": { - "line": 382, + "line": 393, "column": 45 }, "end": { - "line": 382, + "line": 393, "column": 99 } }, "callee": { "type": "MemberExpression", - "start": 15503, - "end": 15554, + "start": 15744, + "end": 15795, "loc": { "start": { - "line": 382, + "line": 393, "column": 45 }, "end": { - "line": 382, + "line": 393, "column": 96 } }, "object": { "type": "BinaryExpression", - "start": 15504, - "end": 15545, + "start": 15745, + "end": 15786, "loc": { "start": { - "line": 382, + "line": 393, "column": 46 }, "end": { - "line": 382, + "line": 393, "column": 87 } }, "left": { "type": "Identifier", - "start": 15504, - "end": 15523, + "start": 15745, + "end": 15764, "loc": { "start": { - "line": 382, + "line": 393, "column": 46 }, "end": { - "line": 382, + "line": 393, "column": 65 }, "identifierName": "sourceFileSizeBytes" @@ -18700,15 +19322,15 @@ "operator": "/", "right": { "type": "Identifier", - "start": 15526, - "end": 15545, + "start": 15767, + "end": 15786, "loc": { "start": { - "line": 382, + "line": 393, "column": 68 }, "end": { - "line": 382, + "line": 393, "column": 87 }, "identifierName": "targetFileSizeBytes" @@ -18717,20 +19339,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15503 + "parenStart": 15744 } }, "property": { "type": "Identifier", - "start": 15547, - "end": 15554, + "start": 15788, + "end": 15795, "loc": { "start": { - "line": 382, + "line": 393, "column": 89 }, "end": { - "line": 382, + "line": 393, "column": 96 }, "identifierName": "toFixed" @@ -18742,15 +19364,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15555, - "end": 15556, + "start": 15796, + "end": 15797, "loc": { "start": { - "line": 382, + "line": 393, "column": 97 }, "end": { - "line": 382, + "line": 393, "column": 98 } }, @@ -18766,58 +19388,58 @@ }, { "type": "ExpressionStatement", - "start": 15579, - "end": 15649, + "start": 15820, + "end": 15890, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 90 } }, "expression": { "type": "AssignmentExpression", - "start": 15579, - "end": 15648, + "start": 15820, + "end": 15889, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 89 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15579, - "end": 15599, + "start": 15820, + "end": 15840, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 40 } }, "object": { "type": "Identifier", - "start": 15579, - "end": 15584, + "start": 15820, + "end": 15825, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 25 }, "identifierName": "stats" @@ -18826,15 +19448,15 @@ }, "property": { "type": "Identifier", - "start": 15585, - "end": 15599, + "start": 15826, + "end": 15840, "loc": { "start": { - "line": 383, + "line": 394, "column": 26 }, "end": { - "line": 383, + "line": 394, "column": 40 }, "identifierName": "conversionTime" @@ -18845,85 +19467,85 @@ }, "right": { "type": "CallExpression", - "start": 15602, - "end": 15648, + "start": 15843, + "end": 15889, "loc": { "start": { - "line": 383, + "line": 394, "column": 43 }, "end": { - "line": 383, + "line": 394, "column": 89 } }, "callee": { "type": "MemberExpression", - "start": 15602, - "end": 15645, + "start": 15843, + "end": 15886, "loc": { "start": { - "line": 383, + "line": 394, "column": 43 }, "end": { - "line": 383, + "line": 394, "column": 86 } }, "object": { "type": "BinaryExpression", - "start": 15603, - "end": 15636, + "start": 15844, + "end": 15877, "loc": { "start": { - "line": 383, + "line": 394, "column": 44 }, "end": { - "line": 383, + "line": 394, "column": 77 } }, "left": { "type": "BinaryExpression", - "start": 15604, - "end": 15626, + "start": 15845, + "end": 15867, "loc": { "start": { - "line": 383, + "line": 394, "column": 45 }, "end": { - "line": 383, + "line": 394, "column": 67 } }, "left": { "type": "NewExpression", - "start": 15604, - "end": 15614, + "start": 15845, + "end": 15855, "loc": { "start": { - "line": 383, + "line": 394, "column": 45 }, "end": { - "line": 383, + "line": 394, "column": 55 } }, "callee": { "type": "Identifier", - "start": 15608, - "end": 15612, + "start": 15849, + "end": 15853, "loc": { "start": { - "line": 383, + "line": 394, "column": 49 }, "end": { - "line": 383, + "line": 394, "column": 53 }, "identifierName": "Date" @@ -18935,15 +19557,15 @@ "operator": "-", "right": { "type": "Identifier", - "start": 15617, - "end": 15626, + "start": 15858, + "end": 15867, "loc": { "start": { - "line": 383, + "line": 394, "column": 58 }, "end": { - "line": 383, + "line": 394, "column": 67 }, "identifierName": "startTime" @@ -18952,21 +19574,21 @@ }, "extra": { "parenthesized": true, - "parenStart": 15603 + "parenStart": 15844 } }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 15630, - "end": 15636, + "start": 15871, + "end": 15877, "loc": { "start": { - "line": 383, + "line": 394, "column": 71 }, "end": { - "line": 383, + "line": 394, "column": 77 } }, @@ -18978,20 +19600,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15602 + "parenStart": 15843 } }, "property": { "type": "Identifier", - "start": 15638, - "end": 15645, + "start": 15879, + "end": 15886, "loc": { "start": { - "line": 383, + "line": 394, "column": 79 }, "end": { - "line": 383, + "line": 394, "column": 86 }, "identifierName": "toFixed" @@ -19003,15 +19625,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15646, - "end": 15647, + "start": 15887, + "end": 15888, "loc": { "start": { - "line": 383, + "line": 394, "column": 87 }, "end": { - "line": 383, + "line": 394, "column": 88 } }, @@ -19027,58 +19649,58 @@ }, { "type": "ExpressionStatement", - "start": 15670, - "end": 15697, + "start": 15911, + "end": 15938, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 47 } }, "expression": { "type": "AssignmentExpression", - "start": 15670, - "end": 15696, + "start": 15911, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 46 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15670, - "end": 15680, + "start": 15911, + "end": 15921, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 30 } }, "object": { "type": "Identifier", - "start": 15670, - "end": 15675, + "start": 15911, + "end": 15916, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 25 }, "identifierName": "stats" @@ -19087,15 +19709,15 @@ }, "property": { "type": "Identifier", - "start": 15676, - "end": 15680, + "start": 15917, + "end": 15921, "loc": { "start": { - "line": 384, + "line": 395, "column": 26 }, "end": { - "line": 384, + "line": 395, "column": 30 }, "identifierName": "aabb" @@ -19106,29 +19728,29 @@ }, "right": { "type": "MemberExpression", - "start": 15683, - "end": 15696, + "start": 15924, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 33 }, "end": { - "line": 384, + "line": 395, "column": 46 } }, "object": { "type": "Identifier", - "start": 15683, - "end": 15691, + "start": 15924, + "end": 15932, "loc": { "start": { - "line": 384, + "line": 395, "column": 33 }, "end": { - "line": 384, + "line": 395, "column": 41 }, "identifierName": "xktModel" @@ -19137,15 +19759,15 @@ }, "property": { "type": "Identifier", - "start": 15692, - "end": 15696, + "start": 15933, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 42 }, "end": { - "line": 384, + "line": 395, "column": 46 }, "identifierName": "aabb" @@ -19158,43 +19780,43 @@ }, { "type": "ExpressionStatement", - "start": 15718, - "end": 15764, + "start": 15959, + "end": 16005, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 66 } }, "expression": { "type": "CallExpression", - "start": 15718, - "end": 15763, + "start": 15959, + "end": 16004, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 65 } }, "callee": { "type": "Identifier", - "start": 15718, - "end": 15721, + "start": 15959, + "end": 15962, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 23 }, "identifierName": "log" @@ -19204,44 +19826,44 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 15722, - "end": 15762, + "start": 15963, + "end": 16003, "loc": { "start": { - "line": 385, + "line": 396, "column": 24 }, "end": { - "line": 385, + "line": 396, "column": 64 } }, "expressions": [ { "type": "MemberExpression", - "start": 15744, - "end": 15760, + "start": 15985, + "end": 16001, "loc": { "start": { - "line": 385, + "line": 396, "column": 46 }, "end": { - "line": 385, + "line": 396, "column": 62 } }, "object": { "type": "Identifier", - "start": 15744, - "end": 15749, + "start": 15985, + "end": 15990, "loc": { "start": { - "line": 385, + "line": 396, "column": 46 }, "end": { - "line": 385, + "line": 396, "column": 51 }, "identifierName": "stats" @@ -19250,15 +19872,15 @@ }, "property": { "type": "Identifier", - "start": 15750, - "end": 15760, + "start": 15991, + "end": 16001, "loc": { "start": { - "line": 385, + "line": 396, "column": 52 }, "end": { - "line": 385, + "line": 396, "column": 62 }, "identifierName": "xktVersion" @@ -19271,15 +19893,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 15723, - "end": 15742, + "start": 15964, + "end": 15983, "loc": { "start": { - "line": 385, + "line": 396, "column": 25 }, "end": { - "line": 385, + "line": 396, "column": 44 } }, @@ -19291,15 +19913,15 @@ }, { "type": "TemplateElement", - "start": 15761, - "end": 15761, + "start": 16002, + "end": 16002, "loc": { "start": { - "line": 385, + "line": 396, "column": 63 }, "end": { - "line": 385, + "line": 396, "column": 63 } }, @@ -19316,29 +19938,29 @@ }, { "type": "IfStatement", - "start": 15785, - "end": 15924, + "start": 16026, + "end": 16165, "loc": { "start": { - "line": 386, + "line": 397, "column": 20 }, "end": { - "line": 388, + "line": 399, "column": 21 } }, "test": { "type": "Identifier", - "start": 15789, - "end": 15801, + "start": 16030, + "end": 16042, "loc": { "start": { - "line": 386, + "line": 397, "column": 24 }, "end": { - "line": 386, + "line": 397, "column": 36 }, "identifierName": "includeTypes" @@ -19347,58 +19969,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 15803, - "end": 15924, + "start": 16044, + "end": 16165, "loc": { "start": { - "line": 386, + "line": 397, "column": 38 }, "end": { - "line": 388, + "line": 399, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 15829, - "end": 15902, + "start": 16070, + "end": 16143, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 97 } }, "expression": { "type": "CallExpression", - "start": 15829, - "end": 15901, + "start": 16070, + "end": 16142, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 96 } }, "callee": { "type": "Identifier", - "start": 15829, - "end": 15832, + "start": 16070, + "end": 16073, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 27 }, "identifierName": "log" @@ -19408,29 +20030,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 15833, - "end": 15900, + "start": 16074, + "end": 16141, "loc": { "start": { - "line": 387, + "line": 398, "column": 28 }, "end": { - "line": 387, + "line": 398, "column": 95 } }, "left": { "type": "StringLiteral", - "start": 15833, - "end": 15850, + "start": 16074, + "end": 16091, "loc": { "start": { - "line": 387, + "line": 398, "column": 28 }, "end": { - "line": 387, + "line": 398, "column": 45 } }, @@ -19443,29 +20065,29 @@ "operator": "+", "right": { "type": "ConditionalExpression", - "start": 15854, - "end": 15899, + "start": 16095, + "end": 16140, "loc": { "start": { - "line": 387, + "line": 398, "column": 49 }, "end": { - "line": 387, + "line": 398, "column": 94 } }, "test": { "type": "Identifier", - "start": 15854, - "end": 15866, + "start": 16095, + "end": 16107, "loc": { "start": { - "line": 387, + "line": 398, "column": 49 }, "end": { - "line": 387, + "line": 398, "column": 61 }, "identifierName": "includeTypes" @@ -19474,15 +20096,15 @@ }, "consequent": { "type": "Identifier", - "start": 15869, - "end": 15881, + "start": 16110, + "end": 16122, "loc": { "start": { - "line": 387, + "line": 398, "column": 64 }, "end": { - "line": 387, + "line": 398, "column": 76 }, "identifierName": "includeTypes" @@ -19491,15 +20113,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 15884, - "end": 15899, + "start": 16125, + "end": 16140, "loc": { "start": { - "line": 387, + "line": 398, "column": 79 }, "end": { - "line": 387, + "line": 398, "column": 94 } }, @@ -19511,7 +20133,7 @@ }, "extra": { "parenthesized": true, - "parenStart": 15853 + "parenStart": 16094 } } } @@ -19525,29 +20147,29 @@ }, { "type": "IfStatement", - "start": 15945, - "end": 16085, + "start": 16186, + "end": 16326, "loc": { "start": { - "line": 389, + "line": 400, "column": 20 }, "end": { - "line": 391, + "line": 402, "column": 21 } }, "test": { "type": "Identifier", - "start": 15949, - "end": 15961, + "start": 16190, + "end": 16202, "loc": { "start": { - "line": 389, + "line": 400, "column": 24 }, "end": { - "line": 389, + "line": 400, "column": 36 }, "identifierName": "excludeTypes" @@ -19556,58 +20178,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 15963, - "end": 16085, + "start": 16204, + "end": 16326, "loc": { "start": { - "line": 389, + "line": 400, "column": 38 }, "end": { - "line": 391, + "line": 402, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 15989, - "end": 16063, + "start": 16230, + "end": 16304, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 98 } }, "expression": { "type": "CallExpression", - "start": 15989, - "end": 16062, + "start": 16230, + "end": 16303, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 97 } }, "callee": { "type": "Identifier", - "start": 15989, - "end": 15992, + "start": 16230, + "end": 16233, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 27 }, "identifierName": "log" @@ -19617,29 +20239,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 15993, - "end": 16061, + "start": 16234, + "end": 16302, "loc": { "start": { - "line": 390, + "line": 401, "column": 28 }, "end": { - "line": 390, + "line": 401, "column": 96 } }, "left": { "type": "StringLiteral", - "start": 15993, - "end": 16010, + "start": 16234, + "end": 16251, "loc": { "start": { - "line": 390, + "line": 401, "column": 28 }, "end": { - "line": 390, + "line": 401, "column": 45 } }, @@ -19652,29 +20274,29 @@ "operator": "+", "right": { "type": "ConditionalExpression", - "start": 16014, - "end": 16060, + "start": 16255, + "end": 16301, "loc": { "start": { - "line": 390, + "line": 401, "column": 49 }, "end": { - "line": 390, + "line": 401, "column": 95 } }, "test": { "type": "Identifier", - "start": 16014, - "end": 16026, + "start": 16255, + "end": 16267, "loc": { "start": { - "line": 390, + "line": 401, "column": 49 }, "end": { - "line": 390, + "line": 401, "column": 61 }, "identifierName": "excludeTypes" @@ -19683,15 +20305,15 @@ }, "consequent": { "type": "Identifier", - "start": 16029, - "end": 16041, + "start": 16270, + "end": 16282, "loc": { "start": { - "line": 390, + "line": 401, "column": 64 }, "end": { - "line": 390, + "line": 401, "column": 76 }, "identifierName": "excludeTypes" @@ -19700,15 +20322,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 16044, - "end": 16060, + "start": 16285, + "end": 16301, "loc": { "start": { - "line": 390, + "line": 401, "column": 79 }, "end": { - "line": 390, + "line": 401, "column": 95 } }, @@ -19720,7 +20342,7 @@ }, "extra": { "parenthesized": true, - "parenStart": 16013 + "parenStart": 16254 } } } @@ -19734,43 +20356,43 @@ }, { "type": "ExpressionStatement", - "start": 16106, - "end": 16148, + "start": 16347, + "end": 16389, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 62 } }, "expression": { "type": "CallExpression", - "start": 16106, - "end": 16147, + "start": 16347, + "end": 16388, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 61 } }, "callee": { "type": "Identifier", - "start": 16106, - "end": 16109, + "start": 16347, + "end": 16350, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 23 }, "identifierName": "log" @@ -19780,43 +20402,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16110, - "end": 16146, + "start": 16351, + "end": 16387, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 60 } }, "left": { "type": "BinaryExpression", - "start": 16110, - "end": 16138, + "start": 16351, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 52 } }, "left": { "type": "StringLiteral", - "start": 16110, - "end": 16122, + "start": 16351, + "end": 16363, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 36 } }, @@ -19829,29 +20451,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16125, - "end": 16138, + "start": 16366, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 39 }, "end": { - "line": 392, + "line": 403, "column": 52 } }, "object": { "type": "Identifier", - "start": 16125, - "end": 16130, + "start": 16366, + "end": 16371, "loc": { "start": { - "line": 392, + "line": 403, "column": 39 }, "end": { - "line": 392, + "line": 403, "column": 44 }, "identifierName": "stats" @@ -19860,15 +20482,15 @@ }, "property": { "type": "Identifier", - "start": 16131, - "end": 16138, + "start": 16372, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 45 }, "end": { - "line": 392, + "line": 403, "column": 52 }, "identifierName": "xktSize" @@ -19881,15 +20503,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16141, - "end": 16146, + "start": 16382, + "end": 16387, "loc": { "start": { - "line": 392, + "line": 403, "column": 55 }, "end": { - "line": 392, + "line": 403, "column": 60 } }, @@ -19905,43 +20527,43 @@ }, { "type": "ExpressionStatement", - "start": 16169, - "end": 16244, + "start": 16410, + "end": 16485, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 95 } }, "expression": { "type": "CallExpression", - "start": 16169, - "end": 16243, + "start": 16410, + "end": 16484, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 94 } }, "callee": { "type": "Identifier", - "start": 16169, - "end": 16172, + "start": 16410, + "end": 16413, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 23 }, "identifierName": "log" @@ -19951,43 +20573,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16173, - "end": 16242, + "start": 16414, + "end": 16483, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 93 } }, "left": { "type": "BinaryExpression", - "start": 16173, - "end": 16235, + "start": 16414, + "end": 16476, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 86 } }, "left": { "type": "StringLiteral", - "start": 16173, - "end": 16194, + "start": 16414, + "end": 16435, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 45 } }, @@ -20000,71 +20622,71 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 16197, - "end": 16235, + "start": 16438, + "end": 16476, "loc": { "start": { - "line": 393, + "line": 404, "column": 48 }, "end": { - "line": 393, + "line": 404, "column": 86 } }, "callee": { "type": "MemberExpression", - "start": 16197, - "end": 16232, + "start": 16438, + "end": 16473, "loc": { "start": { - "line": 393, + "line": 404, "column": 48 }, "end": { - "line": 393, + "line": 404, "column": 83 } }, "object": { "type": "BinaryExpression", - "start": 16198, - "end": 16223, + "start": 16439, + "end": 16464, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 74 } }, "left": { "type": "MemberExpression", - "start": 16198, - "end": 16216, + "start": 16439, + "end": 16457, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 67 } }, "object": { "type": "Identifier", - "start": 16198, - "end": 16203, + "start": 16439, + "end": 16444, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 54 }, "identifierName": "stats" @@ -20073,15 +20695,15 @@ }, "property": { "type": "Identifier", - "start": 16204, - "end": 16216, + "start": 16445, + "end": 16457, "loc": { "start": { - "line": 393, + "line": 404, "column": 55 }, "end": { - "line": 393, + "line": 404, "column": 67 }, "identifierName": "texturesSize" @@ -20093,15 +20715,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 16219, - "end": 16223, + "start": 16460, + "end": 16464, "loc": { "start": { - "line": 393, + "line": 404, "column": 70 }, "end": { - "line": 393, + "line": 404, "column": 74 } }, @@ -20113,20 +20735,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 16197 + "parenStart": 16438 } }, "property": { "type": "Identifier", - "start": 16225, - "end": 16232, + "start": 16466, + "end": 16473, "loc": { "start": { - "line": 393, + "line": 404, "column": 76 }, "end": { - "line": 393, + "line": 404, "column": 83 }, "identifierName": "toFixed" @@ -20138,15 +20760,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 16233, - "end": 16234, + "start": 16474, + "end": 16475, "loc": { "start": { - "line": 393, + "line": 404, "column": 84 }, "end": { - "line": 393, + "line": 404, "column": 85 } }, @@ -20162,15 +20784,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16238, - "end": 16242, + "start": 16479, + "end": 16483, "loc": { "start": { - "line": 393, + "line": 404, "column": 89 }, "end": { - "line": 393, + "line": 404, "column": 93 } }, @@ -20186,43 +20808,43 @@ }, { "type": "ExpressionStatement", - "start": 16265, - "end": 16317, + "start": 16506, + "end": 16558, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 72 } }, "expression": { "type": "CallExpression", - "start": 16265, - "end": 16316, + "start": 16506, + "end": 16557, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 71 } }, "callee": { "type": "Identifier", - "start": 16265, - "end": 16268, + "start": 16506, + "end": 16509, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 23 }, "identifierName": "log" @@ -20232,29 +20854,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16269, - "end": 16315, + "start": 16510, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 24 }, "end": { - "line": 394, + "line": 405, "column": 70 } }, "left": { "type": "StringLiteral", - "start": 16269, - "end": 16290, + "start": 16510, + "end": 16531, "loc": { "start": { - "line": 394, + "line": 405, "column": 24 }, "end": { - "line": 394, + "line": 405, "column": 45 } }, @@ -20267,29 +20889,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16293, - "end": 16315, + "start": 16534, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 48 }, "end": { - "line": 394, + "line": 405, "column": 70 } }, "object": { "type": "Identifier", - "start": 16293, - "end": 16298, + "start": 16534, + "end": 16539, "loc": { "start": { - "line": 394, + "line": 405, "column": 48 }, "end": { - "line": 394, + "line": 405, "column": 53 }, "identifierName": "stats" @@ -20298,15 +20920,15 @@ }, "property": { "type": "Identifier", - "start": 16299, - "end": 16315, + "start": 16540, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 54 }, "end": { - "line": 394, + "line": 405, "column": 70 }, "identifierName": "compressionRatio" @@ -20321,43 +20943,43 @@ }, { "type": "ExpressionStatement", - "start": 16338, - "end": 16393, + "start": 16579, + "end": 16634, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 75 } }, "expression": { "type": "CallExpression", - "start": 16338, - "end": 16392, + "start": 16579, + "end": 16633, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 74 } }, "callee": { "type": "Identifier", - "start": 16338, - "end": 16341, + "start": 16579, + "end": 16582, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 23 }, "identifierName": "log" @@ -20367,43 +20989,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16342, - "end": 16391, + "start": 16583, + "end": 16632, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 73 } }, "left": { "type": "BinaryExpression", - "start": 16342, - "end": 16384, + "start": 16583, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16342, - "end": 16361, + "start": 16583, + "end": 16602, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 43 } }, @@ -20416,29 +21038,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16364, - "end": 16384, + "start": 16605, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 46 }, "end": { - "line": 395, + "line": 406, "column": 66 } }, "object": { "type": "Identifier", - "start": 16364, - "end": 16369, + "start": 16605, + "end": 16610, "loc": { "start": { - "line": 395, + "line": 406, "column": 46 }, "end": { - "line": 395, + "line": 406, "column": 51 }, "identifierName": "stats" @@ -20447,15 +21069,15 @@ }, "property": { "type": "Identifier", - "start": 16370, - "end": 16384, + "start": 16611, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 52 }, "end": { - "line": 395, + "line": 406, "column": 66 }, "identifierName": "conversionTime" @@ -20468,15 +21090,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16387, - "end": 16391, + "start": 16628, + "end": 16632, "loc": { "start": { - "line": 395, + "line": 406, "column": 69 }, "end": { - "line": 395, + "line": 406, "column": 73 } }, @@ -20492,43 +21114,43 @@ }, { "type": "ExpressionStatement", - "start": 16414, - "end": 16468, + "start": 16655, + "end": 16709, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 74 } }, "expression": { "type": "CallExpression", - "start": 16414, - "end": 16467, + "start": 16655, + "end": 16708, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 73 } }, "callee": { "type": "Identifier", - "start": 16414, - "end": 16417, + "start": 16655, + "end": 16658, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 23 }, "identifierName": "log" @@ -20538,29 +21160,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16418, - "end": 16466, + "start": 16659, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 24 }, "end": { - "line": 396, + "line": 407, "column": 72 } }, "left": { "type": "StringLiteral", - "start": 16418, - "end": 16443, + "start": 16659, + "end": 16684, "loc": { "start": { - "line": 396, + "line": 407, "column": 24 }, "end": { - "line": 396, + "line": 407, "column": 49 } }, @@ -20573,29 +21195,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16446, - "end": 16466, + "start": 16687, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 52 }, "end": { - "line": 396, + "line": 407, "column": 72 } }, "object": { "type": "Identifier", - "start": 16446, - "end": 16451, + "start": 16687, + "end": 16692, "loc": { "start": { - "line": 396, + "line": 407, "column": 52 }, "end": { - "line": 396, + "line": 407, "column": 57 }, "identifierName": "stats" @@ -20604,15 +21226,15 @@ }, "property": { "type": "Identifier", - "start": 16452, - "end": 16466, + "start": 16693, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 58 }, "end": { - "line": 396, + "line": 407, "column": 72 }, "identifierName": "numMetaObjects" @@ -20627,43 +21249,43 @@ }, { "type": "ExpressionStatement", - "start": 16489, - "end": 16546, + "start": 16730, + "end": 16787, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 77 } }, "expression": { "type": "CallExpression", - "start": 16489, - "end": 16545, + "start": 16730, + "end": 16786, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 76 } }, "callee": { "type": "Identifier", - "start": 16489, - "end": 16492, + "start": 16730, + "end": 16733, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 23 }, "identifierName": "log" @@ -20673,29 +21295,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16493, - "end": 16544, + "start": 16734, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 24 }, "end": { - "line": 397, + "line": 408, "column": 75 } }, "left": { "type": "StringLiteral", - "start": 16493, - "end": 16520, + "start": 16734, + "end": 16761, "loc": { "start": { - "line": 397, + "line": 408, "column": 24 }, "end": { - "line": 397, + "line": 408, "column": 51 } }, @@ -20708,29 +21330,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16523, - "end": 16544, + "start": 16764, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 54 }, "end": { - "line": 397, + "line": 408, "column": 75 } }, "object": { "type": "Identifier", - "start": 16523, - "end": 16528, + "start": 16764, + "end": 16769, "loc": { "start": { - "line": 397, + "line": 408, "column": 54 }, "end": { - "line": 397, + "line": 408, "column": 59 }, "identifierName": "stats" @@ -20739,15 +21361,15 @@ }, "property": { "type": "Identifier", - "start": 16529, - "end": 16544, + "start": 16770, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 60 }, "end": { - "line": 397, + "line": 408, "column": 75 }, "identifierName": "numPropertySets" @@ -20762,43 +21384,43 @@ }, { "type": "ExpressionStatement", - "start": 16567, - "end": 16622, + "start": 16808, + "end": 16863, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 75 } }, "expression": { "type": "CallExpression", - "start": 16567, - "end": 16621, + "start": 16808, + "end": 16862, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 74 } }, "callee": { "type": "Identifier", - "start": 16567, - "end": 16570, + "start": 16808, + "end": 16811, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 23 }, "identifierName": "log" @@ -20808,29 +21430,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16571, - "end": 16620, + "start": 16812, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 24 }, "end": { - "line": 398, + "line": 409, "column": 73 } }, "left": { "type": "StringLiteral", - "start": 16571, - "end": 16601, + "start": 16812, + "end": 16842, "loc": { "start": { - "line": 398, + "line": 409, "column": 24 }, "end": { - "line": 398, + "line": 409, "column": 54 } }, @@ -20843,29 +21465,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16604, - "end": 16620, + "start": 16845, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 57 }, "end": { - "line": 398, + "line": 409, "column": 73 } }, "object": { "type": "Identifier", - "start": 16604, - "end": 16609, + "start": 16845, + "end": 16850, "loc": { "start": { - "line": 398, + "line": 409, "column": 57 }, "end": { - "line": 398, + "line": 409, "column": 62 }, "identifierName": "stats" @@ -20874,15 +21496,15 @@ }, "property": { "type": "Identifier", - "start": 16610, - "end": 16620, + "start": 16851, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 63 }, "end": { - "line": 398, + "line": 409, "column": 73 }, "identifierName": "numObjects" @@ -20897,43 +21519,43 @@ }, { "type": "ExpressionStatement", - "start": 16643, - "end": 16695, + "start": 16884, + "end": 16936, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 72 } }, "expression": { "type": "CallExpression", - "start": 16643, - "end": 16694, + "start": 16884, + "end": 16935, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 71 } }, "callee": { "type": "Identifier", - "start": 16643, - "end": 16646, + "start": 16884, + "end": 16887, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 23 }, "identifierName": "log" @@ -20943,29 +21565,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16647, - "end": 16693, + "start": 16888, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 24 }, "end": { - "line": 399, + "line": 410, "column": 70 } }, "left": { "type": "StringLiteral", - "start": 16647, - "end": 16671, + "start": 16888, + "end": 16912, "loc": { "start": { - "line": 399, + "line": 410, "column": 24 }, "end": { - "line": 399, + "line": 410, "column": 48 } }, @@ -20978,29 +21600,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16674, - "end": 16693, + "start": 16915, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 51 }, "end": { - "line": 399, + "line": 410, "column": 70 } }, "object": { "type": "Identifier", - "start": 16674, - "end": 16679, + "start": 16915, + "end": 16920, "loc": { "start": { - "line": 399, + "line": 410, "column": 51 }, "end": { - "line": 399, + "line": 410, "column": 56 }, "identifierName": "stats" @@ -21009,15 +21631,15 @@ }, "property": { "type": "Identifier", - "start": 16680, - "end": 16693, + "start": 16921, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 57 }, "end": { - "line": 399, + "line": 410, "column": 70 }, "identifierName": "numGeometries" @@ -21032,43 +21654,43 @@ }, { "type": "ExpressionStatement", - "start": 16716, - "end": 16764, + "start": 16957, + "end": 17005, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 68 } }, "expression": { "type": "CallExpression", - "start": 16716, - "end": 16763, + "start": 16957, + "end": 17004, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 67 } }, "callee": { "type": "Identifier", - "start": 16716, - "end": 16719, + "start": 16957, + "end": 16960, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 23 }, "identifierName": "log" @@ -21078,29 +21700,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16720, - "end": 16762, + "start": 16961, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 24 }, "end": { - "line": 400, + "line": 411, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16720, - "end": 16742, + "start": 16961, + "end": 16983, "loc": { "start": { - "line": 400, + "line": 411, "column": 24 }, "end": { - "line": 400, + "line": 411, "column": 46 } }, @@ -21113,29 +21735,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16745, - "end": 16762, + "start": 16986, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 49 }, "end": { - "line": 400, + "line": 411, "column": 66 } }, "object": { "type": "Identifier", - "start": 16745, - "end": 16750, + "start": 16986, + "end": 16991, "loc": { "start": { - "line": 400, + "line": 411, "column": 49 }, "end": { - "line": 400, + "line": 411, "column": 54 }, "identifierName": "stats" @@ -21144,15 +21766,15 @@ }, "property": { "type": "Identifier", - "start": 16751, - "end": 16762, + "start": 16992, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 55 }, "end": { - "line": 400, + "line": 411, "column": 66 }, "identifierName": "numTextures" @@ -21167,43 +21789,43 @@ }, { "type": "ExpressionStatement", - "start": 16785, - "end": 16839, + "start": 17026, + "end": 17080, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 74 } }, "expression": { "type": "CallExpression", - "start": 16785, - "end": 16838, + "start": 17026, + "end": 17079, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 73 } }, "callee": { "type": "Identifier", - "start": 16785, - "end": 16788, + "start": 17026, + "end": 17029, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 23 }, "identifierName": "log" @@ -21213,29 +21835,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16789, - "end": 16837, + "start": 17030, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 24 }, "end": { - "line": 401, + "line": 412, "column": 72 } }, "left": { "type": "StringLiteral", - "start": 16789, - "end": 16814, + "start": 17030, + "end": 17055, "loc": { "start": { - "line": 401, + "line": 412, "column": 24 }, "end": { - "line": 401, + "line": 412, "column": 49 } }, @@ -21248,29 +21870,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16817, - "end": 16837, + "start": 17058, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 52 }, "end": { - "line": 401, + "line": 412, "column": 72 } }, "object": { "type": "Identifier", - "start": 16817, - "end": 16822, + "start": 17058, + "end": 17063, "loc": { "start": { - "line": 401, + "line": 412, "column": 52 }, "end": { - "line": 401, + "line": 412, "column": 57 }, "identifierName": "stats" @@ -21279,15 +21901,15 @@ }, "property": { "type": "Identifier", - "start": 16823, - "end": 16837, + "start": 17064, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 58 }, "end": { - "line": 401, + "line": 412, "column": 72 }, "identifierName": "numTextureSets" @@ -21302,43 +21924,43 @@ }, { "type": "ExpressionStatement", - "start": 16860, - "end": 16910, + "start": 17101, + "end": 17151, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 16860, - "end": 16909, + "start": 17101, + "end": 17150, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 69 } }, "callee": { "type": "Identifier", - "start": 16860, - "end": 16863, + "start": 17101, + "end": 17104, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 23 }, "identifierName": "log" @@ -21348,29 +21970,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16864, - "end": 16908, + "start": 17105, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 24 }, "end": { - "line": 402, + "line": 413, "column": 68 } }, "left": { "type": "StringLiteral", - "start": 16864, - "end": 16887, + "start": 17105, + "end": 17128, "loc": { "start": { - "line": 402, + "line": 413, "column": 24 }, "end": { - "line": 402, + "line": 413, "column": 47 } }, @@ -21383,29 +22005,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16890, - "end": 16908, + "start": 17131, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 50 }, "end": { - "line": 402, + "line": 413, "column": 68 } }, "object": { "type": "Identifier", - "start": 16890, - "end": 16895, + "start": 17131, + "end": 17136, "loc": { "start": { - "line": 402, + "line": 413, "column": 50 }, "end": { - "line": 402, + "line": 413, "column": 55 }, "identifierName": "stats" @@ -21414,15 +22036,15 @@ }, "property": { "type": "Identifier", - "start": 16896, - "end": 16908, + "start": 17137, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 56 }, "end": { - "line": 402, + "line": 413, "column": 68 }, "identifierName": "numTriangles" @@ -21437,43 +22059,43 @@ }, { "type": "ExpressionStatement", - "start": 16931, - "end": 16979, + "start": 17172, + "end": 17220, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 68 } }, "expression": { "type": "CallExpression", - "start": 16931, - "end": 16978, + "start": 17172, + "end": 17219, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 67 } }, "callee": { "type": "Identifier", - "start": 16931, - "end": 16934, + "start": 17172, + "end": 17175, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 23 }, "identifierName": "log" @@ -21483,29 +22105,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16935, - "end": 16977, + "start": 17176, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 24 }, "end": { - "line": 403, + "line": 414, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16935, - "end": 16957, + "start": 17176, + "end": 17198, "loc": { "start": { - "line": 403, + "line": 414, "column": 24 }, "end": { - "line": 403, + "line": 414, "column": 46 } }, @@ -21518,29 +22140,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16960, - "end": 16977, + "start": 17201, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 49 }, "end": { - "line": 403, + "line": 414, "column": 66 } }, "object": { "type": "Identifier", - "start": 16960, - "end": 16965, + "start": 17201, + "end": 17206, "loc": { "start": { - "line": 403, + "line": 414, "column": 49 }, "end": { - "line": 403, + "line": 414, "column": 54 }, "identifierName": "stats" @@ -21549,15 +22171,15 @@ }, "property": { "type": "Identifier", - "start": 16966, - "end": 16977, + "start": 17207, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 55 }, "end": { - "line": 403, + "line": 414, "column": 66 }, "identifierName": "numVertices" @@ -21572,43 +22194,43 @@ }, { "type": "ExpressionStatement", - "start": 17000, - "end": 17038, + "start": 17241, + "end": 17279, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 58 } }, "expression": { "type": "CallExpression", - "start": 17000, - "end": 17037, + "start": 17241, + "end": 17278, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 57 } }, "callee": { "type": "Identifier", - "start": 17000, - "end": 17003, + "start": 17241, + "end": 17244, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 23 }, "identifierName": "log" @@ -21618,29 +22240,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17004, - "end": 17036, + "start": 17245, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 24 }, "end": { - "line": 404, + "line": 415, "column": 56 } }, "left": { "type": "StringLiteral", - "start": 17004, - "end": 17021, + "start": 17245, + "end": 17262, "loc": { "start": { - "line": 404, + "line": 415, "column": 24 }, "end": { - "line": 404, + "line": 415, "column": 41 } }, @@ -21653,29 +22275,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17024, - "end": 17036, + "start": 17265, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 44 }, "end": { - "line": 404, + "line": 415, "column": 56 } }, "object": { "type": "Identifier", - "start": 17024, - "end": 17029, + "start": 17265, + "end": 17270, "loc": { "start": { - "line": 404, + "line": 415, "column": 44 }, "end": { - "line": 404, + "line": 415, "column": 49 }, "identifierName": "stats" @@ -21684,15 +22306,15 @@ }, "property": { "type": "Identifier", - "start": 17030, - "end": 17036, + "start": 17271, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 50 }, "end": { - "line": 404, + "line": 415, "column": 56 }, "identifierName": "numUVs" @@ -21707,43 +22329,43 @@ }, { "type": "ExpressionStatement", - "start": 17059, - "end": 17105, + "start": 17300, + "end": 17346, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 66 } }, "expression": { "type": "CallExpression", - "start": 17059, - "end": 17104, + "start": 17300, + "end": 17345, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 65 } }, "callee": { "type": "Identifier", - "start": 17059, - "end": 17062, + "start": 17300, + "end": 17303, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 23 }, "identifierName": "log" @@ -21753,29 +22375,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17063, - "end": 17103, + "start": 17304, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 24 }, "end": { - "line": 405, + "line": 416, "column": 64 } }, "left": { "type": "StringLiteral", - "start": 17063, - "end": 17084, + "start": 17304, + "end": 17325, "loc": { "start": { - "line": 405, + "line": 416, "column": 24 }, "end": { - "line": 405, + "line": 416, "column": 45 } }, @@ -21788,29 +22410,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17087, - "end": 17103, + "start": 17328, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 48 }, "end": { - "line": 405, + "line": 416, "column": 64 } }, "object": { "type": "Identifier", - "start": 17087, - "end": 17092, + "start": 17328, + "end": 17333, "loc": { "start": { - "line": 405, + "line": 416, "column": 48 }, "end": { - "line": 405, + "line": 416, "column": 53 }, "identifierName": "stats" @@ -21819,15 +22441,15 @@ }, "property": { "type": "Identifier", - "start": 17093, - "end": 17103, + "start": 17334, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 54 }, "end": { - "line": 405, + "line": 416, "column": 64 }, "identifierName": "numNormals" @@ -21842,43 +22464,43 @@ }, { "type": "ExpressionStatement", - "start": 17126, - "end": 17179, + "start": 17367, + "end": 17420, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 73 } }, "expression": { "type": "CallExpression", - "start": 17126, - "end": 17178, + "start": 17367, + "end": 17419, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 72 } }, "callee": { "type": "Identifier", - "start": 17126, - "end": 17129, + "start": 17367, + "end": 17370, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 23 }, "identifierName": "log" @@ -21888,29 +22510,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17130, - "end": 17177, + "start": 17371, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 24 }, "end": { - "line": 406, + "line": 417, "column": 71 } }, "left": { "type": "StringLiteral", - "start": 17130, - "end": 17149, + "start": 17371, + "end": 17390, "loc": { "start": { - "line": 406, + "line": 417, "column": 24 }, "end": { - "line": 406, + "line": 417, "column": 43 } }, @@ -21923,43 +22545,43 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17152, - "end": 17177, + "start": 17393, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 71 } }, "object": { "type": "MemberExpression", - "start": 17152, - "end": 17170, + "start": 17393, + "end": 17411, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 64 } }, "object": { "type": "Identifier", - "start": 17152, - "end": 17160, + "start": 17393, + "end": 17401, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 54 }, "identifierName": "xktModel" @@ -21968,15 +22590,15 @@ }, "property": { "type": "Identifier", - "start": 17161, - "end": 17170, + "start": 17402, + "end": 17411, "loc": { "start": { - "line": 406, + "line": 417, "column": 55 }, "end": { - "line": 406, + "line": 417, "column": 64 }, "identifierName": "tilesList" @@ -21987,15 +22609,15 @@ }, "property": { "type": "Identifier", - "start": 17171, - "end": 17177, + "start": 17412, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 65 }, "end": { - "line": 406, + "line": 417, "column": 71 }, "identifierName": "length" @@ -22010,43 +22632,43 @@ }, { "type": "ExpressionStatement", - "start": 17200, - "end": 17241, + "start": 17441, + "end": 17482, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 17200, - "end": 17240, + "start": 17441, + "end": 17481, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 60 } }, "callee": { "type": "Identifier", - "start": 17200, - "end": 17203, + "start": 17441, + "end": 17444, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 23 }, "identifierName": "log" @@ -22056,29 +22678,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17204, - "end": 17239, + "start": 17445, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 24 }, "end": { - "line": 407, + "line": 418, "column": 59 } }, "left": { "type": "StringLiteral", - "start": 17204, - "end": 17219, + "start": 17445, + "end": 17460, "loc": { "start": { - "line": 407, + "line": 418, "column": 24 }, "end": { - "line": 407, + "line": 418, "column": 39 } }, @@ -22091,29 +22713,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17222, - "end": 17239, + "start": 17463, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 42 }, "end": { - "line": 407, + "line": 418, "column": 59 } }, "object": { "type": "Identifier", - "start": 17222, - "end": 17227, + "start": 17463, + "end": 17468, "loc": { "start": { - "line": 407, + "line": 418, "column": 42 }, "end": { - "line": 407, + "line": 418, "column": 47 }, "identifierName": "stats" @@ -22122,15 +22744,15 @@ }, "property": { "type": "Identifier", - "start": 17228, - "end": 17239, + "start": 17469, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 48 }, "end": { - "line": 407, + "line": 418, "column": 59 }, "identifierName": "minTileSize" @@ -22145,29 +22767,29 @@ }, { "type": "IfStatement", - "start": 17263, - "end": 17659, + "start": 17504, + "end": 17900, "loc": { "start": { - "line": 409, + "line": 420, "column": 20 }, "end": { - "line": 416, + "line": 427, "column": 21 } }, "test": { "type": "Identifier", - "start": 17267, - "end": 17273, + "start": 17508, + "end": 17514, "loc": { "start": { - "line": 409, + "line": 420, "column": 24 }, "end": { - "line": 409, + "line": 420, "column": 30 }, "identifierName": "output" @@ -22176,59 +22798,59 @@ }, "consequent": { "type": "BlockStatement", - "start": 17275, - "end": 17659, + "start": 17516, + "end": 17900, "loc": { "start": { - "line": 409, + "line": 420, "column": 32 }, "end": { - "line": 416, + "line": 427, "column": 21 } }, "body": [ { "type": "VariableDeclaration", - "start": 17301, - "end": 17340, + "start": 17542, + "end": 17581, "loc": { "start": { - "line": 410, + "line": 421, "column": 24 }, "end": { - "line": 410, + "line": 421, "column": 63 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 17307, - "end": 17339, + "start": 17548, + "end": 17580, "loc": { "start": { - "line": 410, + "line": 421, "column": 30 }, "end": { - "line": 410, + "line": 421, "column": 62 } }, "id": { "type": "Identifier", - "start": 17307, - "end": 17316, + "start": 17548, + "end": 17557, "loc": { "start": { - "line": 410, + "line": 421, "column": 30 }, "end": { - "line": 410, + "line": 421, "column": 39 }, "identifierName": "outputDir" @@ -22237,43 +22859,43 @@ }, "init": { "type": "CallExpression", - "start": 17319, - "end": 17339, + "start": 17560, + "end": 17580, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 62 } }, "callee": { "type": "MemberExpression", - "start": 17319, - "end": 17331, + "start": 17560, + "end": 17572, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 54 } }, "object": { "type": "Identifier", - "start": 17319, - "end": 17323, + "start": 17560, + "end": 17564, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 46 }, "identifierName": "path" @@ -22282,15 +22904,15 @@ }, "property": { "type": "Identifier", - "start": 17324, - "end": 17331, + "start": 17565, + "end": 17572, "loc": { "start": { - "line": 410, + "line": 421, "column": 47 }, "end": { - "line": 410, + "line": 421, "column": 54 }, "identifierName": "dirname" @@ -22302,15 +22924,15 @@ "arguments": [ { "type": "Identifier", - "start": 17332, - "end": 17338, + "start": 17573, + "end": 17579, "loc": { "start": { - "line": 410, + "line": 421, "column": 55 }, "end": { - "line": 410, + "line": 421, "column": 61 }, "identifierName": "output" @@ -22325,57 +22947,57 @@ }, { "type": "IfStatement", - "start": 17365, - "end": 17515, + "start": 17606, + "end": 17756, "loc": { "start": { - "line": 411, + "line": 422, "column": 24 }, "end": { - "line": 413, + "line": 424, "column": 25 } }, "test": { "type": "LogicalExpression", - "start": 17369, - "end": 17414, + "start": 17610, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, "left": { "type": "BinaryExpression", - "start": 17369, - "end": 17385, + "start": 17610, + "end": 17626, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 44 } }, "left": { "type": "Identifier", - "start": 17369, - "end": 17378, + "start": 17610, + "end": 17619, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 37 }, "identifierName": "outputDir" @@ -22385,15 +23007,15 @@ "operator": "!==", "right": { "type": "StringLiteral", - "start": 17383, - "end": 17385, + "start": 17624, + "end": 17626, "loc": { "start": { - "line": 411, + "line": 422, "column": 42 }, "end": { - "line": 411, + "line": 422, "column": 44 } }, @@ -22407,15 +23029,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 17389, - "end": 17414, + "start": 17630, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 48 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, @@ -22423,43 +23045,43 @@ "prefix": true, "argument": { "type": "CallExpression", - "start": 17390, - "end": 17414, + "start": 17631, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, "callee": { "type": "MemberExpression", - "start": 17390, - "end": 17403, + "start": 17631, + "end": 17644, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 62 } }, "object": { "type": "Identifier", - "start": 17390, - "end": 17392, + "start": 17631, + "end": 17633, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 51 }, "identifierName": "fs" @@ -22468,15 +23090,15 @@ }, "property": { "type": "Identifier", - "start": 17393, - "end": 17403, + "start": 17634, + "end": 17644, "loc": { "start": { - "line": 411, + "line": 422, "column": 52 }, "end": { - "line": 411, + "line": 422, "column": 62 }, "identifierName": "existsSync" @@ -22488,15 +23110,15 @@ "arguments": [ { "type": "Identifier", - "start": 17404, - "end": 17413, + "start": 17645, + "end": 17654, "loc": { "start": { - "line": 411, + "line": 422, "column": 63 }, "end": { - "line": 411, + "line": 422, "column": 72 }, "identifierName": "outputDir" @@ -22512,72 +23134,72 @@ }, "consequent": { "type": "BlockStatement", - "start": 17416, - "end": 17515, + "start": 17657, + "end": 17756, "loc": { "start": { - "line": 411, + "line": 422, "column": 75 }, "end": { - "line": 413, + "line": 424, "column": 25 } }, "body": [ { "type": "ExpressionStatement", - "start": 17446, - "end": 17489, + "start": 17687, + "end": 17730, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 71 } }, "expression": { "type": "CallExpression", - "start": 17446, - "end": 17488, + "start": 17687, + "end": 17729, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 70 } }, "callee": { "type": "MemberExpression", - "start": 17446, - "end": 17458, + "start": 17687, + "end": 17699, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 40 } }, "object": { "type": "Identifier", - "start": 17446, - "end": 17448, + "start": 17687, + "end": 17689, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 30 }, "identifierName": "fs" @@ -22586,15 +23208,15 @@ }, "property": { "type": "Identifier", - "start": 17449, - "end": 17458, + "start": 17690, + "end": 17699, "loc": { "start": { - "line": 412, + "line": 423, "column": 31 }, "end": { - "line": 412, + "line": 423, "column": 40 }, "identifierName": "mkdirSync" @@ -22606,15 +23228,15 @@ "arguments": [ { "type": "Identifier", - "start": 17459, - "end": 17468, + "start": 17700, + "end": 17709, "loc": { "start": { - "line": 412, + "line": 423, "column": 41 }, "end": { - "line": 412, + "line": 423, "column": 50 }, "identifierName": "outputDir" @@ -22623,30 +23245,30 @@ }, { "type": "ObjectExpression", - "start": 17470, - "end": 17487, + "start": 17711, + "end": 17728, "loc": { "start": { - "line": 412, + "line": 423, "column": 52 }, "end": { - "line": 412, + "line": 423, "column": 69 } }, "properties": [ { "type": "ObjectProperty", - "start": 17471, - "end": 17486, + "start": 17712, + "end": 17727, "loc": { "start": { - "line": 412, + "line": 423, "column": 53 }, "end": { - "line": 412, + "line": 423, "column": 68 } }, @@ -22655,15 +23277,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 17471, - "end": 17480, + "start": 17712, + "end": 17721, "loc": { "start": { - "line": 412, + "line": 423, "column": 53 }, "end": { - "line": 412, + "line": 423, "column": 62 }, "identifierName": "recursive" @@ -22672,15 +23294,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 17482, - "end": 17486, + "start": 17723, + "end": 17727, "loc": { "start": { - "line": 412, + "line": 423, "column": 64 }, "end": { - "line": 412, + "line": 423, "column": 68 } }, @@ -22699,43 +23321,43 @@ }, { "type": "ExpressionStatement", - "start": 17540, - "end": 17575, + "start": 17781, + "end": 17816, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 59 } }, "expression": { "type": "CallExpression", - "start": 17540, - "end": 17574, + "start": 17781, + "end": 17815, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 58 } }, "callee": { "type": "Identifier", - "start": 17540, - "end": 17543, + "start": 17781, + "end": 17784, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 27 }, "identifierName": "log" @@ -22745,29 +23367,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17544, - "end": 17573, + "start": 17785, + "end": 17814, "loc": { "start": { - "line": 414, + "line": 425, "column": 28 }, "end": { - "line": 414, + "line": 425, "column": 57 } }, "left": { "type": "StringLiteral", - "start": 17544, - "end": 17564, + "start": 17785, + "end": 17805, "loc": { "start": { - "line": 414, + "line": 425, "column": 28 }, "end": { - "line": 414, + "line": 425, "column": 48 } }, @@ -22780,15 +23402,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 17567, - "end": 17573, + "start": 17808, + "end": 17814, "loc": { "start": { - "line": 414, + "line": 425, "column": 51 }, "end": { - "line": 414, + "line": 425, "column": 57 }, "identifierName": "output" @@ -22801,57 +23423,57 @@ }, { "type": "ExpressionStatement", - "start": 17600, - "end": 17637, + "start": 17841, + "end": 17878, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 17600, - "end": 17636, + "start": 17841, + "end": 17877, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 60 } }, "callee": { "type": "MemberExpression", - "start": 17600, - "end": 17616, + "start": 17841, + "end": 17857, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 40 } }, "object": { "type": "Identifier", - "start": 17600, - "end": 17602, + "start": 17841, + "end": 17843, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 26 }, "identifierName": "fs" @@ -22860,15 +23482,15 @@ }, "property": { "type": "Identifier", - "start": 17603, - "end": 17616, + "start": 17844, + "end": 17857, "loc": { "start": { - "line": 415, + "line": 426, "column": 27 }, "end": { - "line": 415, + "line": 426, "column": 40 }, "identifierName": "writeFileSync" @@ -22880,15 +23502,15 @@ "arguments": [ { "type": "Identifier", - "start": 17617, - "end": 17623, + "start": 17858, + "end": 17864, "loc": { "start": { - "line": 415, + "line": 426, "column": 41 }, "end": { - "line": 415, + "line": 426, "column": 47 }, "identifierName": "output" @@ -22897,15 +23519,15 @@ }, { "type": "Identifier", - "start": 17625, - "end": 17635, + "start": 17866, + "end": 17876, "loc": { "start": { - "line": 415, + "line": 426, "column": 49 }, "end": { - "line": 415, + "line": 426, "column": 59 }, "identifierName": "xktContent" @@ -22922,29 +23544,29 @@ }, { "type": "IfStatement", - "start": 17681, - "end": 17774, + "start": 17922, + "end": 18015, "loc": { "start": { - "line": 418, + "line": 429, "column": 20 }, "end": { - "line": 420, + "line": 431, "column": 21 } }, "test": { "type": "Identifier", - "start": 17685, - "end": 17699, + "start": 17926, + "end": 17940, "loc": { "start": { - "line": 418, + "line": 429, "column": 24 }, "end": { - "line": 418, + "line": 429, "column": 38 }, "identifierName": "outputXKTModel" @@ -22953,58 +23575,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17701, - "end": 17774, + "start": 17942, + "end": 18015, "loc": { "start": { - "line": 418, + "line": 429, "column": 40 }, "end": { - "line": 420, + "line": 431, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17727, - "end": 17752, + "start": 17968, + "end": 17993, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 17727, - "end": 17751, + "start": 17968, + "end": 17992, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 48 } }, "callee": { "type": "Identifier", - "start": 17727, - "end": 17741, + "start": 17968, + "end": 17982, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 38 }, "identifierName": "outputXKTModel" @@ -23014,15 +23636,15 @@ "arguments": [ { "type": "Identifier", - "start": 17742, - "end": 17750, + "start": 17983, + "end": 17991, "loc": { "start": { - "line": 419, + "line": 430, "column": 39 }, "end": { - "line": 419, + "line": 430, "column": 47 }, "identifierName": "xktModel" @@ -23039,29 +23661,29 @@ }, { "type": "IfStatement", - "start": 17796, - "end": 17881, + "start": 18037, + "end": 18122, "loc": { "start": { - "line": 422, + "line": 433, "column": 20 }, "end": { - "line": 424, + "line": 435, "column": 21 } }, "test": { "type": "Identifier", - "start": 17800, - "end": 17809, + "start": 18041, + "end": 18050, "loc": { "start": { - "line": 422, + "line": 433, "column": 24 }, "end": { - "line": 422, + "line": 433, "column": 33 }, "identifierName": "outputXKT" @@ -23070,58 +23692,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17811, - "end": 17881, + "start": 18052, + "end": 18122, "loc": { "start": { - "line": 422, + "line": 433, "column": 35 }, "end": { - "line": 424, + "line": 435, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17837, - "end": 17859, + "start": 18078, + "end": 18100, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 46 } }, "expression": { "type": "CallExpression", - "start": 17837, - "end": 17858, + "start": 18078, + "end": 18099, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 45 } }, "callee": { "type": "Identifier", - "start": 17837, - "end": 17846, + "start": 18078, + "end": 18087, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 33 }, "identifierName": "outputXKT" @@ -23131,15 +23753,15 @@ "arguments": [ { "type": "Identifier", - "start": 17847, - "end": 17857, + "start": 18088, + "end": 18098, "loc": { "start": { - "line": 423, + "line": 434, "column": 34 }, "end": { - "line": 423, + "line": 434, "column": 44 }, "identifierName": "xktContent" @@ -23156,29 +23778,29 @@ }, { "type": "IfStatement", - "start": 17903, - "end": 17987, + "start": 18144, + "end": 18228, "loc": { "start": { - "line": 426, + "line": 437, "column": 20 }, "end": { - "line": 428, + "line": 439, "column": 21 } }, "test": { "type": "Identifier", - "start": 17907, - "end": 17918, + "start": 18148, + "end": 18159, "loc": { "start": { - "line": 426, + "line": 437, "column": 24 }, "end": { - "line": 426, + "line": 437, "column": 35 }, "identifierName": "outputStats" @@ -23187,58 +23809,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17920, - "end": 17987, + "start": 18161, + "end": 18228, "loc": { "start": { - "line": 426, + "line": 437, "column": 37 }, "end": { - "line": 428, + "line": 439, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17946, - "end": 17965, + "start": 18187, + "end": 18206, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 43 } }, "expression": { "type": "CallExpression", - "start": 17946, - "end": 17964, + "start": 18187, + "end": 18205, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 42 } }, "callee": { "type": "Identifier", - "start": 17946, - "end": 17957, + "start": 18187, + "end": 18198, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 35 }, "identifierName": "outputStats" @@ -23248,15 +23870,15 @@ "arguments": [ { "type": "Identifier", - "start": 17958, - "end": 17963, + "start": 18199, + "end": 18204, "loc": { "start": { - "line": 427, + "line": 438, "column": 36 }, "end": { - "line": 427, + "line": 438, "column": 41 }, "identifierName": "stats" @@ -23273,43 +23895,43 @@ }, { "type": "ExpressionStatement", - "start": 18009, - "end": 18019, + "start": 18250, + "end": 18260, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 30 } }, "expression": { "type": "CallExpression", - "start": 18009, - "end": 18018, + "start": 18250, + "end": 18259, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 29 } }, "callee": { "type": "Identifier", - "start": 18009, - "end": 18016, + "start": 18250, + "end": 18257, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 27 }, "identifierName": "resolve" @@ -23332,15 +23954,15 @@ }, { "type": "ArrowFunctionExpression", - "start": 18055, - "end": 18108, + "start": 18296, + "end": 18349, "loc": { "start": { - "line": 432, + "line": 443, "column": 15 }, "end": { - "line": 434, + "line": 445, "column": 13 } }, @@ -23351,15 +23973,15 @@ "params": [ { "type": "Identifier", - "start": 18056, - "end": 18059, + "start": 18297, + "end": 18300, "loc": { "start": { - "line": 432, + "line": 443, "column": 16 }, "end": { - "line": 432, + "line": 443, "column": 19 }, "identifierName": "err" @@ -23369,58 +23991,58 @@ ], "body": { "type": "BlockStatement", - "start": 18064, - "end": 18108, + "start": 18305, + "end": 18349, "loc": { "start": { - "line": 432, + "line": 443, "column": 24 }, "end": { - "line": 434, + "line": 445, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 18082, - "end": 18094, + "start": 18323, + "end": 18335, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 18082, - "end": 18093, + "start": 18323, + "end": 18334, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 27 } }, "callee": { "type": "Identifier", - "start": 18082, - "end": 18088, + "start": 18323, + "end": 18329, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 22 }, "identifierName": "reject" @@ -23430,15 +24052,15 @@ "arguments": [ { "type": "Identifier", - "start": 18089, - "end": 18092, + "start": 18330, + "end": 18333, "loc": { "start": { - "line": 433, + "line": 444, "column": 23 }, "end": { - "line": 433, + "line": 444, "column": 26 }, "identifierName": "err" @@ -23475,15 +24097,15 @@ }, { "type": "ExportNamedDeclaration", - "start": 18132, - "end": 18153, + "start": 18373, + "end": 18394, "loc": { "start": { - "line": 439, + "line": 450, "column": 0 }, "end": { - "line": 439, + "line": 450, "column": 21 } }, @@ -23491,29 +24113,29 @@ "specifiers": [ { "type": "ExportSpecifier", - "start": 18140, - "end": 18151, + "start": 18381, + "end": 18392, "loc": { "start": { - "line": 439, + "line": 450, "column": 8 }, "end": { - "line": 439, + "line": 450, "column": 19 } }, "local": { "type": "Identifier", - "start": 18140, - "end": 18151, + "start": 18381, + "end": 18392, "loc": { "start": { - "line": 439, + "line": 450, "column": 8 }, "end": { - "line": 439, + "line": 450, "column": 19 }, "identifierName": "convert2xkt" @@ -23522,15 +24144,15 @@ }, "exported": { "type": "Identifier", - "start": 18140, - "end": 18151, + "start": 18381, + "end": 18392, "loc": { "start": { - "line": 439, + "line": 450, "column": 8 }, "end": { - "line": 439, + "line": 450, "column": 19 }, "identifierName": "convert2xkt" @@ -23543,29 +24165,29 @@ }, { "type": "ExportNamedDeclaration", - "start": 18132, - "end": 18153, + "start": 18373, + "end": 18394, "loc": { "start": { - "line": 439, + "line": 450, "column": 0 }, "end": { - "line": 439, + "line": 450, "column": 21 } }, "declaration": { "type": "FunctionDeclaration", "start": 5090, - "end": 18130, + "end": 18371, "loc": { "start": { "line": 75, "column": 0 }, "end": { - "line": 437, + "line": 448, "column": 1 } }, @@ -25027,14 +25649,14 @@ "body": { "type": "BlockStatement", "start": 6004, - "end": 18130, + "end": 18371, "loc": { "start": { "line": 98, "column": 24 }, "end": { - "line": 437, + "line": 448, "column": 1 } }, @@ -27257,44 +27879,574 @@ } }, { - "type": "ReturnStatement", + "type": "FunctionDeclaration", "start": 6605, - "end": 18128, + "end": 6787, "loc": { "start": { "line": 123, "column": 4 }, "end": { - "line": 436, + "line": 129, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 6614, + "end": 6630, + "loc": { + "start": { + "line": 123, + "column": 13 + }, + "end": { + "line": 123, + "column": 29 + }, + "identifierName": "getFileExtension" + }, + "name": "getFileExtension" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6631, + "end": 6639, + "loc": { + "start": { + "line": 123, + "column": 30 + }, + "end": { + "line": 123, + "column": 38 + }, + "identifierName": "fileName" + }, + "name": "fileName" + } + ], + "body": { + "type": "BlockStatement", + "start": 6641, + "end": 6787, + "loc": { + "start": { + "line": 123, + "column": 40 + }, + "end": { + "line": 129, + "column": 5 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 6650, + "end": 6682, + "loc": { + "start": { + "line": 124, + "column": 7 + }, + "end": { + "line": 124, + "column": 39 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6654, + "end": 6681, + "loc": { + "start": { + "line": 124, + "column": 11 + }, + "end": { + "line": 124, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 6654, + "end": 6657, + "loc": { + "start": { + "line": 124, + "column": 11 + }, + "end": { + "line": 124, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "init": { + "type": "CallExpression", + "start": 6661, + "end": 6681, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 38 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6661, + "end": 6673, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 30 + } + }, + "object": { + "type": "Identifier", + "start": 6661, + "end": 6665, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 22 + }, + "identifierName": "path" + }, + "name": "path" + }, + "property": { + "type": "Identifier", + "start": 6666, + "end": 6673, + "loc": { + "start": { + "line": 124, + "column": 23 + }, + "end": { + "line": 124, + "column": 30 + }, + "identifierName": "extname" + }, + "name": "extname" + }, + "computed": false + }, + "arguments": [ + { + "type": "Identifier", + "start": 6674, + "end": 6680, + "loc": { + "start": { + "line": 124, + "column": 31 + }, + "end": { + "line": 124, + "column": 37 + }, + "identifierName": "source" + }, + "name": "source" + } + ] + } + } + ], + "kind": "let" + }, + { + "type": "IfStatement", + "start": 6690, + "end": 6762, + "loc": { + "start": { + "line": 125, + "column": 7 + }, + "end": { + "line": 127, + "column": 8 + } + }, + "test": { + "type": "BinaryExpression", + "start": 6694, + "end": 6715, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 32 + } + }, + "left": { + "type": "CallExpression", + "start": 6694, + "end": 6707, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 24 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6694, + "end": 6704, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 21 + } + }, + "object": { + "type": "Identifier", + "start": 6694, + "end": 6697, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "property": { + "type": "Identifier", + "start": 6698, + "end": 6704, + "loc": { + "start": { + "line": 125, + "column": 15 + }, + "end": { + "line": 125, + "column": 21 + }, + "identifierName": "charAt" + }, + "name": "charAt" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 6705, + "end": 6706, + "loc": { + "start": { + "line": 125, + "column": 22 + }, + "end": { + "line": 125, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + }, + "operator": "===", + "right": { + "type": "StringLiteral", + "start": 6712, + "end": 6715, + "loc": { + "start": { + "line": 125, + "column": 29 + }, + "end": { + "line": 125, + "column": 32 + } + }, + "extra": { + "rawValue": ".", + "raw": "\".\"" + }, + "value": "." + } + }, + "consequent": { + "type": "BlockStatement", + "start": 6717, + "end": 6762, + "loc": { + "start": { + "line": 125, + "column": 34 + }, + "end": { + "line": 127, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6730, + "end": 6753, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 34 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 6730, + "end": 6752, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 33 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 6730, + "end": 6733, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 14 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "right": { + "type": "CallExpression", + "start": 6736, + "end": 6752, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 33 + } + }, + "callee": { + "type": "MemberExpression", + "start": 6736, + "end": 6749, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 30 + } + }, + "object": { + "type": "Identifier", + "start": 6736, + "end": 6739, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 20 + }, + "identifierName": "ext" + }, + "name": "ext" + }, + "property": { + "type": "Identifier", + "start": 6740, + "end": 6749, + "loc": { + "start": { + "line": 126, + "column": 21 + }, + "end": { + "line": 126, + "column": 30 + }, + "identifierName": "substring" + }, + "name": "substring" + }, + "computed": false + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 6750, + "end": 6751, + "loc": { + "start": { + "line": 126, + "column": 31 + }, + "end": { + "line": 126, + "column": 32 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + } + ], + "directives": [] + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "start": 6770, + "end": 6781, + "loc": { + "start": { + "line": 128, + "column": 7 + }, + "end": { + "line": 128, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 6777, + "end": 6780, + "loc": { + "start": { + "line": 128, + "column": 14 + }, + "end": { + "line": 128, + "column": 17 + }, + "identifierName": "ext" + }, + "name": "ext" + } + } + ], + "directives": [] + } + }, + { + "type": "ReturnStatement", + "start": 6793, + "end": 18369, + "loc": { + "start": { + "line": 131, + "column": 4 + }, + "end": { + "line": 447, "column": 7 } }, "argument": { "type": "NewExpression", - "start": 6612, - "end": 18127, + "start": 6800, + "end": 18368, "loc": { "start": { - "line": 123, + "line": 131, "column": 11 }, "end": { - "line": 436, + "line": 447, "column": 6 } }, "callee": { "type": "Identifier", - "start": 6616, - "end": 6623, + "start": 6804, + "end": 6811, "loc": { "start": { - "line": 123, + "line": 131, "column": 15 }, "end": { - "line": 123, + "line": 131, "column": 22 }, "identifierName": "Promise" @@ -27304,15 +28456,15 @@ "arguments": [ { "type": "FunctionExpression", - "start": 6624, - "end": 18126, + "start": 6812, + "end": 18367, "loc": { "start": { - "line": 123, + "line": 131, "column": 23 }, "end": { - "line": 436, + "line": 447, "column": 5 } }, @@ -27323,15 +28475,15 @@ "params": [ { "type": "Identifier", - "start": 6634, - "end": 6641, + "start": 6822, + "end": 6829, "loc": { "start": { - "line": 123, + "line": 131, "column": 33 }, "end": { - "line": 123, + "line": 131, "column": 40 }, "identifierName": "resolve" @@ -27340,15 +28492,15 @@ }, { "type": "Identifier", - "start": 6643, - "end": 6649, + "start": 6831, + "end": 6837, "loc": { "start": { - "line": 123, + "line": 131, "column": 42 }, "end": { - "line": 123, + "line": 131, "column": 48 }, "identifierName": "reject" @@ -27358,59 +28510,59 @@ ], "body": { "type": "BlockStatement", - "start": 6651, - "end": 18126, + "start": 6839, + "end": 18367, "loc": { "start": { - "line": 123, + "line": 131, "column": 50 }, "end": { - "line": 436, + "line": 447, "column": 5 } }, "body": [ { "type": "VariableDeclaration", - "start": 6661, - "end": 6678, + "start": 6849, + "end": 6866, "loc": { "start": { - "line": 124, + "line": 132, "column": 8 }, "end": { - "line": 124, + "line": 132, "column": 25 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 6667, - "end": 6677, + "start": 6855, + "end": 6865, "loc": { "start": { - "line": 124, + "line": 132, "column": 14 }, "end": { - "line": 124, + "line": 132, "column": 24 } }, "id": { "type": "Identifier", - "start": 6667, - "end": 6671, + "start": 6855, + "end": 6859, "loc": { "start": { - "line": 124, + "line": 132, "column": 14 }, "end": { - "line": 124, + "line": 132, "column": 18 }, "identifierName": "_log" @@ -27419,15 +28571,15 @@ }, "init": { "type": "Identifier", - "start": 6674, - "end": 6677, + "start": 6862, + "end": 6865, "loc": { "start": { - "line": 124, + "line": 132, "column": 21 }, "end": { - "line": 124, + "line": 132, "column": 24 }, "identifierName": "log" @@ -27440,44 +28592,44 @@ }, { "type": "ExpressionStatement", - "start": 6687, - "end": 6754, + "start": 6875, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "expression": { "type": "AssignmentExpression", - "start": 6687, - "end": 6754, + "start": 6875, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "operator": "=", "left": { "type": "Identifier", - "start": 6687, - "end": 6690, + "start": 6875, + "end": 6878, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 125, + "line": 133, "column": 11 }, "identifierName": "log" @@ -27486,15 +28638,15 @@ }, "right": { "type": "ArrowFunctionExpression", - "start": 6693, - "end": 6754, + "start": 6881, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 14 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, @@ -27505,15 +28657,15 @@ "params": [ { "type": "Identifier", - "start": 6694, - "end": 6697, + "start": 6882, + "end": 6885, "loc": { "start": { - "line": 125, + "line": 133, "column": 15 }, "end": { - "line": 125, + "line": 133, "column": 18 }, "identifierName": "msg" @@ -27523,58 +28675,58 @@ ], "body": { "type": "BlockStatement", - "start": 6702, - "end": 6754, + "start": 6890, + "end": 6942, "loc": { "start": { - "line": 125, + "line": 133, "column": 23 }, "end": { - "line": 127, + "line": 135, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6716, - "end": 6744, + "start": 6904, + "end": 6932, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 40 } }, "expression": { "type": "CallExpression", - "start": 6716, - "end": 6744, + "start": 6904, + "end": 6932, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 40 } }, "callee": { "type": "Identifier", - "start": 6716, - "end": 6720, + "start": 6904, + "end": 6908, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 16 }, "identifierName": "_log" @@ -27584,30 +28736,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 6721, - "end": 6743, + "start": 6909, + "end": 6931, "loc": { "start": { - "line": 126, + "line": 134, "column": 17 }, "end": { - "line": 126, + "line": 134, "column": 39 } }, "expressions": [ { "type": "Identifier", - "start": 6738, - "end": 6741, + "start": 6926, + "end": 6929, "loc": { "start": { - "line": 126, + "line": 134, "column": 34 }, "end": { - "line": 126, + "line": 134, "column": 37 }, "identifierName": "msg" @@ -27618,15 +28770,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 6722, - "end": 6736, + "start": 6910, + "end": 6924, "loc": { "start": { - "line": 126, + "line": 134, "column": 18 }, "end": { - "line": 126, + "line": 134, "column": 32 } }, @@ -27638,15 +28790,15 @@ }, { "type": "TemplateElement", - "start": 6742, - "end": 6742, + "start": 6930, + "end": 6930, "loc": { "start": { - "line": 126, + "line": 134, "column": 38 }, "end": { - "line": 126, + "line": 134, "column": 38 } }, @@ -27669,43 +28821,43 @@ }, { "type": "IfStatement", - "start": 6764, - "end": 6886, + "start": 6952, + "end": 7074, "loc": { "start": { - "line": 129, + "line": 137, "column": 8 }, "end": { - "line": 132, + "line": 140, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 6768, - "end": 6790, + "start": 6956, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 12 }, "end": { - "line": 129, + "line": 137, "column": 34 } }, "left": { "type": "UnaryExpression", - "start": 6768, - "end": 6775, + "start": 6956, + "end": 6963, "loc": { "start": { - "line": 129, + "line": 137, "column": 12 }, "end": { - "line": 129, + "line": 137, "column": 19 } }, @@ -27713,15 +28865,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6769, - "end": 6775, + "start": 6957, + "end": 6963, "loc": { "start": { - "line": 129, + "line": 137, "column": 13 }, "end": { - "line": 129, + "line": 137, "column": 19 }, "identifierName": "source" @@ -27735,15 +28887,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 6779, - "end": 6790, + "start": 6967, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 23 }, "end": { - "line": 129, + "line": 137, "column": 34 } }, @@ -27751,15 +28903,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6780, - "end": 6790, + "start": 6968, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 24 }, "end": { - "line": 129, + "line": 137, "column": 34 }, "identifierName": "sourceData" @@ -27773,58 +28925,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 6792, - "end": 6886, + "start": 6980, + "end": 7074, "loc": { "start": { - "line": 129, + "line": 137, "column": 36 }, "end": { - "line": 132, + "line": 140, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6806, - "end": 6856, + "start": 6994, + "end": 7044, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 62 } }, "expression": { "type": "CallExpression", - "start": 6806, - "end": 6855, + "start": 6994, + "end": 7043, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 61 } }, "callee": { "type": "Identifier", - "start": 6806, - "end": 6812, + "start": 6994, + "end": 7000, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 18 }, "identifierName": "reject" @@ -27834,15 +28986,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6813, - "end": 6854, + "start": 7001, + "end": 7042, "loc": { "start": { - "line": 130, + "line": 138, "column": 19 }, "end": { - "line": 130, + "line": 138, "column": 60 } }, @@ -27857,15 +29009,15 @@ }, { "type": "ReturnStatement", - "start": 6869, - "end": 6876, + "start": 7057, + "end": 7064, "loc": { "start": { - "line": 131, + "line": 139, "column": 12 }, "end": { - "line": 131, + "line": 139, "column": 19 } }, @@ -27878,43 +29030,43 @@ }, { "type": "IfStatement", - "start": 6896, - "end": 7043, + "start": 7084, + "end": 7231, "loc": { "start": { - "line": 134, + "line": 142, "column": 8 }, "end": { - "line": 137, + "line": 145, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 6900, - "end": 6927, + "start": 7088, + "end": 7115, "loc": { "start": { - "line": 134, + "line": 142, "column": 12 }, "end": { - "line": 134, + "line": 142, "column": 39 } }, "left": { "type": "UnaryExpression", - "start": 6900, - "end": 6913, + "start": 7088, + "end": 7101, "loc": { "start": { - "line": 134, + "line": 142, "column": 12 }, "end": { - "line": 134, + "line": 142, "column": 25 } }, @@ -27922,15 +29074,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 6901, - "end": 6913, + "start": 7089, + "end": 7101, "loc": { "start": { - "line": 134, + "line": 142, "column": 13 }, "end": { - "line": 134, + "line": 142, "column": 25 }, "identifierName": "sourceFormat" @@ -27944,15 +29096,15 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 6917, - "end": 6927, + "start": 7105, + "end": 7115, "loc": { "start": { - "line": 134, + "line": 142, "column": 29 }, "end": { - "line": 134, + "line": 142, "column": 39 }, "identifierName": "sourceData" @@ -27962,58 +29114,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 6929, - "end": 7043, + "start": 7117, + "end": 7231, "loc": { "start": { - "line": 134, + "line": 142, "column": 41 }, "end": { - "line": 137, + "line": 145, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 6943, - "end": 7013, + "start": 7131, + "end": 7201, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 82 } }, "expression": { "type": "CallExpression", - "start": 6943, - "end": 7012, + "start": 7131, + "end": 7200, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 81 } }, "callee": { "type": "Identifier", - "start": 6943, - "end": 6949, + "start": 7131, + "end": 7137, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 18 }, "identifierName": "reject" @@ -28023,15 +29175,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 6950, - "end": 7011, + "start": 7138, + "end": 7199, "loc": { "start": { - "line": 135, + "line": 143, "column": 19 }, "end": { - "line": 135, + "line": 143, "column": 80 } }, @@ -28046,15 +29198,15 @@ }, { "type": "ReturnStatement", - "start": 7026, - "end": 7033, + "start": 7214, + "end": 7221, "loc": { "start": { - "line": 136, + "line": 144, "column": 12 }, "end": { - "line": 136, + "line": 144, "column": 19 } }, @@ -28067,57 +29219,57 @@ }, { "type": "IfStatement", - "start": 7053, - "end": 7208, + "start": 7241, + "end": 7396, "loc": { "start": { - "line": 139, + "line": 147, "column": 8 }, "end": { - "line": 142, + "line": 150, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 7057, - "end": 7097, + "start": 7245, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 52 } }, "left": { "type": "LogicalExpression", - "start": 7057, - "end": 7083, + "start": 7245, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 38 } }, "left": { "type": "UnaryExpression", - "start": 7057, - "end": 7064, + "start": 7245, + "end": 7252, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 19 } }, @@ -28125,15 +29277,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7058, - "end": 7064, + "start": 7246, + "end": 7252, "loc": { "start": { - "line": 139, + "line": 147, "column": 13 }, "end": { - "line": 139, + "line": 147, "column": 19 }, "identifierName": "output" @@ -28147,15 +29299,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 7068, - "end": 7083, + "start": 7256, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 23 }, "end": { - "line": 139, + "line": 147, "column": 38 } }, @@ -28163,15 +29315,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7069, - "end": 7083, + "start": 7257, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 24 }, "end": { - "line": 139, + "line": 147, "column": 38 }, "identifierName": "outputXKTModel" @@ -28186,15 +29338,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 7087, - "end": 7097, + "start": 7275, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 42 }, "end": { - "line": 139, + "line": 147, "column": 52 } }, @@ -28202,15 +29354,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7088, - "end": 7097, + "start": 7276, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 43 }, "end": { - "line": 139, + "line": 147, "column": 52 }, "identifierName": "outputXKT" @@ -28224,58 +29376,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7099, - "end": 7208, + "start": 7287, + "end": 7396, "loc": { "start": { - "line": 139, + "line": 147, "column": 54 }, "end": { - "line": 142, + "line": 150, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7113, - "end": 7178, + "start": 7301, + "end": 7366, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 77 } }, "expression": { "type": "CallExpression", - "start": 7113, - "end": 7177, + "start": 7301, + "end": 7365, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 76 } }, "callee": { "type": "Identifier", - "start": 7113, - "end": 7119, + "start": 7301, + "end": 7307, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 18 }, "identifierName": "reject" @@ -28285,15 +29437,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 7120, - "end": 7176, + "start": 7308, + "end": 7364, "loc": { "start": { - "line": 140, + "line": 148, "column": 19 }, "end": { - "line": 140, + "line": 148, "column": 75 } }, @@ -28308,15 +29460,15 @@ }, { "type": "ReturnStatement", - "start": 7191, - "end": 7198, + "start": 7379, + "end": 7386, "loc": { "start": { - "line": 141, + "line": 149, "column": 12 }, "end": { - "line": 141, + "line": 149, "column": 19 } }, @@ -28329,29 +29481,29 @@ }, { "type": "IfStatement", - "start": 7218, - "end": 7291, + "start": 7406, + "end": 7479, "loc": { "start": { - "line": 144, + "line": 152, "column": 8 }, "end": { - "line": 146, + "line": 154, "column": 9 } }, "test": { "type": "Identifier", - "start": 7222, - "end": 7228, + "start": 7410, + "end": 7416, "loc": { "start": { - "line": 144, + "line": 152, "column": 12 }, "end": { - "line": 144, + "line": 152, "column": 18 }, "identifierName": "source" @@ -28360,58 +29512,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7230, - "end": 7291, + "start": 7418, + "end": 7479, "loc": { "start": { - "line": 144, + "line": 152, "column": 20 }, "end": { - "line": 146, + "line": 154, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7244, - "end": 7281, + "start": 7432, + "end": 7469, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 7244, - "end": 7280, + "start": 7432, + "end": 7468, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 48 } }, "callee": { "type": "Identifier", - "start": 7244, - "end": 7247, + "start": 7432, + "end": 7435, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 15 }, "identifierName": "log" @@ -28421,29 +29573,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 7248, - "end": 7279, + "start": 7436, + "end": 7467, "loc": { "start": { - "line": 145, + "line": 153, "column": 16 }, "end": { - "line": 145, + "line": 153, "column": 47 } }, "left": { "type": "StringLiteral", - "start": 7248, - "end": 7270, + "start": 7436, + "end": 7458, "loc": { "start": { - "line": 145, + "line": 153, "column": 16 }, "end": { - "line": 145, + "line": 153, "column": 38 } }, @@ -28456,15 +29608,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 7273, - "end": 7279, + "start": 7461, + "end": 7467, "loc": { "start": { - "line": 145, + "line": 153, "column": 41 }, "end": { - "line": 145, + "line": 153, "column": 47 }, "identifierName": "source" @@ -28482,44 +29634,44 @@ }, { "type": "VariableDeclaration", - "start": 7301, - "end": 7330, + "start": 7489, + "end": 7518, "loc": { "start": { - "line": 148, + "line": 156, "column": 8 }, "end": { - "line": 148, + "line": 156, "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7307, - "end": 7329, + "start": 7495, + "end": 7517, "loc": { "start": { - "line": 148, + "line": 156, "column": 14 }, "end": { - "line": 148, + "line": 156, "column": 36 } }, "id": { "type": "Identifier", - "start": 7307, - "end": 7316, + "start": 7495, + "end": 7504, "loc": { "start": { - "line": 148, + "line": 156, "column": 14 }, "end": { - "line": 148, + "line": 156, "column": 23 }, "identifierName": "startTime" @@ -28528,29 +29680,29 @@ }, "init": { "type": "NewExpression", - "start": 7319, - "end": 7329, + "start": 7507, + "end": 7517, "loc": { "start": { - "line": 148, + "line": 156, "column": 26 }, "end": { - "line": 148, + "line": 156, "column": 36 } }, "callee": { "type": "Identifier", - "start": 7323, - "end": 7327, + "start": 7511, + "end": 7515, "loc": { "start": { - "line": 148, + "line": 156, "column": 30 }, "end": { - "line": 148, + "line": 156, "column": 34 }, "identifierName": "Date" @@ -28565,44 +29717,44 @@ }, { "type": "VariableDeclaration", - "start": 7340, - "end": 7390, + "start": 7528, + "end": 7578, "loc": { "start": { - "line": 150, + "line": 158, "column": 8 }, "end": { - "line": 150, + "line": 158, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7346, - "end": 7389, + "start": 7534, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 14 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, "id": { "type": "Identifier", - "start": 7346, - "end": 7359, + "start": 7534, + "end": 7547, "loc": { "start": { - "line": 150, + "line": 158, "column": 14 }, "end": { - "line": 150, + "line": 158, "column": 27 }, "identifierName": "sourceConfigs" @@ -28611,43 +29763,43 @@ }, "init": { "type": "LogicalExpression", - "start": 7362, - "end": 7389, + "start": 7550, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, "left": { "type": "MemberExpression", - "start": 7362, - "end": 7383, + "start": 7550, + "end": 7571, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 51 } }, "object": { "type": "Identifier", - "start": 7362, - "end": 7369, + "start": 7550, + "end": 7557, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 37 }, "identifierName": "configs" @@ -28656,15 +29808,15 @@ }, "property": { "type": "Identifier", - "start": 7370, - "end": 7383, + "start": 7558, + "end": 7571, "loc": { "start": { - "line": 150, + "line": 158, "column": 38 }, "end": { - "line": 150, + "line": 158, "column": 51 }, "identifierName": "sourceConfigs" @@ -28676,15 +29828,15 @@ "operator": "||", "right": { "type": "ObjectExpression", - "start": 7387, - "end": 7389, + "start": 7575, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 55 }, "end": { - "line": 150, + "line": 158, "column": 57 } }, @@ -28697,44 +29849,44 @@ }, { "type": "VariableDeclaration", - "start": 7399, - "end": 7448, + "start": 7587, + "end": 7640, "loc": { "start": { - "line": 151, + "line": 159, "column": 8 }, "end": { - "line": 151, - "column": 57 + "line": 159, + "column": 61 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7405, - "end": 7447, + "start": 7593, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 14 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "id": { "type": "Identifier", - "start": 7405, - "end": 7408, + "start": 7593, + "end": 7596, "loc": { "start": { - "line": 151, + "line": 159, "column": 14 }, "end": { - "line": 151, + "line": 159, "column": 17 }, "identifierName": "ext" @@ -28743,29 +29895,29 @@ }, "init": { "type": "LogicalExpression", - "start": 7411, - "end": 7447, + "start": 7599, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 20 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "left": { "type": "Identifier", - "start": 7411, - "end": 7423, + "start": 7599, + "end": 7611, "loc": { "start": { - "line": 151, + "line": 159, "column": 20 }, "end": { - "line": 151, + "line": 159, "column": 32 }, "identifierName": "sourceFormat" @@ -28775,81 +29927,48 @@ "operator": "||", "right": { "type": "CallExpression", - "start": 7427, - "end": 7447, + "start": 7615, + "end": 7639, "loc": { "start": { - "line": 151, + "line": 159, "column": 36 }, "end": { - "line": 151, - "column": 56 + "line": 159, + "column": 60 } }, "callee": { - "type": "MemberExpression", - "start": 7427, - "end": 7439, + "type": "Identifier", + "start": 7615, + "end": 7631, "loc": { "start": { - "line": 151, + "line": 159, "column": 36 }, "end": { - "line": 151, - "column": 48 - } - }, - "object": { - "type": "Identifier", - "start": 7427, - "end": 7431, - "loc": { - "start": { - "line": 151, - "column": 36 - }, - "end": { - "line": 151, - "column": 40 - }, - "identifierName": "path" - }, - "name": "path" - }, - "property": { - "type": "Identifier", - "start": 7432, - "end": 7439, - "loc": { - "start": { - "line": 151, - "column": 41 - }, - "end": { - "line": 151, - "column": 48 - }, - "identifierName": "extname" + "line": 159, + "column": 52 }, - "name": "extname" + "identifierName": "getFileExtension" }, - "computed": false + "name": "getFileExtension" }, "arguments": [ { "type": "Identifier", - "start": 7440, - "end": 7446, + "start": 7632, + "end": 7638, "loc": { "start": { - "line": 151, - "column": 49 + "line": 159, + "column": 53 }, "end": { - "line": 151, - "column": 55 + "line": 159, + "column": 59 }, "identifierName": "source" }, @@ -28862,46 +29981,171 @@ ], "kind": "const" }, + { + "type": "ExpressionStatement", + "start": 7650, + "end": 7688, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 46 + } + }, + "expression": { + "type": "CallExpression", + "start": 7650, + "end": 7687, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 45 + } + }, + "callee": { + "type": "Identifier", + "start": 7650, + "end": 7653, + "loc": { + "start": { + "line": 161, + "column": 8 + }, + "end": { + "line": 161, + "column": 11 + }, + "identifierName": "log" + }, + "name": "log" + }, + "arguments": [ + { + "type": "TemplateLiteral", + "start": 7654, + "end": 7686, + "loc": { + "start": { + "line": 161, + "column": 12 + }, + "end": { + "line": 161, + "column": 44 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 7680, + "end": 7683, + "loc": { + "start": { + "line": 161, + "column": 38 + }, + "end": { + "line": 161, + "column": 41 + }, + "identifierName": "ext" + }, + "name": "ext" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 7655, + "end": 7678, + "loc": { + "start": { + "line": 161, + "column": 13 + }, + "end": { + "line": 161, + "column": 36 + } + }, + "value": { + "raw": "Input file extension: \"", + "cooked": "Input file extension: \"" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 7684, + "end": 7685, + "loc": { + "start": { + "line": 161, + "column": 42 + }, + "end": { + "line": 161, + "column": 43 + } + }, + "value": { + "raw": "\"", + "cooked": "\"" + }, + "tail": true + } + ] + } + ] + } + }, { "type": "VariableDeclaration", - "start": 7457, - "end": 7498, + "start": 7698, + "end": 7739, "loc": { "start": { - "line": 152, + "line": 163, "column": 8 }, "end": { - "line": 152, + "line": 163, "column": 49 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 7461, - "end": 7497, + "start": 7702, + "end": 7738, "loc": { "start": { - "line": 152, + "line": 163, "column": 12 }, "end": { - "line": 152, + "line": 163, "column": 48 } }, "id": { "type": "Identifier", - "start": 7461, - "end": 7476, + "start": 7702, + "end": 7717, "loc": { "start": { - "line": 152, + "line": 163, "column": 12 }, "end": { - "line": 152, + "line": 163, "column": 27 }, "identifierName": "fileTypeConfigs" @@ -28910,29 +30154,29 @@ }, "init": { "type": "MemberExpression", - "start": 7479, - "end": 7497, + "start": 7720, + "end": 7738, "loc": { "start": { - "line": 152, + "line": 163, "column": 30 }, "end": { - "line": 152, + "line": 163, "column": 48 } }, "object": { "type": "Identifier", - "start": 7479, - "end": 7492, + "start": 7720, + "end": 7733, "loc": { "start": { - "line": 152, + "line": 163, "column": 30 }, "end": { - "line": 152, + "line": 163, "column": 43 }, "identifierName": "sourceConfigs" @@ -28941,15 +30185,15 @@ }, "property": { "type": "Identifier", - "start": 7493, - "end": 7496, + "start": 7734, + "end": 7737, "loc": { "start": { - "line": 152, + "line": 163, "column": 44 }, "end": { - "line": 152, + "line": 163, "column": 47 }, "identifierName": "ext" @@ -28964,29 +30208,29 @@ }, { "type": "IfStatement", - "start": 7508, - "end": 7764, + "start": 7749, + "end": 8005, "loc": { "start": { - "line": 154, + "line": 165, "column": 8 }, "end": { - "line": 157, + "line": 168, "column": 9 } }, "test": { "type": "UnaryExpression", - "start": 7512, - "end": 7528, + "start": 7753, + "end": 7769, "loc": { "start": { - "line": 154, + "line": 165, "column": 12 }, "end": { - "line": 154, + "line": 165, "column": 28 } }, @@ -28994,15 +30238,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7513, - "end": 7528, + "start": 7754, + "end": 7769, "loc": { "start": { - "line": 154, + "line": 165, "column": 13 }, "end": { - "line": 154, + "line": 165, "column": 28 }, "identifierName": "fileTypeConfigs" @@ -29015,58 +30259,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 7530, - "end": 7764, + "start": 7771, + "end": 8005, "loc": { "start": { - "line": 154, + "line": 165, "column": 30 }, "end": { - "line": 157, + "line": 168, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 7544, - "end": 7720, + "start": 7785, + "end": 7961, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 188 } }, "expression": { "type": "CallExpression", - "start": 7544, - "end": 7719, + "start": 7785, + "end": 7960, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 187 } }, "callee": { "type": "Identifier", - "start": 7544, - "end": 7547, + "start": 7785, + "end": 7788, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 15 }, "identifierName": "log" @@ -29076,30 +30320,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 7548, - "end": 7718, + "start": 7789, + "end": 7959, "loc": { "start": { - "line": 155, + "line": 166, "column": 16 }, "end": { - "line": 155, + "line": 166, "column": 186 } }, "expressions": [ { "type": "Identifier", - "start": 7623, - "end": 7626, + "start": 7864, + "end": 7867, "loc": { "start": { - "line": 155, + "line": 166, "column": 91 }, "end": { - "line": 155, + "line": 166, "column": 94 }, "identifierName": "ext" @@ -29110,15 +30354,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 7549, - "end": 7621, + "start": 7790, + "end": 7862, "loc": { "start": { - "line": 155, + "line": 166, "column": 17 }, "end": { - "line": 155, + "line": 166, "column": 89 } }, @@ -29130,15 +30374,15 @@ }, { "type": "TemplateElement", - "start": 7627, - "end": 7717, + "start": 7868, + "end": 7958, "loc": { "start": { - "line": 155, + "line": 166, "column": 95 }, "end": { - "line": 155, + "line": 166, "column": 185 } }, @@ -29155,44 +30399,44 @@ }, { "type": "ExpressionStatement", - "start": 7733, - "end": 7754, + "start": 7974, + "end": 7995, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 33 } }, "expression": { "type": "AssignmentExpression", - "start": 7733, - "end": 7753, + "start": 7974, + "end": 7994, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 32 } }, "operator": "=", "left": { "type": "Identifier", - "start": 7733, - "end": 7748, + "start": 7974, + "end": 7989, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 27 }, "identifierName": "fileTypeConfigs" @@ -29201,15 +30445,15 @@ }, "right": { "type": "ObjectExpression", - "start": 7751, - "end": 7753, + "start": 7992, + "end": 7994, "loc": { "start": { - "line": 156, + "line": 167, "column": 30 }, "end": { - "line": 156, + "line": 167, "column": 32 } }, @@ -29224,29 +30468,29 @@ }, { "type": "FunctionDeclaration", - "start": 7773, - "end": 7941, + "start": 8014, + "end": 8182, "loc": { "start": { - "line": 158, + "line": 169, "column": 8 }, "end": { - "line": 163, + "line": 174, "column": 9 } }, "id": { "type": "Identifier", - "start": 7782, - "end": 7796, + "start": 8023, + "end": 8037, "loc": { "start": { - "line": 158, + "line": 169, "column": 17 }, "end": { - "line": 158, + "line": 169, "column": 31 }, "identifierName": "overrideOption" @@ -29259,15 +30503,15 @@ "params": [ { "type": "Identifier", - "start": 7797, - "end": 7804, + "start": 8038, + "end": 8045, "loc": { "start": { - "line": 158, + "line": 169, "column": 32 }, "end": { - "line": 158, + "line": 169, "column": 39 }, "identifierName": "option1" @@ -29276,15 +30520,15 @@ }, { "type": "Identifier", - "start": 7806, - "end": 7813, + "start": 8047, + "end": 8054, "loc": { "start": { - "line": 158, + "line": 169, "column": 41 }, "end": { - "line": 158, + "line": 169, "column": 48 }, "identifierName": "option2" @@ -29294,58 +30538,58 @@ ], "body": { "type": "BlockStatement", - "start": 7815, - "end": 7941, + "start": 8056, + "end": 8182, "loc": { "start": { - "line": 158, + "line": 169, "column": 50 }, "end": { - "line": 163, + "line": 174, "column": 9 } }, "body": [ { "type": "IfStatement", - "start": 7829, - "end": 7903, + "start": 8070, + "end": 8144, "loc": { "start": { - "line": 159, + "line": 170, "column": 12 }, "end": { - "line": 161, + "line": 172, "column": 13 } }, "test": { "type": "BinaryExpression", - "start": 7833, - "end": 7854, + "start": 8074, + "end": 8095, "loc": { "start": { - "line": 159, + "line": 170, "column": 16 }, "end": { - "line": 159, + "line": 170, "column": 37 } }, "left": { "type": "Identifier", - "start": 7833, - "end": 7840, + "start": 8074, + "end": 8081, "loc": { "start": { - "line": 159, + "line": 170, "column": 16 }, "end": { - "line": 159, + "line": 170, "column": 23 }, "identifierName": "option1" @@ -29355,15 +30599,15 @@ "operator": "!==", "right": { "type": "Identifier", - "start": 7845, - "end": 7854, + "start": 8086, + "end": 8095, "loc": { "start": { - "line": 159, + "line": 170, "column": 28 }, "end": { - "line": 159, + "line": 170, "column": 37 }, "identifierName": "undefined" @@ -29373,44 +30617,44 @@ }, "consequent": { "type": "BlockStatement", - "start": 7856, - "end": 7903, + "start": 8097, + "end": 8144, "loc": { "start": { - "line": 159, + "line": 170, "column": 39 }, "end": { - "line": 161, + "line": 172, "column": 13 } }, "body": [ { "type": "ReturnStatement", - "start": 7874, - "end": 7889, + "start": 8115, + "end": 8130, "loc": { "start": { - "line": 160, + "line": 171, "column": 16 }, "end": { - "line": 160, + "line": 171, "column": 31 } }, "argument": { "type": "Identifier", - "start": 7881, - "end": 7888, + "start": 8122, + "end": 8129, "loc": { "start": { - "line": 160, + "line": 171, "column": 23 }, "end": { - "line": 160, + "line": 171, "column": 30 }, "identifierName": "option1" @@ -29425,29 +30669,29 @@ }, { "type": "ReturnStatement", - "start": 7916, - "end": 7931, + "start": 8157, + "end": 8172, "loc": { "start": { - "line": 162, + "line": 173, "column": 12 }, "end": { - "line": 162, + "line": 173, "column": 27 } }, "argument": { "type": "Identifier", - "start": 7923, - "end": 7930, + "start": 8164, + "end": 8171, "loc": { "start": { - "line": 162, + "line": 173, "column": 19 }, "end": { - "line": 162, + "line": 173, "column": 26 }, "identifierName": "option2" @@ -29461,29 +30705,29 @@ }, { "type": "IfStatement", - "start": 7951, - "end": 8146, + "start": 8192, + "end": 8387, "loc": { "start": { - "line": 165, + "line": 176, "column": 8 }, "end": { - "line": 172, + "line": 183, "column": 9 } }, "test": { "type": "UnaryExpression", - "start": 7955, - "end": 7966, + "start": 8196, + "end": 8207, "loc": { "start": { - "line": 165, + "line": 176, "column": 12 }, "end": { - "line": 165, + "line": 176, "column": 23 } }, @@ -29491,15 +30735,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 7956, - "end": 7966, + "start": 8197, + "end": 8207, "loc": { "start": { - "line": 165, + "line": 176, "column": 13 }, "end": { - "line": 165, + "line": 176, "column": 23 }, "identifierName": "sourceData" @@ -29512,88 +30756,88 @@ }, "consequent": { "type": "BlockStatement", - "start": 7968, - "end": 8146, + "start": 8209, + "end": 8387, "loc": { "start": { - "line": 165, + "line": 176, "column": 25 }, "end": { - "line": 172, + "line": 183, "column": 9 } }, "body": [ { "type": "TryStatement", - "start": 7982, - "end": 8136, + "start": 8223, + "end": 8377, "loc": { "start": { - "line": 166, + "line": 177, "column": 12 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 7986, - "end": 8055, + "start": 8227, + "end": 8296, "loc": { "start": { - "line": 166, + "line": 177, "column": 16 }, "end": { - "line": 168, + "line": 179, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8004, - "end": 8041, + "start": 8245, + "end": 8282, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 53 } }, "expression": { "type": "AssignmentExpression", - "start": 8004, - "end": 8040, + "start": 8245, + "end": 8281, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 52 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8004, - "end": 8014, + "start": 8245, + "end": 8255, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 26 }, "identifierName": "sourceData" @@ -29602,43 +30846,43 @@ }, "right": { "type": "CallExpression", - "start": 8017, - "end": 8040, + "start": 8258, + "end": 8281, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 52 } }, "callee": { "type": "MemberExpression", - "start": 8017, - "end": 8032, + "start": 8258, + "end": 8273, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 44 } }, "object": { "type": "Identifier", - "start": 8017, - "end": 8019, + "start": 8258, + "end": 8260, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 31 }, "identifierName": "fs" @@ -29647,15 +30891,15 @@ }, "property": { "type": "Identifier", - "start": 8020, - "end": 8032, + "start": 8261, + "end": 8273, "loc": { "start": { - "line": 167, + "line": 178, "column": 32 }, "end": { - "line": 167, + "line": 178, "column": 44 }, "identifierName": "readFileSync" @@ -29667,15 +30911,15 @@ "arguments": [ { "type": "Identifier", - "start": 8033, - "end": 8039, + "start": 8274, + "end": 8280, "loc": { "start": { - "line": 167, + "line": 178, "column": 45 }, "end": { - "line": 167, + "line": 178, "column": 51 }, "identifierName": "source" @@ -29691,29 +30935,29 @@ }, "handler": { "type": "CatchClause", - "start": 8056, - "end": 8136, + "start": 8297, + "end": 8377, "loc": { "start": { - "line": 168, + "line": 179, "column": 14 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "param": { "type": "Identifier", - "start": 8063, - "end": 8066, + "start": 8304, + "end": 8307, "loc": { "start": { - "line": 168, + "line": 179, "column": 21 }, "end": { - "line": 168, + "line": 179, "column": 24 }, "identifierName": "err" @@ -29722,58 +30966,58 @@ }, "body": { "type": "BlockStatement", - "start": 8068, - "end": 8136, + "start": 8309, + "end": 8377, "loc": { "start": { - "line": 168, + "line": 179, "column": 26 }, "end": { - "line": 171, + "line": 182, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8086, - "end": 8098, + "start": 8327, + "end": 8339, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 8086, - "end": 8097, + "start": 8327, + "end": 8338, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 27 } }, "callee": { "type": "Identifier", - "start": 8086, - "end": 8092, + "start": 8327, + "end": 8333, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 22 }, "identifierName": "reject" @@ -29783,15 +31027,15 @@ "arguments": [ { "type": "Identifier", - "start": 8093, - "end": 8096, + "start": 8334, + "end": 8337, "loc": { "start": { - "line": 169, + "line": 180, "column": 23 }, "end": { - "line": 169, + "line": 180, "column": 26 }, "identifierName": "err" @@ -29803,15 +31047,15 @@ }, { "type": "ReturnStatement", - "start": 8115, - "end": 8122, + "start": 8356, + "end": 8363, "loc": { "start": { - "line": 170, + "line": 181, "column": 16 }, "end": { - "line": 170, + "line": 181, "column": 23 } }, @@ -29831,44 +31075,44 @@ }, { "type": "VariableDeclaration", - "start": 8156, - "end": 8206, + "start": 8397, + "end": 8447, "loc": { "start": { - "line": 174, + "line": 185, "column": 8 }, "end": { - "line": 174, + "line": 185, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8162, - "end": 8205, + "start": 8403, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 14 }, "end": { - "line": 174, + "line": 185, "column": 57 } }, "id": { "type": "Identifier", - "start": 8162, - "end": 8181, + "start": 8403, + "end": 8422, "loc": { "start": { - "line": 174, + "line": 185, "column": 14 }, "end": { - "line": 174, + "line": 185, "column": 33 }, "identifierName": "sourceFileSizeBytes" @@ -29877,29 +31121,29 @@ }, "init": { "type": "MemberExpression", - "start": 8184, - "end": 8205, + "start": 8425, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 36 }, "end": { - "line": 174, + "line": 185, "column": 57 } }, "object": { "type": "Identifier", - "start": 8184, - "end": 8194, + "start": 8425, + "end": 8435, "loc": { "start": { - "line": 174, + "line": 185, "column": 36 }, "end": { - "line": 174, + "line": 185, "column": 46 }, "identifierName": "sourceData" @@ -29908,15 +31152,15 @@ }, "property": { "type": "Identifier", - "start": 8195, - "end": 8205, + "start": 8436, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 47 }, "end": { - "line": 174, + "line": 185, "column": 57 }, "identifierName": "byteLength" @@ -29931,43 +31175,43 @@ }, { "type": "ExpressionStatement", - "start": 8216, - "end": 8291, + "start": 8457, + "end": 8532, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 83 } }, "expression": { "type": "CallExpression", - "start": 8216, - "end": 8290, + "start": 8457, + "end": 8531, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 82 } }, "callee": { "type": "Identifier", - "start": 8216, - "end": 8219, + "start": 8457, + "end": 8460, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 11 }, "identifierName": "log" @@ -29977,43 +31221,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 8220, - "end": 8289, + "start": 8461, + "end": 8530, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 81 } }, "left": { "type": "BinaryExpression", - "start": 8220, - "end": 8281, + "start": 8461, + "end": 8522, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 73 } }, "left": { "type": "StringLiteral", - "start": 8220, - "end": 8239, + "start": 8461, + "end": 8480, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 31 } }, @@ -30026,57 +31270,57 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 8242, - "end": 8281, + "start": 8483, + "end": 8522, "loc": { "start": { - "line": 176, + "line": 187, "column": 34 }, "end": { - "line": 176, + "line": 187, "column": 73 } }, "callee": { "type": "MemberExpression", - "start": 8242, - "end": 8278, + "start": 8483, + "end": 8519, "loc": { "start": { - "line": 176, + "line": 187, "column": 34 }, "end": { - "line": 176, + "line": 187, "column": 70 } }, "object": { "type": "BinaryExpression", - "start": 8243, - "end": 8269, + "start": 8484, + "end": 8510, "loc": { "start": { - "line": 176, + "line": 187, "column": 35 }, "end": { - "line": 176, + "line": 187, "column": 61 } }, "left": { "type": "Identifier", - "start": 8243, - "end": 8262, + "start": 8484, + "end": 8503, "loc": { "start": { - "line": 176, + "line": 187, "column": 35 }, "end": { - "line": 176, + "line": 187, "column": 54 }, "identifierName": "sourceFileSizeBytes" @@ -30086,15 +31330,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 8265, - "end": 8269, + "start": 8506, + "end": 8510, "loc": { "start": { - "line": 176, + "line": 187, "column": 57 }, "end": { - "line": 176, + "line": 187, "column": 61 } }, @@ -30106,20 +31350,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 8242 + "parenStart": 8483 } }, "property": { "type": "Identifier", - "start": 8271, - "end": 8278, + "start": 8512, + "end": 8519, "loc": { "start": { - "line": 176, + "line": 187, "column": 63 }, "end": { - "line": 176, + "line": 187, "column": 70 }, "identifierName": "toFixed" @@ -30131,15 +31375,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 8279, - "end": 8280, + "start": 8520, + "end": 8521, "loc": { "start": { - "line": 176, + "line": 187, "column": 71 }, "end": { - "line": 176, + "line": 187, "column": 72 } }, @@ -30155,15 +31399,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 8284, - "end": 8289, + "start": 8525, + "end": 8530, "loc": { "start": { - "line": 176, + "line": 187, "column": 76 }, "end": { - "line": 176, + "line": 187, "column": 81 } }, @@ -30179,43 +31423,43 @@ }, { "type": "IfStatement", - "start": 8301, - "end": 8671, + "start": 8542, + "end": 8912, "loc": { "start": { - "line": 178, + "line": 189, "column": 8 }, "end": { - "line": 188, + "line": 199, "column": 9 } }, "test": { "type": "LogicalExpression", - "start": 8305, - "end": 8341, + "start": 8546, + "end": 8582, "loc": { "start": { - "line": 178, + "line": 189, "column": 12 }, "end": { - "line": 178, + "line": 189, "column": 48 } }, "left": { "type": "UnaryExpression", - "start": 8305, - "end": 8322, + "start": 8546, + "end": 8563, "loc": { "start": { - "line": 178, + "line": 189, "column": 12 }, "end": { - "line": 178, + "line": 189, "column": 29 } }, @@ -30223,15 +31467,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 8306, - "end": 8322, + "start": 8547, + "end": 8563, "loc": { "start": { - "line": 178, + "line": 189, "column": 13 }, "end": { - "line": 178, + "line": 189, "column": 29 }, "identifierName": "metaModelDataStr" @@ -30245,15 +31489,15 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 8326, - "end": 8341, + "start": 8567, + "end": 8582, "loc": { "start": { - "line": 178, + "line": 189, "column": 33 }, "end": { - "line": 178, + "line": 189, "column": 48 }, "identifierName": "metaModelSource" @@ -30263,58 +31507,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 8343, - "end": 8604, + "start": 8584, + "end": 8845, "loc": { "start": { - "line": 178, + "line": 189, "column": 50 }, "end": { - "line": 186, + "line": 197, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 8357, - "end": 8412, + "start": 8598, + "end": 8653, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 67 } }, "expression": { "type": "CallExpression", - "start": 8357, - "end": 8411, + "start": 8598, + "end": 8652, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 66 } }, "callee": { "type": "Identifier", - "start": 8357, - "end": 8360, + "start": 8598, + "end": 8601, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 15 }, "identifierName": "log" @@ -30324,29 +31568,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 8361, - "end": 8410, + "start": 8602, + "end": 8651, "loc": { "start": { - "line": 179, + "line": 190, "column": 16 }, "end": { - "line": 179, + "line": 190, "column": 65 } }, "left": { "type": "StringLiteral", - "start": 8361, - "end": 8392, + "start": 8602, + "end": 8633, "loc": { "start": { - "line": 179, + "line": 190, "column": 16 }, "end": { - "line": 179, + "line": 190, "column": 47 } }, @@ -30359,15 +31603,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 8395, - "end": 8410, + "start": 8636, + "end": 8651, "loc": { "start": { - "line": 179, + "line": 190, "column": 50 }, "end": { - "line": 179, + "line": 190, "column": 65 }, "identifierName": "metaModelSource" @@ -30380,73 +31624,73 @@ }, { "type": "TryStatement", - "start": 8425, - "end": 8594, + "start": 8666, + "end": 8835, "loc": { "start": { - "line": 180, + "line": 191, "column": 12 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 8429, - "end": 8513, + "start": 8670, + "end": 8754, "loc": { "start": { - "line": 180, + "line": 191, "column": 16 }, "end": { - "line": 182, + "line": 193, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8447, - "end": 8499, + "start": 8688, + "end": 8740, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 68 } }, "expression": { "type": "AssignmentExpression", - "start": 8447, - "end": 8498, + "start": 8688, + "end": 8739, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 67 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8447, - "end": 8463, + "start": 8688, + "end": 8704, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 32 }, "identifierName": "metaModelDataStr" @@ -30455,43 +31699,43 @@ }, "right": { "type": "CallExpression", - "start": 8466, - "end": 8498, + "start": 8707, + "end": 8739, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 67 } }, "callee": { "type": "MemberExpression", - "start": 8466, - "end": 8481, + "start": 8707, + "end": 8722, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 50 } }, "object": { "type": "Identifier", - "start": 8466, - "end": 8468, + "start": 8707, + "end": 8709, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 37 }, "identifierName": "fs" @@ -30500,15 +31744,15 @@ }, "property": { "type": "Identifier", - "start": 8469, - "end": 8481, + "start": 8710, + "end": 8722, "loc": { "start": { - "line": 181, + "line": 192, "column": 38 }, "end": { - "line": 181, + "line": 192, "column": 50 }, "identifierName": "readFileSync" @@ -30520,15 +31764,15 @@ "arguments": [ { "type": "Identifier", - "start": 8482, - "end": 8497, + "start": 8723, + "end": 8738, "loc": { "start": { - "line": 181, + "line": 192, "column": 51 }, "end": { - "line": 181, + "line": 192, "column": 66 }, "identifierName": "metaModelSource" @@ -30544,29 +31788,29 @@ }, "handler": { "type": "CatchClause", - "start": 8514, - "end": 8594, + "start": 8755, + "end": 8835, "loc": { "start": { - "line": 182, + "line": 193, "column": 14 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "param": { "type": "Identifier", - "start": 8521, - "end": 8524, + "start": 8762, + "end": 8765, "loc": { "start": { - "line": 182, + "line": 193, "column": 21 }, "end": { - "line": 182, + "line": 193, "column": 24 }, "identifierName": "err" @@ -30575,58 +31819,58 @@ }, "body": { "type": "BlockStatement", - "start": 8526, - "end": 8594, + "start": 8767, + "end": 8835, "loc": { "start": { - "line": 182, + "line": 193, "column": 26 }, "end": { - "line": 185, + "line": 196, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8544, - "end": 8556, + "start": 8785, + "end": 8797, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 8544, - "end": 8555, + "start": 8785, + "end": 8796, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 27 } }, "callee": { "type": "Identifier", - "start": 8544, - "end": 8550, + "start": 8785, + "end": 8791, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 22 }, "identifierName": "reject" @@ -30636,15 +31880,15 @@ "arguments": [ { "type": "Identifier", - "start": 8551, - "end": 8554, + "start": 8792, + "end": 8795, "loc": { "start": { - "line": 183, + "line": 194, "column": 23 }, "end": { - "line": 183, + "line": 194, "column": 26 }, "identifierName": "err" @@ -30656,15 +31900,15 @@ }, { "type": "ReturnStatement", - "start": 8573, - "end": 8580, + "start": 8814, + "end": 8821, "loc": { "start": { - "line": 184, + "line": 195, "column": 16 }, "end": { - "line": 184, + "line": 195, "column": 23 } }, @@ -30682,58 +31926,58 @@ }, "alternate": { "type": "BlockStatement", - "start": 8610, - "end": 8671, + "start": 8851, + "end": 8912, "loc": { "start": { - "line": 186, + "line": 197, "column": 15 }, "end": { - "line": 188, + "line": 199, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 8624, - "end": 8661, + "start": 8865, + "end": 8902, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 8624, - "end": 8660, + "start": 8865, + "end": 8901, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 48 } }, "callee": { "type": "Identifier", - "start": 8624, - "end": 8627, + "start": 8865, + "end": 8868, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 15 }, "identifierName": "log" @@ -30743,15 +31987,15 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 8628, - "end": 8659, + "start": 8869, + "end": 8900, "loc": { "start": { - "line": 187, + "line": 198, "column": 16 }, "end": { - "line": 187, + "line": 198, "column": 47 } }, @@ -30759,15 +32003,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 8629, - "end": 8658, + "start": 8870, + "end": 8899, "loc": { "start": { - "line": 187, + "line": 198, "column": 17 }, "end": { - "line": 187, + "line": 198, "column": 46 } }, @@ -30788,44 +32032,44 @@ }, { "type": "VariableDeclaration", - "start": 8681, - "end": 8699, + "start": 8922, + "end": 8940, "loc": { "start": { - "line": 190, + "line": 201, "column": 8 }, "end": { - "line": 190, + "line": 201, "column": 26 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 8685, - "end": 8698, + "start": 8926, + "end": 8939, "loc": { "start": { - "line": 190, + "line": 201, "column": 12 }, "end": { - "line": 190, + "line": 201, "column": 25 } }, "id": { "type": "Identifier", - "start": 8685, - "end": 8698, + "start": 8926, + "end": 8939, "loc": { "start": { - "line": 190, + "line": 201, "column": 12 }, "end": { - "line": 190, + "line": 201, "column": 25 }, "identifierName": "metaModelJSON" @@ -30839,29 +32083,29 @@ }, { "type": "IfStatement", - "start": 8709, - "end": 8956, + "start": 8950, + "end": 9197, "loc": { "start": { - "line": 192, + "line": 203, "column": 8 }, "end": { - "line": 199, + "line": 210, "column": 9 } }, "test": { "type": "Identifier", - "start": 8713, - "end": 8729, + "start": 8954, + "end": 8970, "loc": { "start": { - "line": 192, + "line": 203, "column": 12 }, "end": { - "line": 192, + "line": 203, "column": 28 }, "identifierName": "metaModelDataStr" @@ -30870,88 +32114,88 @@ }, "consequent": { "type": "BlockStatement", - "start": 8731, - "end": 8956, + "start": 8972, + "end": 9197, "loc": { "start": { - "line": 192, + "line": 203, "column": 30 }, "end": { - "line": 199, + "line": 210, "column": 9 } }, "body": [ { "type": "TryStatement", - "start": 8745, - "end": 8946, + "start": 8986, + "end": 9187, "loc": { "start": { - "line": 193, + "line": 204, "column": 12 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "block": { "type": "BlockStatement", - "start": 8749, - "end": 8826, + "start": 8990, + "end": 9067, "loc": { "start": { - "line": 193, + "line": 204, "column": 16 }, "end": { - "line": 195, + "line": 206, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8767, - "end": 8812, + "start": 9008, + "end": 9053, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 61 } }, "expression": { "type": "AssignmentExpression", - "start": 8767, - "end": 8811, + "start": 9008, + "end": 9052, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 60 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8767, - "end": 8780, + "start": 9008, + "end": 9021, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 29 }, "identifierName": "metaModelJSON" @@ -30960,43 +32204,43 @@ }, "right": { "type": "CallExpression", - "start": 8783, - "end": 8811, + "start": 9024, + "end": 9052, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 60 } }, "callee": { "type": "MemberExpression", - "start": 8783, - "end": 8793, + "start": 9024, + "end": 9034, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 42 } }, "object": { "type": "Identifier", - "start": 8783, - "end": 8787, + "start": 9024, + "end": 9028, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 36 }, "identifierName": "JSON" @@ -31005,15 +32249,15 @@ }, "property": { "type": "Identifier", - "start": 8788, - "end": 8793, + "start": 9029, + "end": 9034, "loc": { "start": { - "line": 194, + "line": 205, "column": 37 }, "end": { - "line": 194, + "line": 205, "column": 42 }, "identifierName": "parse" @@ -31025,15 +32269,15 @@ "arguments": [ { "type": "Identifier", - "start": 8794, - "end": 8810, + "start": 9035, + "end": 9051, "loc": { "start": { - "line": 194, + "line": 205, "column": 43 }, "end": { - "line": 194, + "line": 205, "column": 59 }, "identifierName": "metaModelDataStr" @@ -31049,29 +32293,29 @@ }, "handler": { "type": "CatchClause", - "start": 8827, - "end": 8946, + "start": 9068, + "end": 9187, "loc": { "start": { - "line": 195, + "line": 206, "column": 14 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "param": { "type": "Identifier", - "start": 8834, - "end": 8835, + "start": 9075, + "end": 9076, "loc": { "start": { - "line": 195, + "line": 206, "column": 21 }, "end": { - "line": 195, + "line": 206, "column": 22 }, "identifierName": "e" @@ -31080,59 +32324,59 @@ }, "body": { "type": "BlockStatement", - "start": 8837, - "end": 8946, + "start": 9078, + "end": 9187, "loc": { "start": { - "line": 195, + "line": 206, "column": 24 }, "end": { - "line": 198, + "line": 209, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 8855, - "end": 8874, + "start": 9096, + "end": 9115, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 35 } }, "expression": { "type": "AssignmentExpression", - "start": 8855, - "end": 8873, + "start": 9096, + "end": 9114, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 34 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8855, - "end": 8868, + "start": 9096, + "end": 9109, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 29 }, "identifierName": "metaModelJSON" @@ -31141,15 +32385,15 @@ }, "right": { "type": "ObjectExpression", - "start": 8871, - "end": 8873, + "start": 9112, + "end": 9114, "loc": { "start": { - "line": 196, + "line": 207, "column": 32 }, "end": { - "line": 196, + "line": 207, "column": 34 } }, @@ -31159,43 +32403,43 @@ }, { "type": "ExpressionStatement", - "start": 8891, - "end": 8932, + "start": 9132, + "end": 9173, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 57 } }, "expression": { "type": "CallExpression", - "start": 8891, - "end": 8931, + "start": 9132, + "end": 9172, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 56 } }, "callee": { "type": "Identifier", - "start": 8891, - "end": 8894, + "start": 9132, + "end": 9135, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 19 }, "identifierName": "log" @@ -31205,30 +32449,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 8895, - "end": 8930, + "start": 9136, + "end": 9171, "loc": { "start": { - "line": 197, + "line": 208, "column": 20 }, "end": { - "line": 197, + "line": 208, "column": 55 } }, "expressions": [ { "type": "Identifier", - "start": 8927, - "end": 8928, + "start": 9168, + "end": 9169, "loc": { "start": { - "line": 197, + "line": 208, "column": 52 }, "end": { - "line": 197, + "line": 208, "column": 53 }, "identifierName": "e" @@ -31239,15 +32483,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 8896, - "end": 8925, + "start": 9137, + "end": 9166, "loc": { "start": { - "line": 197, + "line": 208, "column": 21 }, "end": { - "line": 197, + "line": 208, "column": 50 } }, @@ -31259,15 +32503,15 @@ }, { "type": "TemplateElement", - "start": 8929, - "end": 8929, + "start": 9170, + "end": 9170, "loc": { "start": { - "line": 197, + "line": 208, "column": 54 }, "end": { - "line": 197, + "line": 208, "column": 54 } }, @@ -31296,44 +32540,44 @@ }, { "type": "ExpressionStatement", - "start": 8966, - "end": 9037, + "start": 9207, + "end": 9278, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 79 } }, "expression": { "type": "AssignmentExpression", - "start": 8966, - "end": 9036, + "start": 9207, + "end": 9277, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 78 } }, "operator": "=", "left": { "type": "Identifier", - "start": 8966, - "end": 8977, + "start": 9207, + "end": 9218, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 19 }, "identifierName": "minTileSize" @@ -31342,29 +32586,29 @@ }, "right": { "type": "CallExpression", - "start": 8980, - "end": 9036, + "start": 9221, + "end": 9277, "loc": { "start": { - "line": 201, + "line": 212, "column": 22 }, "end": { - "line": 201, + "line": 212, "column": 78 } }, "callee": { "type": "Identifier", - "start": 8980, - "end": 8994, + "start": 9221, + "end": 9235, "loc": { "start": { - "line": 201, + "line": 212, "column": 22 }, "end": { - "line": 201, + "line": 212, "column": 36 }, "identifierName": "overrideOption" @@ -31374,29 +32618,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 8995, - "end": 9022, + "start": 9236, + "end": 9263, "loc": { "start": { - "line": 201, + "line": 212, "column": 37 }, "end": { - "line": 201, + "line": 212, "column": 64 } }, "object": { "type": "Identifier", - "start": 8995, - "end": 9010, + "start": 9236, + "end": 9251, "loc": { "start": { - "line": 201, + "line": 212, "column": 37 }, "end": { - "line": 201, + "line": 212, "column": 52 }, "identifierName": "fileTypeConfigs" @@ -31405,15 +32649,15 @@ }, "property": { "type": "Identifier", - "start": 9011, - "end": 9022, + "start": 9252, + "end": 9263, "loc": { "start": { - "line": 201, + "line": 212, "column": 53 }, "end": { - "line": 201, + "line": 212, "column": 64 }, "identifierName": "minTileSize" @@ -31424,15 +32668,15 @@ }, { "type": "Identifier", - "start": 9024, - "end": 9035, + "start": 9265, + "end": 9276, "loc": { "start": { - "line": 201, + "line": 212, "column": 66 }, "end": { - "line": 201, + "line": 212, "column": 77 }, "identifierName": "minTileSize" @@ -31445,44 +32689,44 @@ }, { "type": "ExpressionStatement", - "start": 9046, - "end": 9105, + "start": 9287, + "end": 9346, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 67 } }, "expression": { "type": "AssignmentExpression", - "start": 9046, - "end": 9104, + "start": 9287, + "end": 9345, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 66 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9046, - "end": 9053, + "start": 9287, + "end": 9294, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 15 }, "identifierName": "rotateX" @@ -31491,29 +32735,29 @@ }, "right": { "type": "CallExpression", - "start": 9056, - "end": 9104, + "start": 9297, + "end": 9345, "loc": { "start": { - "line": 202, + "line": 213, "column": 18 }, "end": { - "line": 202, + "line": 213, "column": 66 } }, "callee": { "type": "Identifier", - "start": 9056, - "end": 9070, + "start": 9297, + "end": 9311, "loc": { "start": { - "line": 202, + "line": 213, "column": 18 }, "end": { - "line": 202, + "line": 213, "column": 32 }, "identifierName": "overrideOption" @@ -31523,29 +32767,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9071, - "end": 9094, + "start": 9312, + "end": 9335, "loc": { "start": { - "line": 202, + "line": 213, "column": 33 }, "end": { - "line": 202, + "line": 213, "column": 56 } }, "object": { "type": "Identifier", - "start": 9071, - "end": 9086, + "start": 9312, + "end": 9327, "loc": { "start": { - "line": 202, + "line": 213, "column": 33 }, "end": { - "line": 202, + "line": 213, "column": 48 }, "identifierName": "fileTypeConfigs" @@ -31554,15 +32798,15 @@ }, "property": { "type": "Identifier", - "start": 9087, - "end": 9094, + "start": 9328, + "end": 9335, "loc": { "start": { - "line": 202, + "line": 213, "column": 49 }, "end": { - "line": 202, + "line": 213, "column": 56 }, "identifierName": "rotateX" @@ -31573,15 +32817,15 @@ }, { "type": "Identifier", - "start": 9096, - "end": 9103, + "start": 9337, + "end": 9344, "loc": { "start": { - "line": 202, + "line": 213, "column": 58 }, "end": { - "line": 202, + "line": 213, "column": 65 }, "identifierName": "rotateX" @@ -31594,44 +32838,44 @@ }, { "type": "ExpressionStatement", - "start": 9114, - "end": 9197, + "start": 9355, + "end": 9438, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 91 } }, "expression": { "type": "AssignmentExpression", - "start": 9114, - "end": 9196, + "start": 9355, + "end": 9437, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 90 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9114, - "end": 9129, + "start": 9355, + "end": 9370, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 23 }, "identifierName": "reuseGeometries" @@ -31640,29 +32884,29 @@ }, "right": { "type": "CallExpression", - "start": 9132, - "end": 9196, + "start": 9373, + "end": 9437, "loc": { "start": { - "line": 203, + "line": 214, "column": 26 }, "end": { - "line": 203, + "line": 214, "column": 90 } }, "callee": { "type": "Identifier", - "start": 9132, - "end": 9146, + "start": 9373, + "end": 9387, "loc": { "start": { - "line": 203, + "line": 214, "column": 26 }, "end": { - "line": 203, + "line": 214, "column": 40 }, "identifierName": "overrideOption" @@ -31672,29 +32916,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9147, - "end": 9178, + "start": 9388, + "end": 9419, "loc": { "start": { - "line": 203, + "line": 214, "column": 41 }, "end": { - "line": 203, + "line": 214, "column": 72 } }, "object": { "type": "Identifier", - "start": 9147, - "end": 9162, + "start": 9388, + "end": 9403, "loc": { "start": { - "line": 203, + "line": 214, "column": 41 }, "end": { - "line": 203, + "line": 214, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -31703,15 +32947,15 @@ }, "property": { "type": "Identifier", - "start": 9163, - "end": 9178, + "start": 9404, + "end": 9419, "loc": { "start": { - "line": 203, + "line": 214, "column": 57 }, "end": { - "line": 203, + "line": 214, "column": 72 }, "identifierName": "reuseGeometries" @@ -31722,15 +32966,15 @@ }, { "type": "Identifier", - "start": 9180, - "end": 9195, + "start": 9421, + "end": 9436, "loc": { "start": { - "line": 203, + "line": 214, "column": 74 }, "end": { - "line": 203, + "line": 214, "column": 89 }, "identifierName": "reuseGeometries" @@ -31743,44 +32987,44 @@ }, { "type": "ExpressionStatement", - "start": 9206, - "end": 9289, + "start": 9447, + "end": 9530, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 91 } }, "expression": { "type": "AssignmentExpression", - "start": 9206, - "end": 9288, + "start": 9447, + "end": 9529, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 90 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9206, - "end": 9221, + "start": 9447, + "end": 9462, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 23 }, "identifierName": "includeTextures" @@ -31789,29 +33033,29 @@ }, "right": { "type": "CallExpression", - "start": 9224, - "end": 9288, + "start": 9465, + "end": 9529, "loc": { "start": { - "line": 204, + "line": 215, "column": 26 }, "end": { - "line": 204, + "line": 215, "column": 90 } }, "callee": { "type": "Identifier", - "start": 9224, - "end": 9238, + "start": 9465, + "end": 9479, "loc": { "start": { - "line": 204, + "line": 215, "column": 26 }, "end": { - "line": 204, + "line": 215, "column": 40 }, "identifierName": "overrideOption" @@ -31821,29 +33065,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9239, - "end": 9270, + "start": 9480, + "end": 9511, "loc": { "start": { - "line": 204, + "line": 215, "column": 41 }, "end": { - "line": 204, + "line": 215, "column": 72 } }, "object": { "type": "Identifier", - "start": 9239, - "end": 9254, + "start": 9480, + "end": 9495, "loc": { "start": { - "line": 204, + "line": 215, "column": 41 }, "end": { - "line": 204, + "line": 215, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -31852,15 +33096,15 @@ }, "property": { "type": "Identifier", - "start": 9255, - "end": 9270, + "start": 9496, + "end": 9511, "loc": { "start": { - "line": 204, + "line": 215, "column": 57 }, "end": { - "line": 204, + "line": 215, "column": 72 }, "identifierName": "includeTextures" @@ -31871,15 +33115,15 @@ }, { "type": "Identifier", - "start": 9272, - "end": 9287, + "start": 9513, + "end": 9528, "loc": { "start": { - "line": 204, + "line": 215, "column": 74 }, "end": { - "line": 204, + "line": 215, "column": 89 }, "identifierName": "includeTextures" @@ -31892,44 +33136,44 @@ }, { "type": "ExpressionStatement", - "start": 9298, - "end": 9378, + "start": 9539, + "end": 9619, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 88 } }, "expression": { "type": "AssignmentExpression", - "start": 9298, - "end": 9377, + "start": 9539, + "end": 9618, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 87 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9298, - "end": 9312, + "start": 9539, + "end": 9553, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 22 }, "identifierName": "includeNormals" @@ -31938,29 +33182,29 @@ }, "right": { "type": "CallExpression", - "start": 9315, - "end": 9377, + "start": 9556, + "end": 9618, "loc": { "start": { - "line": 205, + "line": 216, "column": 25 }, "end": { - "line": 205, + "line": 216, "column": 87 } }, "callee": { "type": "Identifier", - "start": 9315, - "end": 9329, + "start": 9556, + "end": 9570, "loc": { "start": { - "line": 205, + "line": 216, "column": 25 }, "end": { - "line": 205, + "line": 216, "column": 39 }, "identifierName": "overrideOption" @@ -31970,29 +33214,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9330, - "end": 9360, + "start": 9571, + "end": 9601, "loc": { "start": { - "line": 205, + "line": 216, "column": 40 }, "end": { - "line": 205, + "line": 216, "column": 70 } }, "object": { "type": "Identifier", - "start": 9330, - "end": 9345, + "start": 9571, + "end": 9586, "loc": { "start": { - "line": 205, + "line": 216, "column": 40 }, "end": { - "line": 205, + "line": 216, "column": 55 }, "identifierName": "fileTypeConfigs" @@ -32001,15 +33245,15 @@ }, "property": { "type": "Identifier", - "start": 9346, - "end": 9360, + "start": 9587, + "end": 9601, "loc": { "start": { - "line": 205, + "line": 216, "column": 56 }, "end": { - "line": 205, + "line": 216, "column": 70 }, "identifierName": "includeNormals" @@ -32020,15 +33264,15 @@ }, { "type": "Identifier", - "start": 9362, - "end": 9376, + "start": 9603, + "end": 9617, "loc": { "start": { - "line": 205, + "line": 216, "column": 72 }, "end": { - "line": 205, + "line": 216, "column": 86 }, "identifierName": "includeNormals" @@ -32041,44 +33285,44 @@ }, { "type": "ExpressionStatement", - "start": 9387, - "end": 9461, + "start": 9628, + "end": 9702, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 82 } }, "expression": { "type": "AssignmentExpression", - "start": 9387, - "end": 9460, + "start": 9628, + "end": 9701, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 81 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9387, - "end": 9399, + "start": 9628, + "end": 9640, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 20 }, "identifierName": "includeTypes" @@ -32087,29 +33331,29 @@ }, "right": { "type": "CallExpression", - "start": 9402, - "end": 9460, + "start": 9643, + "end": 9701, "loc": { "start": { - "line": 206, + "line": 217, "column": 23 }, "end": { - "line": 206, + "line": 217, "column": 81 } }, "callee": { "type": "Identifier", - "start": 9402, - "end": 9416, + "start": 9643, + "end": 9657, "loc": { "start": { - "line": 206, + "line": 217, "column": 23 }, "end": { - "line": 206, + "line": 217, "column": 37 }, "identifierName": "overrideOption" @@ -32119,29 +33363,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9417, - "end": 9445, + "start": 9658, + "end": 9686, "loc": { "start": { - "line": 206, + "line": 217, "column": 38 }, "end": { - "line": 206, + "line": 217, "column": 66 } }, "object": { "type": "Identifier", - "start": 9417, - "end": 9432, + "start": 9658, + "end": 9673, "loc": { "start": { - "line": 206, + "line": 217, "column": 38 }, "end": { - "line": 206, + "line": 217, "column": 53 }, "identifierName": "fileTypeConfigs" @@ -32150,15 +33394,15 @@ }, "property": { "type": "Identifier", - "start": 9433, - "end": 9445, + "start": 9674, + "end": 9686, "loc": { "start": { - "line": 206, + "line": 217, "column": 54 }, "end": { - "line": 206, + "line": 217, "column": 66 }, "identifierName": "includeTypes" @@ -32169,15 +33413,15 @@ }, { "type": "Identifier", - "start": 9447, - "end": 9459, + "start": 9688, + "end": 9700, "loc": { "start": { - "line": 206, + "line": 217, "column": 68 }, "end": { - "line": 206, + "line": 217, "column": 80 }, "identifierName": "includeTypes" @@ -32190,44 +33434,44 @@ }, { "type": "ExpressionStatement", - "start": 9470, - "end": 9544, + "start": 9711, + "end": 9785, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 82 } }, "expression": { "type": "AssignmentExpression", - "start": 9470, - "end": 9543, + "start": 9711, + "end": 9784, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 81 } }, "operator": "=", "left": { "type": "Identifier", - "start": 9470, - "end": 9482, + "start": 9711, + "end": 9723, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 20 }, "identifierName": "excludeTypes" @@ -32236,29 +33480,29 @@ }, "right": { "type": "CallExpression", - "start": 9485, - "end": 9543, + "start": 9726, + "end": 9784, "loc": { "start": { - "line": 207, + "line": 218, "column": 23 }, "end": { - "line": 207, + "line": 218, "column": 81 } }, "callee": { "type": "Identifier", - "start": 9485, - "end": 9499, + "start": 9726, + "end": 9740, "loc": { "start": { - "line": 207, + "line": 218, "column": 23 }, "end": { - "line": 207, + "line": 218, "column": 37 }, "identifierName": "overrideOption" @@ -32268,29 +33512,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 9500, - "end": 9528, + "start": 9741, + "end": 9769, "loc": { "start": { - "line": 207, + "line": 218, "column": 38 }, "end": { - "line": 207, + "line": 218, "column": 66 } }, "object": { "type": "Identifier", - "start": 9500, - "end": 9515, + "start": 9741, + "end": 9756, "loc": { "start": { - "line": 207, + "line": 218, "column": 38 }, "end": { - "line": 207, + "line": 218, "column": 53 }, "identifierName": "fileTypeConfigs" @@ -32299,15 +33543,15 @@ }, "property": { "type": "Identifier", - "start": 9516, - "end": 9528, + "start": 9757, + "end": 9769, "loc": { "start": { - "line": 207, + "line": 218, "column": 54 }, "end": { - "line": 207, + "line": 218, "column": 66 }, "identifierName": "excludeTypes" @@ -32318,15 +33562,15 @@ }, { "type": "Identifier", - "start": 9530, - "end": 9542, + "start": 9771, + "end": 9783, "loc": { "start": { - "line": 207, + "line": 218, "column": 68 }, "end": { - "line": 207, + "line": 218, "column": 80 }, "identifierName": "excludeTypes" @@ -32339,43 +33583,43 @@ }, { "type": "IfStatement", - "start": 9554, - "end": 9643, + "start": 9795, + "end": 9884, "loc": { "start": { - "line": 209, + "line": 220, "column": 8 }, "end": { - "line": 211, + "line": 222, "column": 9 } }, "test": { "type": "BinaryExpression", - "start": 9558, - "end": 9583, + "start": 9799, + "end": 9824, "loc": { "start": { - "line": 209, + "line": 220, "column": 12 }, "end": { - "line": 209, + "line": 220, "column": 37 } }, "left": { "type": "Identifier", - "start": 9558, - "end": 9573, + "start": 9799, + "end": 9814, "loc": { "start": { - "line": 209, + "line": 220, "column": 12 }, "end": { - "line": 209, + "line": 220, "column": 27 }, "identifierName": "reuseGeometries" @@ -32385,15 +33629,15 @@ "operator": "===", "right": { "type": "BooleanLiteral", - "start": 9578, - "end": 9583, + "start": 9819, + "end": 9824, "loc": { "start": { - "line": 209, + "line": 220, "column": 32 }, "end": { - "line": 209, + "line": 220, "column": 37 } }, @@ -32402,58 +33646,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 9585, - "end": 9643, + "start": 9826, + "end": 9884, "loc": { "start": { - "line": 209, + "line": 220, "column": 39 }, "end": { - "line": 211, + "line": 222, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 9599, - "end": 9633, + "start": 9840, + "end": 9874, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 46 } }, "expression": { "type": "CallExpression", - "start": 9599, - "end": 9632, + "start": 9840, + "end": 9873, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 45 } }, "callee": { "type": "Identifier", - "start": 9599, - "end": 9602, + "start": 9840, + "end": 9843, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 15 }, "identifierName": "log" @@ -32463,15 +33707,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 9603, - "end": 9631, + "start": 9844, + "end": 9872, "loc": { "start": { - "line": 210, + "line": 221, "column": 16 }, "end": { - "line": 210, + "line": 221, "column": 44 } }, @@ -32491,44 +33735,44 @@ }, { "type": "VariableDeclaration", - "start": 9653, - "end": 9743, + "start": 9894, + "end": 9984, "loc": { "start": { - "line": 213, + "line": 224, "column": 8 }, "end": { - "line": 216, + "line": 227, "column": 11 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 9659, - "end": 9742, + "start": 9900, + "end": 9983, "loc": { "start": { - "line": 213, + "line": 224, "column": 14 }, "end": { - "line": 216, + "line": 227, "column": 10 } }, "id": { "type": "Identifier", - "start": 9659, - "end": 9667, + "start": 9900, + "end": 9908, "loc": { "start": { - "line": 213, + "line": 224, "column": 14 }, "end": { - "line": 213, + "line": 224, "column": 22 }, "identifierName": "xktModel" @@ -32537,29 +33781,29 @@ }, "init": { "type": "NewExpression", - "start": 9670, - "end": 9742, + "start": 9911, + "end": 9983, "loc": { "start": { - "line": 213, + "line": 224, "column": 25 }, "end": { - "line": 216, + "line": 227, "column": 10 } }, "callee": { "type": "Identifier", - "start": 9674, - "end": 9682, + "start": 9915, + "end": 9923, "loc": { "start": { - "line": 213, + "line": 224, "column": 29 }, "end": { - "line": 213, + "line": 224, "column": 37 }, "identifierName": "XKTModel" @@ -32569,30 +33813,30 @@ "arguments": [ { "type": "ObjectExpression", - "start": 9683, - "end": 9741, + "start": 9924, + "end": 9982, "loc": { "start": { - "line": 213, + "line": 224, "column": 38 }, "end": { - "line": 216, + "line": 227, "column": 9 } }, "properties": [ { "type": "ObjectProperty", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 } }, @@ -32601,15 +33845,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 }, "identifierName": "minTileSize" @@ -32618,15 +33862,15 @@ }, "value": { "type": "Identifier", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 }, "identifierName": "minTileSize" @@ -32639,15 +33883,15 @@ }, { "type": "ObjectProperty", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 } }, @@ -32656,15 +33900,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 }, "identifierName": "modelAABB" @@ -32673,15 +33917,15 @@ }, "value": { "type": "Identifier", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 }, "identifierName": "modelAABB" @@ -32702,29 +33946,29 @@ }, { "type": "SwitchStatement", - "start": 9753, - "end": 14441, + "start": 9994, + "end": 14682, "loc": { "start": { - "line": 218, + "line": 229, "column": 8 }, "end": { - "line": 355, + "line": 366, "column": 9 } }, "discriminant": { "type": "Identifier", - "start": 9761, - "end": 9764, + "start": 10002, + "end": 10005, "loc": { "start": { - "line": 218, + "line": 229, "column": 16 }, "end": { - "line": 218, + "line": 229, "column": 19 }, "identifierName": "ext" @@ -32734,58 +33978,58 @@ "cases": [ { "type": "SwitchCase", - "start": 9780, - "end": 10158, + "start": 10021, + "end": 10399, "loc": { "start": { - "line": 219, + "line": 230, "column": 12 }, "end": { - "line": 229, + "line": 240, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 9809, - "end": 10135, + "start": 10050, + "end": 10376, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 228, + "line": 239, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 9809, - "end": 10134, + "start": 10050, + "end": 10375, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 228, + "line": 239, "column": 18 } }, "callee": { "type": "Identifier", - "start": 9809, - "end": 9816, + "start": 10050, + "end": 10057, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 220, + "line": 231, "column": 23 }, "identifierName": "convert" @@ -32795,15 +34039,15 @@ "arguments": [ { "type": "Identifier", - "start": 9817, - "end": 9842, + "start": 10058, + "end": 10083, "loc": { "start": { - "line": 220, + "line": 231, "column": 24 }, "end": { - "line": 220, + "line": 231, "column": 49 }, "identifierName": "parseCityJSONIntoXKTModel" @@ -32812,30 +34056,30 @@ }, { "type": "ObjectExpression", - "start": 9844, - "end": 10133, + "start": 10085, + "end": 10374, "loc": { "start": { - "line": 220, + "line": 231, "column": 51 }, "end": { - "line": 228, + "line": 239, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 9866, - "end": 9894, + "start": 10107, + "end": 10135, "loc": { "start": { - "line": 221, + "line": 232, "column": 20 }, "end": { - "line": 221, + "line": 232, "column": 48 } }, @@ -32844,15 +34088,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9866, - "end": 9870, + "start": 10107, + "end": 10111, "loc": { "start": { - "line": 221, + "line": 232, "column": 20 }, "end": { - "line": 221, + "line": 232, "column": 24 }, "identifierName": "data" @@ -32861,43 +34105,43 @@ }, "value": { "type": "CallExpression", - "start": 9872, - "end": 9894, + "start": 10113, + "end": 10135, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 48 } }, "callee": { "type": "MemberExpression", - "start": 9872, - "end": 9882, + "start": 10113, + "end": 10123, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 36 } }, "object": { "type": "Identifier", - "start": 9872, - "end": 9876, + "start": 10113, + "end": 10117, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 30 }, "identifierName": "JSON" @@ -32906,15 +34150,15 @@ }, "property": { "type": "Identifier", - "start": 9877, - "end": 9882, + "start": 10118, + "end": 10123, "loc": { "start": { - "line": 221, + "line": 232, "column": 31 }, "end": { - "line": 221, + "line": 232, "column": 36 }, "identifierName": "parse" @@ -32926,15 +34170,15 @@ "arguments": [ { "type": "Identifier", - "start": 9883, - "end": 9893, + "start": 10124, + "end": 10134, "loc": { "start": { - "line": 221, + "line": 232, "column": 37 }, "end": { - "line": 221, + "line": 232, "column": 47 }, "identifierName": "sourceData" @@ -32946,15 +34190,15 @@ }, { "type": "ObjectProperty", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 } }, @@ -32963,15 +34207,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 }, "identifierName": "xktModel" @@ -32980,15 +34224,15 @@ }, "value": { "type": "Identifier", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 }, "identifierName": "xktModel" @@ -33001,15 +34245,15 @@ }, { "type": "ObjectProperty", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 } }, @@ -33018,15 +34262,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 }, "identifierName": "stats" @@ -33035,15 +34279,15 @@ }, "value": { "type": "Identifier", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 }, "identifierName": "stats" @@ -33056,15 +34300,15 @@ }, { "type": "ObjectProperty", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 } }, @@ -33073,15 +34317,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 }, "identifierName": "rotateX" @@ -33090,15 +34334,15 @@ }, "value": { "type": "Identifier", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 }, "identifierName": "rotateX" @@ -33111,15 +34355,15 @@ }, { "type": "ObjectProperty", - "start": 10002, - "end": 10032, + "start": 10243, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 20 }, "end": { - "line": 225, + "line": 236, "column": 50 } }, @@ -33128,15 +34372,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10002, - "end": 10008, + "start": 10243, + "end": 10249, "loc": { "start": { - "line": 225, + "line": 236, "column": 20 }, "end": { - "line": 225, + "line": 236, "column": 26 }, "identifierName": "center" @@ -33145,29 +34389,29 @@ }, "value": { "type": "MemberExpression", - "start": 10010, - "end": 10032, + "start": 10251, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 28 }, "end": { - "line": 225, + "line": 236, "column": 50 } }, "object": { "type": "Identifier", - "start": 10010, - "end": 10025, + "start": 10251, + "end": 10266, "loc": { "start": { - "line": 225, + "line": 236, "column": 28 }, "end": { - "line": 225, + "line": 236, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -33176,15 +34420,15 @@ }, "property": { "type": "Identifier", - "start": 10026, - "end": 10032, + "start": 10267, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 44 }, "end": { - "line": 225, + "line": 236, "column": 50 }, "identifierName": "center" @@ -33196,15 +34440,15 @@ }, { "type": "ObjectProperty", - "start": 10054, - "end": 10090, + "start": 10295, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 20 }, "end": { - "line": 226, + "line": 237, "column": 56 } }, @@ -33213,15 +34457,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10054, - "end": 10063, + "start": 10295, + "end": 10304, "loc": { "start": { - "line": 226, + "line": 237, "column": 20 }, "end": { - "line": 226, + "line": 237, "column": 29 }, "identifierName": "transform" @@ -33230,29 +34474,29 @@ }, "value": { "type": "MemberExpression", - "start": 10065, - "end": 10090, + "start": 10306, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 31 }, "end": { - "line": 226, + "line": 237, "column": 56 } }, "object": { "type": "Identifier", - "start": 10065, - "end": 10080, + "start": 10306, + "end": 10321, "loc": { "start": { - "line": 226, + "line": 237, "column": 31 }, "end": { - "line": 226, + "line": 237, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -33261,15 +34505,15 @@ }, "property": { "type": "Identifier", - "start": 10081, - "end": 10090, + "start": 10322, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 47 }, "end": { - "line": 226, + "line": 237, "column": 56 }, "identifierName": "transform" @@ -33281,15 +34525,15 @@ }, { "type": "ObjectProperty", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 } }, @@ -33298,15 +34542,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 }, "identifierName": "log" @@ -33315,15 +34559,15 @@ }, "value": { "type": "Identifier", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 }, "identifierName": "log" @@ -33341,15 +34585,15 @@ }, { "type": "BreakStatement", - "start": 10152, - "end": 10158, + "start": 10393, + "end": 10399, "loc": { "start": { - "line": 229, + "line": 240, "column": 16 }, "end": { - "line": 229, + "line": 240, "column": 22 } }, @@ -33358,15 +34602,15 @@ ], "test": { "type": "StringLiteral", - "start": 9785, - "end": 9791, + "start": 10026, + "end": 10032, "loc": { "start": { - "line": 219, + "line": 230, "column": 17 }, "end": { - "line": 219, + "line": 230, "column": 23 } }, @@ -33379,59 +34623,59 @@ }, { "type": "SwitchCase", - "start": 10172, - "end": 10616, + "start": 10413, + "end": 10857, "loc": { "start": { - "line": 231, + "line": 242, "column": 12 }, "end": { - "line": 243, + "line": 254, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 10200, - "end": 10239, + "start": 10441, + "end": 10480, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 55 } }, "expression": { "type": "AssignmentExpression", - "start": 10200, - "end": 10238, + "start": 10441, + "end": 10479, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 54 } }, "operator": "=", "left": { "type": "Identifier", - "start": 10200, - "end": 10210, + "start": 10441, + "end": 10451, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 26 }, "identifierName": "sourceData" @@ -33440,29 +34684,29 @@ }, "right": { "type": "CallExpression", - "start": 10213, - "end": 10238, + "start": 10454, + "end": 10479, "loc": { "start": { - "line": 232, + "line": 243, "column": 29 }, "end": { - "line": 232, + "line": 243, "column": 54 } }, "callee": { "type": "Identifier", - "start": 10213, - "end": 10226, + "start": 10454, + "end": 10467, "loc": { "start": { - "line": 232, + "line": 243, "column": 29 }, "end": { - "line": 232, + "line": 243, "column": 42 }, "identifierName": "toArrayBuffer" @@ -33472,15 +34716,15 @@ "arguments": [ { "type": "Identifier", - "start": 10227, - "end": 10237, + "start": 10468, + "end": 10478, "loc": { "start": { - "line": 232, + "line": 243, "column": 43 }, "end": { - "line": 232, + "line": 243, "column": 53 }, "identifierName": "sourceData" @@ -33493,43 +34737,43 @@ }, { "type": "ExpressionStatement", - "start": 10256, - "end": 10593, + "start": 10497, + "end": 10834, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 242, + "line": 253, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 10256, - "end": 10592, + "start": 10497, + "end": 10833, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 242, + "line": 253, "column": 18 } }, "callee": { "type": "Identifier", - "start": 10256, - "end": 10263, + "start": 10497, + "end": 10504, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 233, + "line": 244, "column": 23 }, "identifierName": "convert" @@ -33539,15 +34783,15 @@ "arguments": [ { "type": "Identifier", - "start": 10264, - "end": 10285, + "start": 10505, + "end": 10526, "loc": { "start": { - "line": 233, + "line": 244, "column": 24 }, "end": { - "line": 233, + "line": 244, "column": 45 }, "identifierName": "parseGLTFIntoXKTModel" @@ -33556,30 +34800,30 @@ }, { "type": "ObjectExpression", - "start": 10287, - "end": 10591, + "start": 10528, + "end": 10832, "loc": { "start": { - "line": 233, + "line": 244, "column": 47 }, "end": { - "line": 242, + "line": 253, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 10309, - "end": 10325, + "start": 10550, + "end": 10566, "loc": { "start": { - "line": 234, + "line": 245, "column": 20 }, "end": { - "line": 234, + "line": 245, "column": 36 } }, @@ -33588,15 +34832,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10309, - "end": 10313, + "start": 10550, + "end": 10554, "loc": { "start": { - "line": 234, + "line": 245, "column": 20 }, "end": { - "line": 234, + "line": 245, "column": 24 }, "identifierName": "data" @@ -33605,15 +34849,15 @@ }, "value": { "type": "Identifier", - "start": 10315, - "end": 10325, + "start": 10556, + "end": 10566, "loc": { "start": { - "line": 234, + "line": 245, "column": 26 }, "end": { - "line": 234, + "line": 245, "column": 36 }, "identifierName": "sourceData" @@ -33623,15 +34867,15 @@ }, { "type": "ObjectProperty", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 } }, @@ -33640,15 +34884,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 }, "identifierName": "reuseGeometries" @@ -33657,15 +34901,15 @@ }, "value": { "type": "Identifier", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 }, "identifierName": "reuseGeometries" @@ -33678,15 +34922,15 @@ }, { "type": "ObjectProperty", - "start": 10384, - "end": 10405, + "start": 10625, + "end": 10646, "loc": { "start": { - "line": 236, + "line": 247, "column": 20 }, "end": { - "line": 236, + "line": 247, "column": 41 } }, @@ -33695,15 +34939,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10384, - "end": 10399, + "start": 10625, + "end": 10640, "loc": { "start": { - "line": 236, + "line": 247, "column": 20 }, "end": { - "line": 236, + "line": 247, "column": 35 }, "identifierName": "includeTextures" @@ -33712,15 +34956,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 10401, - "end": 10405, + "start": 10642, + "end": 10646, "loc": { "start": { - "line": 236, + "line": 247, "column": 37 }, "end": { - "line": 236, + "line": 247, "column": 41 } }, @@ -33729,15 +34973,15 @@ }, { "type": "ObjectProperty", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 } }, @@ -33746,15 +34990,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 }, "identifierName": "includeNormals" @@ -33763,15 +35007,15 @@ }, "value": { "type": "Identifier", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 }, "identifierName": "includeNormals" @@ -33784,15 +35028,15 @@ }, { "type": "ObjectProperty", - "start": 10463, - "end": 10491, + "start": 10704, + "end": 10732, "loc": { "start": { - "line": 238, + "line": 249, "column": 20 }, "end": { - "line": 238, + "line": 249, "column": 48 } }, @@ -33801,15 +35045,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10463, - "end": 10476, + "start": 10704, + "end": 10717, "loc": { "start": { - "line": 238, + "line": 249, "column": 20 }, "end": { - "line": 238, + "line": 249, "column": 33 }, "identifierName": "metaModelData" @@ -33818,15 +35062,15 @@ }, "value": { "type": "Identifier", - "start": 10478, - "end": 10491, + "start": 10719, + "end": 10732, "loc": { "start": { - "line": 238, + "line": 249, "column": 35 }, "end": { - "line": 238, + "line": 249, "column": 48 }, "identifierName": "metaModelJSON" @@ -33836,15 +35080,15 @@ }, { "type": "ObjectProperty", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 } }, @@ -33853,15 +35097,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 }, "identifierName": "xktModel" @@ -33870,15 +35114,15 @@ }, "value": { "type": "Identifier", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 }, "identifierName": "xktModel" @@ -33891,15 +35135,15 @@ }, { "type": "ObjectProperty", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 } }, @@ -33908,15 +35152,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 }, "identifierName": "stats" @@ -33925,15 +35169,15 @@ }, "value": { "type": "Identifier", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 }, "identifierName": "stats" @@ -33946,15 +35190,15 @@ }, { "type": "ObjectProperty", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 } }, @@ -33963,15 +35207,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 }, "identifierName": "log" @@ -33980,15 +35224,15 @@ }, "value": { "type": "Identifier", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 }, "identifierName": "log" @@ -34006,15 +35250,15 @@ }, { "type": "BreakStatement", - "start": 10610, - "end": 10616, + "start": 10851, + "end": 10857, "loc": { "start": { - "line": 243, + "line": 254, "column": 16 }, "end": { - "line": 243, + "line": 254, "column": 22 } }, @@ -34023,15 +35267,15 @@ ], "test": { "type": "StringLiteral", - "start": 10177, - "end": 10182, + "start": 10418, + "end": 10423, "loc": { "start": { - "line": 231, + "line": 242, "column": 17 }, "end": { - "line": 231, + "line": 242, "column": 22 } }, @@ -34044,59 +35288,59 @@ }, { "type": "SwitchCase", - "start": 10630, - "end": 11191, + "start": 10871, + "end": 11432, "loc": { "start": { - "line": 245, + "line": 256, "column": 12 }, "end": { - "line": 259, + "line": 270, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 10659, - "end": 10698, + "start": 10900, + "end": 10939, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 55 } }, "expression": { "type": "AssignmentExpression", - "start": 10659, - "end": 10697, + "start": 10900, + "end": 10938, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 54 } }, "operator": "=", "left": { "type": "Identifier", - "start": 10659, - "end": 10669, + "start": 10900, + "end": 10910, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 26 }, "identifierName": "sourceData" @@ -34105,29 +35349,29 @@ }, "right": { "type": "CallExpression", - "start": 10672, - "end": 10697, + "start": 10913, + "end": 10938, "loc": { "start": { - "line": 246, + "line": 257, "column": 29 }, "end": { - "line": 246, + "line": 257, "column": 54 } }, "callee": { "type": "Identifier", - "start": 10672, - "end": 10685, + "start": 10913, + "end": 10926, "loc": { "start": { - "line": 246, + "line": 257, "column": 29 }, "end": { - "line": 246, + "line": 257, "column": 42 }, "identifierName": "toArrayBuffer" @@ -34137,15 +35381,15 @@ "arguments": [ { "type": "Identifier", - "start": 10686, - "end": 10696, + "start": 10927, + "end": 10937, "loc": { "start": { - "line": 246, + "line": 257, "column": 43 }, "end": { - "line": 246, + "line": 257, "column": 53 }, "identifierName": "sourceData" @@ -34158,44 +35402,44 @@ }, { "type": "VariableDeclaration", - "start": 10715, - "end": 10771, + "start": 10956, + "end": 11012, "loc": { "start": { - "line": 247, + "line": 258, "column": 16 }, "end": { - "line": 247, + "line": 258, "column": 72 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 10721, - "end": 10770, + "start": 10962, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 22 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, "id": { "type": "Identifier", - "start": 10721, - "end": 10733, + "start": 10962, + "end": 10974, "loc": { "start": { - "line": 247, + "line": 258, "column": 22 }, "end": { - "line": 247, + "line": 258, "column": 34 }, "identifierName": "gltfBasePath" @@ -34204,29 +35448,29 @@ }, "init": { "type": "ConditionalExpression", - "start": 10736, - "end": 10770, + "start": 10977, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 37 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, "test": { "type": "Identifier", - "start": 10736, - "end": 10742, + "start": 10977, + "end": 10983, "loc": { "start": { - "line": 247, + "line": 258, "column": 37 }, "end": { - "line": 247, + "line": 258, "column": 43 }, "identifierName": "source" @@ -34235,43 +35479,43 @@ }, "consequent": { "type": "CallExpression", - "start": 10745, - "end": 10765, + "start": 10986, + "end": 11006, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 66 } }, "callee": { "type": "MemberExpression", - "start": 10745, - "end": 10757, + "start": 10986, + "end": 10998, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 58 } }, "object": { "type": "Identifier", - "start": 10745, - "end": 10749, + "start": 10986, + "end": 10990, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 50 }, "identifierName": "path" @@ -34280,15 +35524,15 @@ }, "property": { "type": "Identifier", - "start": 10750, - "end": 10757, + "start": 10991, + "end": 10998, "loc": { "start": { - "line": 247, + "line": 258, "column": 51 }, "end": { - "line": 247, + "line": 258, "column": 58 }, "identifierName": "dirname" @@ -34300,15 +35544,15 @@ "arguments": [ { "type": "Identifier", - "start": 10758, - "end": 10764, + "start": 10999, + "end": 11005, "loc": { "start": { - "line": 247, + "line": 258, "column": 59 }, "end": { - "line": 247, + "line": 258, "column": 65 }, "identifierName": "source" @@ -34319,15 +35563,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 10768, - "end": 10770, + "start": 11009, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 69 }, "end": { - "line": 247, + "line": 258, "column": 71 } }, @@ -34344,43 +35588,43 @@ }, { "type": "ExpressionStatement", - "start": 10788, - "end": 11168, + "start": 11029, + "end": 11409, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 258, + "line": 269, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 10788, - "end": 11167, + "start": 11029, + "end": 11408, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 258, + "line": 269, "column": 18 } }, "callee": { "type": "Identifier", - "start": 10788, - "end": 10795, + "start": 11029, + "end": 11036, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 248, + "line": 259, "column": 23 }, "identifierName": "convert" @@ -34390,15 +35634,15 @@ "arguments": [ { "type": "Identifier", - "start": 10796, - "end": 10817, + "start": 11037, + "end": 11058, "loc": { "start": { - "line": 248, + "line": 259, "column": 24 }, "end": { - "line": 248, + "line": 259, "column": 45 }, "identifierName": "parseGLTFIntoXKTModel" @@ -34407,30 +35651,30 @@ }, { "type": "ObjectExpression", - "start": 10819, - "end": 11166, + "start": 11060, + "end": 11407, "loc": { "start": { - "line": 248, + "line": 259, "column": 47 }, "end": { - "line": 258, + "line": 269, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 10841, - "end": 10862, + "start": 11082, + "end": 11103, "loc": { "start": { - "line": 249, + "line": 260, "column": 20 }, "end": { - "line": 249, + "line": 260, "column": 41 } }, @@ -34439,15 +35683,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10841, - "end": 10848, + "start": 11082, + "end": 11089, "loc": { "start": { - "line": 249, + "line": 260, "column": 20 }, "end": { - "line": 249, + "line": 260, "column": 27 }, "identifierName": "baseUri" @@ -34456,15 +35700,15 @@ }, "value": { "type": "Identifier", - "start": 10850, - "end": 10862, + "start": 11091, + "end": 11103, "loc": { "start": { - "line": 249, + "line": 260, "column": 29 }, "end": { - "line": 249, + "line": 260, "column": 41 }, "identifierName": "gltfBasePath" @@ -34474,15 +35718,15 @@ }, { "type": "ObjectProperty", - "start": 10884, - "end": 10900, + "start": 11125, + "end": 11141, "loc": { "start": { - "line": 250, + "line": 261, "column": 20 }, "end": { - "line": 250, + "line": 261, "column": 36 } }, @@ -34491,15 +35735,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10884, - "end": 10888, + "start": 11125, + "end": 11129, "loc": { "start": { - "line": 250, + "line": 261, "column": 20 }, "end": { - "line": 250, + "line": 261, "column": 24 }, "identifierName": "data" @@ -34508,15 +35752,15 @@ }, "value": { "type": "Identifier", - "start": 10890, - "end": 10900, + "start": 11131, + "end": 11141, "loc": { "start": { - "line": 250, + "line": 261, "column": 26 }, "end": { - "line": 250, + "line": 261, "column": 36 }, "identifierName": "sourceData" @@ -34526,15 +35770,15 @@ }, { "type": "ObjectProperty", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 } }, @@ -34543,15 +35787,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 }, "identifierName": "reuseGeometries" @@ -34560,15 +35804,15 @@ }, "value": { "type": "Identifier", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 }, "identifierName": "reuseGeometries" @@ -34581,15 +35825,15 @@ }, { "type": "ObjectProperty", - "start": 10959, - "end": 10980, + "start": 11200, + "end": 11221, "loc": { "start": { - "line": 252, + "line": 263, "column": 20 }, "end": { - "line": 252, + "line": 263, "column": 41 } }, @@ -34598,15 +35842,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 10959, - "end": 10974, + "start": 11200, + "end": 11215, "loc": { "start": { - "line": 252, + "line": 263, "column": 20 }, "end": { - "line": 252, + "line": 263, "column": 35 }, "identifierName": "includeTextures" @@ -34615,15 +35859,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 10976, - "end": 10980, + "start": 11217, + "end": 11221, "loc": { "start": { - "line": 252, + "line": 263, "column": 37 }, "end": { - "line": 252, + "line": 263, "column": 41 } }, @@ -34632,15 +35876,15 @@ }, { "type": "ObjectProperty", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 } }, @@ -34649,15 +35893,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 }, "identifierName": "includeNormals" @@ -34666,15 +35910,15 @@ }, "value": { "type": "Identifier", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 }, "identifierName": "includeNormals" @@ -34687,15 +35931,15 @@ }, { "type": "ObjectProperty", - "start": 11038, - "end": 11066, + "start": 11279, + "end": 11307, "loc": { "start": { - "line": 254, + "line": 265, "column": 20 }, "end": { - "line": 254, + "line": 265, "column": 48 } }, @@ -34704,15 +35948,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11038, - "end": 11051, + "start": 11279, + "end": 11292, "loc": { "start": { - "line": 254, + "line": 265, "column": 20 }, "end": { - "line": 254, + "line": 265, "column": 33 }, "identifierName": "metaModelData" @@ -34721,15 +35965,15 @@ }, "value": { "type": "Identifier", - "start": 11053, - "end": 11066, + "start": 11294, + "end": 11307, "loc": { "start": { - "line": 254, + "line": 265, "column": 35 }, "end": { - "line": 254, + "line": 265, "column": 48 }, "identifierName": "metaModelJSON" @@ -34739,15 +35983,15 @@ }, { "type": "ObjectProperty", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 } }, @@ -34756,15 +36000,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 }, "identifierName": "xktModel" @@ -34773,15 +36017,15 @@ }, "value": { "type": "Identifier", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 }, "identifierName": "xktModel" @@ -34794,15 +36038,15 @@ }, { "type": "ObjectProperty", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 } }, @@ -34811,15 +36055,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 }, "identifierName": "stats" @@ -34828,15 +36072,15 @@ }, "value": { "type": "Identifier", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 }, "identifierName": "stats" @@ -34849,15 +36093,15 @@ }, { "type": "ObjectProperty", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 } }, @@ -34866,15 +36110,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 }, "identifierName": "log" @@ -34883,15 +36127,15 @@ }, "value": { "type": "Identifier", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 }, "identifierName": "log" @@ -34909,15 +36153,15 @@ }, { "type": "BreakStatement", - "start": 11185, - "end": 11191, + "start": 11426, + "end": 11432, "loc": { "start": { - "line": 259, + "line": 270, "column": 16 }, "end": { - "line": 259, + "line": 270, "column": 22 } }, @@ -34928,15 +36172,15 @@ ], "test": { "type": "StringLiteral", - "start": 10635, - "end": 10641, + "start": 10876, + "end": 10882, "loc": { "start": { - "line": 245, + "line": 256, "column": 17 }, "end": { - "line": 245, + "line": 256, "column": 23 } }, @@ -34950,15 +36194,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -34966,15 +36210,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -34982,15 +36226,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -34998,15 +36242,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -35014,15 +36258,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -35030,15 +36274,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -35046,15 +36290,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -35062,15 +36306,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -35078,15 +36322,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -35094,15 +36338,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -35110,15 +36354,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -35126,15 +36370,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -35142,15 +36386,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -35158,15 +36402,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -35174,15 +36418,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -35190,15 +36434,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -35206,15 +36450,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -35222,15 +36466,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -35238,15 +36482,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -35254,15 +36498,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -35270,15 +36514,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -35286,15 +36530,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -35303,58 +36547,58 @@ }, { "type": "SwitchCase", - "start": 12216, - "end": 12569, + "start": 12457, + "end": 12810, "loc": { "start": { - "line": 284, + "line": 295, "column": 12 }, "end": { - "line": 295, + "line": 306, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 12244, - "end": 12546, + "start": 12485, + "end": 12787, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 294, + "line": 305, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 12244, - "end": 12545, + "start": 12485, + "end": 12786, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 294, + "line": 305, "column": 18 } }, "callee": { "type": "Identifier", - "start": 12244, - "end": 12251, + "start": 12485, + "end": 12492, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 285, + "line": 296, "column": 23 }, "identifierName": "convert" @@ -35364,15 +36608,15 @@ "arguments": [ { "type": "Identifier", - "start": 12252, - "end": 12272, + "start": 12493, + "end": 12513, "loc": { "start": { - "line": 285, + "line": 296, "column": 24 }, "end": { - "line": 285, + "line": 296, "column": 44 }, "identifierName": "parseIFCIntoXKTModel" @@ -35381,30 +36625,30 @@ }, { "type": "ObjectExpression", - "start": 12274, - "end": 12544, + "start": 12515, + "end": 12785, "loc": { "start": { - "line": 285, + "line": 296, "column": 46 }, "end": { - "line": 294, + "line": 305, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 } }, @@ -35413,15 +36657,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 }, "identifierName": "WebIFC" @@ -35430,15 +36674,15 @@ }, "value": { "type": "Identifier", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 }, "identifierName": "WebIFC" @@ -35451,15 +36695,15 @@ }, { "type": "ObjectProperty", - "start": 12324, - "end": 12340, + "start": 12565, + "end": 12581, "loc": { "start": { - "line": 287, + "line": 298, "column": 20 }, "end": { - "line": 287, + "line": 298, "column": 36 } }, @@ -35468,15 +36712,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12324, - "end": 12328, + "start": 12565, + "end": 12569, "loc": { "start": { - "line": 287, + "line": 298, "column": 20 }, "end": { - "line": 287, + "line": 298, "column": 24 }, "identifierName": "data" @@ -35485,15 +36729,15 @@ }, "value": { "type": "Identifier", - "start": 12330, - "end": 12340, + "start": 12571, + "end": 12581, "loc": { "start": { - "line": 287, + "line": 298, "column": 26 }, "end": { - "line": 287, + "line": 298, "column": 36 }, "identifierName": "sourceData" @@ -35503,15 +36747,15 @@ }, { "type": "ObjectProperty", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 } }, @@ -35520,15 +36764,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 }, "identifierName": "xktModel" @@ -35537,15 +36781,15 @@ }, "value": { "type": "Identifier", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 }, "identifierName": "xktModel" @@ -35558,15 +36802,15 @@ }, { "type": "ObjectProperty", - "start": 12392, - "end": 12406, + "start": 12633, + "end": 12647, "loc": { "start": { - "line": 289, + "line": 300, "column": 20 }, "end": { - "line": 289, + "line": 300, "column": 34 } }, @@ -35575,15 +36819,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12392, - "end": 12400, + "start": 12633, + "end": 12641, "loc": { "start": { - "line": 289, + "line": 300, "column": 20 }, "end": { - "line": 289, + "line": 300, "column": 28 }, "identifierName": "wasmPath" @@ -35592,15 +36836,15 @@ }, "value": { "type": "StringLiteral", - "start": 12402, - "end": 12406, + "start": 12643, + "end": 12647, "loc": { "start": { - "line": 289, + "line": 300, "column": 30 }, "end": { - "line": 289, + "line": 300, "column": 34 } }, @@ -35613,15 +36857,15 @@ }, { "type": "ObjectProperty", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 } }, @@ -35630,15 +36874,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 }, "identifierName": "includeTypes" @@ -35647,15 +36891,15 @@ }, "value": { "type": "Identifier", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 }, "identifierName": "includeTypes" @@ -35668,15 +36912,15 @@ }, { "type": "ObjectProperty", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 } }, @@ -35685,15 +36929,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 }, "identifierName": "excludeTypes" @@ -35702,15 +36946,15 @@ }, "value": { "type": "Identifier", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 }, "identifierName": "excludeTypes" @@ -35723,15 +36967,15 @@ }, { "type": "ObjectProperty", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 } }, @@ -35740,15 +36984,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 }, "identifierName": "stats" @@ -35757,15 +37001,15 @@ }, "value": { "type": "Identifier", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 }, "identifierName": "stats" @@ -35778,15 +37022,15 @@ }, { "type": "ObjectProperty", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 } }, @@ -35795,15 +37039,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 }, "identifierName": "log" @@ -35812,15 +37056,15 @@ }, "value": { "type": "Identifier", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 }, "identifierName": "log" @@ -35838,15 +37082,15 @@ }, { "type": "BreakStatement", - "start": 12563, - "end": 12569, + "start": 12804, + "end": 12810, "loc": { "start": { - "line": 295, + "line": 306, "column": 16 }, "end": { - "line": 295, + "line": 306, "column": 22 } }, @@ -35855,15 +37099,15 @@ ], "test": { "type": "StringLiteral", - "start": 12221, - "end": 12226, + "start": 12462, + "end": 12467, "loc": { "start": { - "line": 284, + "line": 295, "column": 17 }, "end": { - "line": 284, + "line": 295, "column": 22 } }, @@ -35878,15 +37122,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -35894,15 +37138,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -35910,15 +37154,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -35926,15 +37170,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -35942,15 +37186,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -35958,15 +37202,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -35974,15 +37218,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -35990,15 +37234,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -36006,15 +37250,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -36022,15 +37266,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -36038,15 +37282,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -36054,15 +37298,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -36070,15 +37314,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -36086,15 +37330,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -36102,15 +37346,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -36118,15 +37362,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -36134,15 +37378,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -36150,15 +37394,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -36166,15 +37410,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -36182,15 +37426,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -36198,15 +37442,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -36214,15 +37458,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -36231,58 +37475,58 @@ }, { "type": "SwitchCase", - "start": 12583, - "end": 13089, + "start": 12824, + "end": 13330, "loc": { "start": { - "line": 297, + "line": 308, "column": 12 }, "end": { - "line": 309, + "line": 320, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 12611, - "end": 13066, + "start": 12852, + "end": 13307, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 308, + "line": 319, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 12611, - "end": 13065, + "start": 12852, + "end": 13306, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 308, + "line": 319, "column": 18 } }, "callee": { "type": "Identifier", - "start": 12611, - "end": 12618, + "start": 12852, + "end": 12859, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 298, + "line": 309, "column": 23 }, "identifierName": "convert" @@ -36292,15 +37536,15 @@ "arguments": [ { "type": "Identifier", - "start": 12619, - "end": 12639, + "start": 12860, + "end": 12880, "loc": { "start": { - "line": 298, + "line": 309, "column": 24 }, "end": { - "line": 298, + "line": 309, "column": 44 }, "identifierName": "parseLASIntoXKTModel" @@ -36309,30 +37553,30 @@ }, { "type": "ObjectExpression", - "start": 12641, - "end": 13064, + "start": 12882, + "end": 13305, "loc": { "start": { - "line": 298, + "line": 309, "column": 46 }, "end": { - "line": 308, + "line": 319, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 12663, - "end": 12679, + "start": 12904, + "end": 12920, "loc": { "start": { - "line": 299, + "line": 310, "column": 20 }, "end": { - "line": 299, + "line": 310, "column": 36 } }, @@ -36341,15 +37585,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12663, - "end": 12667, + "start": 12904, + "end": 12908, "loc": { "start": { - "line": 299, + "line": 310, "column": 20 }, "end": { - "line": 299, + "line": 310, "column": 24 }, "identifierName": "data" @@ -36358,15 +37602,15 @@ }, "value": { "type": "Identifier", - "start": 12669, - "end": 12679, + "start": 12910, + "end": 12920, "loc": { "start": { - "line": 299, + "line": 310, "column": 26 }, "end": { - "line": 299, + "line": 310, "column": 36 }, "identifierName": "sourceData" @@ -36376,15 +37620,15 @@ }, { "type": "ObjectProperty", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 } }, @@ -36393,15 +37637,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 }, "identifierName": "xktModel" @@ -36410,15 +37654,15 @@ }, "value": { "type": "Identifier", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 }, "identifierName": "xktModel" @@ -36431,15 +37675,15 @@ }, { "type": "ObjectProperty", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 } }, @@ -36448,15 +37692,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 }, "identifierName": "stats" @@ -36465,15 +37709,15 @@ }, "value": { "type": "Identifier", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 }, "identifierName": "stats" @@ -36486,15 +37730,15 @@ }, { "type": "ObjectProperty", - "start": 12758, - "end": 12784, + "start": 12999, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 20 }, "end": { - "line": 302, + "line": 313, "column": 46 } }, @@ -36503,15 +37747,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12758, - "end": 12762, + "start": 12999, + "end": 13003, "loc": { "start": { - "line": 302, + "line": 313, "column": 20 }, "end": { - "line": 302, + "line": 313, "column": 24 }, "identifierName": "fp64" @@ -36520,29 +37764,29 @@ }, "value": { "type": "MemberExpression", - "start": 12764, - "end": 12784, + "start": 13005, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 26 }, "end": { - "line": 302, + "line": 313, "column": 46 } }, "object": { "type": "Identifier", - "start": 12764, - "end": 12779, + "start": 13005, + "end": 13020, "loc": { "start": { - "line": 302, + "line": 313, "column": 26 }, "end": { - "line": 302, + "line": 313, "column": 41 }, "identifierName": "fileTypeConfigs" @@ -36551,15 +37795,15 @@ }, "property": { "type": "Identifier", - "start": 12780, - "end": 12784, + "start": 13021, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 42 }, "end": { - "line": 302, + "line": 313, "column": 46 }, "identifierName": "fp64" @@ -36571,15 +37815,15 @@ }, { "type": "ObjectProperty", - "start": 12806, - "end": 12844, + "start": 13047, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 20 }, "end": { - "line": 303, + "line": 314, "column": 58 } }, @@ -36588,15 +37832,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12806, - "end": 12816, + "start": 13047, + "end": 13057, "loc": { "start": { - "line": 303, + "line": 314, "column": 20 }, "end": { - "line": 303, + "line": 314, "column": 30 }, "identifierName": "colorDepth" @@ -36605,29 +37849,29 @@ }, "value": { "type": "MemberExpression", - "start": 12818, - "end": 12844, + "start": 13059, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 32 }, "end": { - "line": 303, + "line": 314, "column": 58 } }, "object": { "type": "Identifier", - "start": 12818, - "end": 12833, + "start": 13059, + "end": 13074, "loc": { "start": { - "line": 303, + "line": 314, "column": 32 }, "end": { - "line": 303, + "line": 314, "column": 47 }, "identifierName": "fileTypeConfigs" @@ -36636,15 +37880,15 @@ }, "property": { "type": "Identifier", - "start": 12834, - "end": 12844, + "start": 13075, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 48 }, "end": { - "line": 303, + "line": 314, "column": 58 }, "identifierName": "colorDepth" @@ -36656,15 +37900,15 @@ }, { "type": "ObjectProperty", - "start": 12866, - "end": 12896, + "start": 13107, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 20 }, "end": { - "line": 304, + "line": 315, "column": 50 } }, @@ -36673,15 +37917,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12866, - "end": 12872, + "start": 13107, + "end": 13113, "loc": { "start": { - "line": 304, + "line": 315, "column": 20 }, "end": { - "line": 304, + "line": 315, "column": 26 }, "identifierName": "center" @@ -36690,29 +37934,29 @@ }, "value": { "type": "MemberExpression", - "start": 12874, - "end": 12896, + "start": 13115, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 28 }, "end": { - "line": 304, + "line": 315, "column": 50 } }, "object": { "type": "Identifier", - "start": 12874, - "end": 12889, + "start": 13115, + "end": 13130, "loc": { "start": { - "line": 304, + "line": 315, "column": 28 }, "end": { - "line": 304, + "line": 315, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -36721,15 +37965,15 @@ }, "property": { "type": "Identifier", - "start": 12890, - "end": 12896, + "start": 13131, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 44 }, "end": { - "line": 304, + "line": 315, "column": 50 }, "identifierName": "center" @@ -36741,15 +37985,15 @@ }, { "type": "ObjectProperty", - "start": 12918, - "end": 12954, + "start": 13159, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 20 }, "end": { - "line": 305, + "line": 316, "column": 56 } }, @@ -36758,15 +38002,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12918, - "end": 12927, + "start": 13159, + "end": 13168, "loc": { "start": { - "line": 305, + "line": 316, "column": 20 }, "end": { - "line": 305, + "line": 316, "column": 29 }, "identifierName": "transform" @@ -36775,29 +38019,29 @@ }, "value": { "type": "MemberExpression", - "start": 12929, - "end": 12954, + "start": 13170, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 31 }, "end": { - "line": 305, + "line": 316, "column": 56 } }, "object": { "type": "Identifier", - "start": 12929, - "end": 12944, + "start": 13170, + "end": 13185, "loc": { "start": { - "line": 305, + "line": 316, "column": 31 }, "end": { - "line": 305, + "line": 316, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -36806,15 +38050,15 @@ }, "property": { "type": "Identifier", - "start": 12945, - "end": 12954, + "start": 13186, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 47 }, "end": { - "line": 305, + "line": 316, "column": 56 }, "identifierName": "transform" @@ -36826,15 +38070,15 @@ }, { "type": "ObjectProperty", - "start": 12976, - "end": 13021, + "start": 13217, + "end": 13262, "loc": { "start": { - "line": 306, + "line": 317, "column": 20 }, "end": { - "line": 306, + "line": 317, "column": 65 } }, @@ -36843,15 +38087,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 12976, - "end": 12980, + "start": 13217, + "end": 13221, "loc": { "start": { - "line": 306, + "line": 317, "column": 20 }, "end": { - "line": 306, + "line": 317, "column": 24 }, "identifierName": "skip" @@ -36860,29 +38104,29 @@ }, "value": { "type": "CallExpression", - "start": 12982, - "end": 13021, + "start": 13223, + "end": 13262, "loc": { "start": { - "line": 306, + "line": 317, "column": 26 }, "end": { - "line": 306, + "line": 317, "column": 65 } }, "callee": { "type": "Identifier", - "start": 12982, - "end": 12996, + "start": 13223, + "end": 13237, "loc": { "start": { - "line": 306, + "line": 317, "column": 26 }, "end": { - "line": 306, + "line": 317, "column": 40 }, "identifierName": "overrideOption" @@ -36892,29 +38136,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 12997, - "end": 13017, + "start": 13238, + "end": 13258, "loc": { "start": { - "line": 306, + "line": 317, "column": 41 }, "end": { - "line": 306, + "line": 317, "column": 61 } }, "object": { "type": "Identifier", - "start": 12997, - "end": 13012, + "start": 13238, + "end": 13253, "loc": { "start": { - "line": 306, + "line": 317, "column": 41 }, "end": { - "line": 306, + "line": 317, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -36923,15 +38167,15 @@ }, "property": { "type": "Identifier", - "start": 13013, - "end": 13017, + "start": 13254, + "end": 13258, "loc": { "start": { - "line": 306, + "line": 317, "column": 57 }, "end": { - "line": 306, + "line": 317, "column": 61 }, "identifierName": "skip" @@ -36942,15 +38186,15 @@ }, { "type": "NumericLiteral", - "start": 13019, - "end": 13020, + "start": 13260, + "end": 13261, "loc": { "start": { - "line": 306, + "line": 317, "column": 63 }, "end": { - "line": 306, + "line": 317, "column": 64 } }, @@ -36965,15 +38209,15 @@ }, { "type": "ObjectProperty", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 } }, @@ -36982,15 +38226,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 }, "identifierName": "log" @@ -36999,15 +38243,15 @@ }, "value": { "type": "Identifier", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 }, "identifierName": "log" @@ -37025,15 +38269,15 @@ }, { "type": "BreakStatement", - "start": 13083, - "end": 13089, + "start": 13324, + "end": 13330, "loc": { "start": { - "line": 309, + "line": 320, "column": 16 }, "end": { - "line": 309, + "line": 320, "column": 22 } }, @@ -37042,15 +38286,15 @@ ], "test": { "type": "StringLiteral", - "start": 12588, - "end": 12593, + "start": 12829, + "end": 12834, "loc": { "start": { - "line": 297, + "line": 308, "column": 17 }, "end": { - "line": 297, + "line": 308, "column": 22 } }, @@ -37063,58 +38307,58 @@ }, { "type": "SwitchCase", - "start": 13103, - "end": 13609, + "start": 13344, + "end": 13850, "loc": { "start": { - "line": 311, + "line": 322, "column": 12 }, "end": { - "line": 323, + "line": 334, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13131, - "end": 13586, + "start": 13372, + "end": 13827, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 322, + "line": 333, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13131, - "end": 13585, + "start": 13372, + "end": 13826, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 322, + "line": 333, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13131, - "end": 13138, + "start": 13372, + "end": 13379, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 312, + "line": 323, "column": 23 }, "identifierName": "convert" @@ -37124,15 +38368,15 @@ "arguments": [ { "type": "Identifier", - "start": 13139, - "end": 13159, + "start": 13380, + "end": 13400, "loc": { "start": { - "line": 312, + "line": 323, "column": 24 }, "end": { - "line": 312, + "line": 323, "column": 44 }, "identifierName": "parseLASIntoXKTModel" @@ -37141,30 +38385,30 @@ }, { "type": "ObjectExpression", - "start": 13161, - "end": 13584, + "start": 13402, + "end": 13825, "loc": { "start": { - "line": 312, + "line": 323, "column": 46 }, "end": { - "line": 322, + "line": 333, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13183, - "end": 13199, + "start": 13424, + "end": 13440, "loc": { "start": { - "line": 313, + "line": 324, "column": 20 }, "end": { - "line": 313, + "line": 324, "column": 36 } }, @@ -37173,15 +38417,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13183, - "end": 13187, + "start": 13424, + "end": 13428, "loc": { "start": { - "line": 313, + "line": 324, "column": 20 }, "end": { - "line": 313, + "line": 324, "column": 24 }, "identifierName": "data" @@ -37190,15 +38434,15 @@ }, "value": { "type": "Identifier", - "start": 13189, - "end": 13199, + "start": 13430, + "end": 13440, "loc": { "start": { - "line": 313, + "line": 324, "column": 26 }, "end": { - "line": 313, + "line": 324, "column": 36 }, "identifierName": "sourceData" @@ -37208,15 +38452,15 @@ }, { "type": "ObjectProperty", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 } }, @@ -37225,15 +38469,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 }, "identifierName": "xktModel" @@ -37242,15 +38486,15 @@ }, "value": { "type": "Identifier", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 }, "identifierName": "xktModel" @@ -37263,15 +38507,15 @@ }, { "type": "ObjectProperty", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 } }, @@ -37280,15 +38524,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 }, "identifierName": "stats" @@ -37297,15 +38541,15 @@ }, "value": { "type": "Identifier", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 }, "identifierName": "stats" @@ -37318,15 +38562,15 @@ }, { "type": "ObjectProperty", - "start": 13278, - "end": 13304, + "start": 13519, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 20 }, "end": { - "line": 316, + "line": 327, "column": 46 } }, @@ -37335,15 +38579,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13278, - "end": 13282, + "start": 13519, + "end": 13523, "loc": { "start": { - "line": 316, + "line": 327, "column": 20 }, "end": { - "line": 316, + "line": 327, "column": 24 }, "identifierName": "fp64" @@ -37352,29 +38596,29 @@ }, "value": { "type": "MemberExpression", - "start": 13284, - "end": 13304, + "start": 13525, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 26 }, "end": { - "line": 316, + "line": 327, "column": 46 } }, "object": { "type": "Identifier", - "start": 13284, - "end": 13299, + "start": 13525, + "end": 13540, "loc": { "start": { - "line": 316, + "line": 327, "column": 26 }, "end": { - "line": 316, + "line": 327, "column": 41 }, "identifierName": "fileTypeConfigs" @@ -37383,15 +38627,15 @@ }, "property": { "type": "Identifier", - "start": 13300, - "end": 13304, + "start": 13541, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 42 }, "end": { - "line": 316, + "line": 327, "column": 46 }, "identifierName": "fp64" @@ -37403,15 +38647,15 @@ }, { "type": "ObjectProperty", - "start": 13326, - "end": 13364, + "start": 13567, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 20 }, "end": { - "line": 317, + "line": 328, "column": 58 } }, @@ -37420,15 +38664,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13326, - "end": 13336, + "start": 13567, + "end": 13577, "loc": { "start": { - "line": 317, + "line": 328, "column": 20 }, "end": { - "line": 317, + "line": 328, "column": 30 }, "identifierName": "colorDepth" @@ -37437,29 +38681,29 @@ }, "value": { "type": "MemberExpression", - "start": 13338, - "end": 13364, + "start": 13579, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 32 }, "end": { - "line": 317, + "line": 328, "column": 58 } }, "object": { "type": "Identifier", - "start": 13338, - "end": 13353, + "start": 13579, + "end": 13594, "loc": { "start": { - "line": 317, + "line": 328, "column": 32 }, "end": { - "line": 317, + "line": 328, "column": 47 }, "identifierName": "fileTypeConfigs" @@ -37468,15 +38712,15 @@ }, "property": { "type": "Identifier", - "start": 13354, - "end": 13364, + "start": 13595, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 48 }, "end": { - "line": 317, + "line": 328, "column": 58 }, "identifierName": "colorDepth" @@ -37488,15 +38732,15 @@ }, { "type": "ObjectProperty", - "start": 13386, - "end": 13416, + "start": 13627, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 20 }, "end": { - "line": 318, + "line": 329, "column": 50 } }, @@ -37505,15 +38749,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13386, - "end": 13392, + "start": 13627, + "end": 13633, "loc": { "start": { - "line": 318, + "line": 329, "column": 20 }, "end": { - "line": 318, + "line": 329, "column": 26 }, "identifierName": "center" @@ -37522,29 +38766,29 @@ }, "value": { "type": "MemberExpression", - "start": 13394, - "end": 13416, + "start": 13635, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 28 }, "end": { - "line": 318, + "line": 329, "column": 50 } }, "object": { "type": "Identifier", - "start": 13394, - "end": 13409, + "start": 13635, + "end": 13650, "loc": { "start": { - "line": 318, + "line": 329, "column": 28 }, "end": { - "line": 318, + "line": 329, "column": 43 }, "identifierName": "fileTypeConfigs" @@ -37553,15 +38797,15 @@ }, "property": { "type": "Identifier", - "start": 13410, - "end": 13416, + "start": 13651, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 44 }, "end": { - "line": 318, + "line": 329, "column": 50 }, "identifierName": "center" @@ -37573,15 +38817,15 @@ }, { "type": "ObjectProperty", - "start": 13438, - "end": 13474, + "start": 13679, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 20 }, "end": { - "line": 319, + "line": 330, "column": 56 } }, @@ -37590,15 +38834,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13438, - "end": 13447, + "start": 13679, + "end": 13688, "loc": { "start": { - "line": 319, + "line": 330, "column": 20 }, "end": { - "line": 319, + "line": 330, "column": 29 }, "identifierName": "transform" @@ -37607,29 +38851,29 @@ }, "value": { "type": "MemberExpression", - "start": 13449, - "end": 13474, + "start": 13690, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 31 }, "end": { - "line": 319, + "line": 330, "column": 56 } }, "object": { "type": "Identifier", - "start": 13449, - "end": 13464, + "start": 13690, + "end": 13705, "loc": { "start": { - "line": 319, + "line": 330, "column": 31 }, "end": { - "line": 319, + "line": 330, "column": 46 }, "identifierName": "fileTypeConfigs" @@ -37638,15 +38882,15 @@ }, "property": { "type": "Identifier", - "start": 13465, - "end": 13474, + "start": 13706, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 47 }, "end": { - "line": 319, + "line": 330, "column": 56 }, "identifierName": "transform" @@ -37658,15 +38902,15 @@ }, { "type": "ObjectProperty", - "start": 13496, - "end": 13541, + "start": 13737, + "end": 13782, "loc": { "start": { - "line": 320, + "line": 331, "column": 20 }, "end": { - "line": 320, + "line": 331, "column": 65 } }, @@ -37675,15 +38919,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13496, - "end": 13500, + "start": 13737, + "end": 13741, "loc": { "start": { - "line": 320, + "line": 331, "column": 20 }, "end": { - "line": 320, + "line": 331, "column": 24 }, "identifierName": "skip" @@ -37692,29 +38936,29 @@ }, "value": { "type": "CallExpression", - "start": 13502, - "end": 13541, + "start": 13743, + "end": 13782, "loc": { "start": { - "line": 320, + "line": 331, "column": 26 }, "end": { - "line": 320, + "line": 331, "column": 65 } }, "callee": { "type": "Identifier", - "start": 13502, - "end": 13516, + "start": 13743, + "end": 13757, "loc": { "start": { - "line": 320, + "line": 331, "column": 26 }, "end": { - "line": 320, + "line": 331, "column": 40 }, "identifierName": "overrideOption" @@ -37724,29 +38968,29 @@ "arguments": [ { "type": "MemberExpression", - "start": 13517, - "end": 13537, + "start": 13758, + "end": 13778, "loc": { "start": { - "line": 320, + "line": 331, "column": 41 }, "end": { - "line": 320, + "line": 331, "column": 61 } }, "object": { "type": "Identifier", - "start": 13517, - "end": 13532, + "start": 13758, + "end": 13773, "loc": { "start": { - "line": 320, + "line": 331, "column": 41 }, "end": { - "line": 320, + "line": 331, "column": 56 }, "identifierName": "fileTypeConfigs" @@ -37755,15 +38999,15 @@ }, "property": { "type": "Identifier", - "start": 13533, - "end": 13537, + "start": 13774, + "end": 13778, "loc": { "start": { - "line": 320, + "line": 331, "column": 57 }, "end": { - "line": 320, + "line": 331, "column": 61 }, "identifierName": "skip" @@ -37774,15 +39018,15 @@ }, { "type": "NumericLiteral", - "start": 13539, - "end": 13540, + "start": 13780, + "end": 13781, "loc": { "start": { - "line": 320, + "line": 331, "column": 63 }, "end": { - "line": 320, + "line": 331, "column": 64 } }, @@ -37797,15 +39041,15 @@ }, { "type": "ObjectProperty", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 } }, @@ -37814,15 +39058,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 }, "identifierName": "log" @@ -37831,15 +39075,15 @@ }, "value": { "type": "Identifier", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 }, "identifierName": "log" @@ -37857,15 +39101,15 @@ }, { "type": "BreakStatement", - "start": 13603, - "end": 13609, + "start": 13844, + "end": 13850, "loc": { "start": { - "line": 323, + "line": 334, "column": 16 }, "end": { - "line": 323, + "line": 334, "column": 22 } }, @@ -37874,15 +39118,15 @@ ], "test": { "type": "StringLiteral", - "start": 13108, - "end": 13113, + "start": 13349, + "end": 13354, "loc": { "start": { - "line": 311, + "line": 322, "column": 17 }, "end": { - "line": 311, + "line": 322, "column": 22 } }, @@ -37895,58 +39139,58 @@ }, { "type": "SwitchCase", - "start": 13623, - "end": 13844, + "start": 13864, + "end": 14085, "loc": { "start": { - "line": 325, + "line": 336, "column": 12 }, "end": { - "line": 332, + "line": 343, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13651, - "end": 13821, + "start": 13892, + "end": 14062, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 331, + "line": 342, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13651, - "end": 13820, + "start": 13892, + "end": 14061, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 331, + "line": 342, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13651, - "end": 13658, + "start": 13892, + "end": 13899, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 326, + "line": 337, "column": 23 }, "identifierName": "convert" @@ -37956,15 +39200,15 @@ "arguments": [ { "type": "Identifier", - "start": 13659, - "end": 13679, + "start": 13900, + "end": 13920, "loc": { "start": { - "line": 326, + "line": 337, "column": 24 }, "end": { - "line": 326, + "line": 337, "column": 44 }, "identifierName": "parsePCDIntoXKTModel" @@ -37973,30 +39217,30 @@ }, { "type": "ObjectExpression", - "start": 13681, - "end": 13819, + "start": 13922, + "end": 14060, "loc": { "start": { - "line": 326, + "line": 337, "column": 46 }, "end": { - "line": 331, + "line": 342, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13703, - "end": 13719, + "start": 13944, + "end": 13960, "loc": { "start": { - "line": 327, + "line": 338, "column": 20 }, "end": { - "line": 327, + "line": 338, "column": 36 } }, @@ -38005,15 +39249,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13703, - "end": 13707, + "start": 13944, + "end": 13948, "loc": { "start": { - "line": 327, + "line": 338, "column": 20 }, "end": { - "line": 327, + "line": 338, "column": 24 }, "identifierName": "data" @@ -38022,15 +39266,15 @@ }, "value": { "type": "Identifier", - "start": 13709, - "end": 13719, + "start": 13950, + "end": 13960, "loc": { "start": { - "line": 327, + "line": 338, "column": 26 }, "end": { - "line": 327, + "line": 338, "column": 36 }, "identifierName": "sourceData" @@ -38040,15 +39284,15 @@ }, { "type": "ObjectProperty", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 } }, @@ -38057,15 +39301,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 }, "identifierName": "xktModel" @@ -38074,15 +39318,15 @@ }, "value": { "type": "Identifier", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 }, "identifierName": "xktModel" @@ -38095,15 +39339,15 @@ }, { "type": "ObjectProperty", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 } }, @@ -38112,15 +39356,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 }, "identifierName": "stats" @@ -38129,15 +39373,15 @@ }, "value": { "type": "Identifier", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 }, "identifierName": "stats" @@ -38150,15 +39394,15 @@ }, { "type": "ObjectProperty", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 } }, @@ -38167,15 +39411,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 }, "identifierName": "log" @@ -38184,15 +39428,15 @@ }, "value": { "type": "Identifier", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 }, "identifierName": "log" @@ -38210,15 +39454,15 @@ }, { "type": "BreakStatement", - "start": 13838, - "end": 13844, + "start": 14079, + "end": 14085, "loc": { "start": { - "line": 332, + "line": 343, "column": 16 }, "end": { - "line": 332, + "line": 343, "column": 22 } }, @@ -38227,15 +39471,15 @@ ], "test": { "type": "StringLiteral", - "start": 13628, - "end": 13633, + "start": 13869, + "end": 13874, "loc": { "start": { - "line": 325, + "line": 336, "column": 17 }, "end": { - "line": 325, + "line": 336, "column": 22 } }, @@ -38248,58 +39492,58 @@ }, { "type": "SwitchCase", - "start": 13858, - "end": 14079, + "start": 14099, + "end": 14320, "loc": { "start": { - "line": 334, + "line": 345, "column": 12 }, "end": { - "line": 341, + "line": 352, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 13886, - "end": 14056, + "start": 14127, + "end": 14297, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 340, + "line": 351, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 13886, - "end": 14055, + "start": 14127, + "end": 14296, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 340, + "line": 351, "column": 18 } }, "callee": { "type": "Identifier", - "start": 13886, - "end": 13893, + "start": 14127, + "end": 14134, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 335, + "line": 346, "column": 23 }, "identifierName": "convert" @@ -38309,15 +39553,15 @@ "arguments": [ { "type": "Identifier", - "start": 13894, - "end": 13914, + "start": 14135, + "end": 14155, "loc": { "start": { - "line": 335, + "line": 346, "column": 24 }, "end": { - "line": 335, + "line": 346, "column": 44 }, "identifierName": "parsePLYIntoXKTModel" @@ -38326,30 +39570,30 @@ }, { "type": "ObjectExpression", - "start": 13916, - "end": 14054, + "start": 14157, + "end": 14295, "loc": { "start": { - "line": 335, + "line": 346, "column": 46 }, "end": { - "line": 340, + "line": 351, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 13938, - "end": 13954, + "start": 14179, + "end": 14195, "loc": { "start": { - "line": 336, + "line": 347, "column": 20 }, "end": { - "line": 336, + "line": 347, "column": 36 } }, @@ -38358,15 +39602,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13938, - "end": 13942, + "start": 14179, + "end": 14183, "loc": { "start": { - "line": 336, + "line": 347, "column": 20 }, "end": { - "line": 336, + "line": 347, "column": 24 }, "identifierName": "data" @@ -38375,15 +39619,15 @@ }, "value": { "type": "Identifier", - "start": 13944, - "end": 13954, + "start": 14185, + "end": 14195, "loc": { "start": { - "line": 336, + "line": 347, "column": 26 }, "end": { - "line": 336, + "line": 347, "column": 36 }, "identifierName": "sourceData" @@ -38393,15 +39637,15 @@ }, { "type": "ObjectProperty", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 } }, @@ -38410,15 +39654,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 }, "identifierName": "xktModel" @@ -38427,15 +39671,15 @@ }, "value": { "type": "Identifier", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 }, "identifierName": "xktModel" @@ -38448,15 +39692,15 @@ }, { "type": "ObjectProperty", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 } }, @@ -38465,15 +39709,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 }, "identifierName": "stats" @@ -38482,15 +39726,15 @@ }, "value": { "type": "Identifier", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 }, "identifierName": "stats" @@ -38503,15 +39747,15 @@ }, { "type": "ObjectProperty", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 } }, @@ -38520,15 +39764,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 }, "identifierName": "log" @@ -38537,15 +39781,15 @@ }, "value": { "type": "Identifier", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 }, "identifierName": "log" @@ -38563,15 +39807,15 @@ }, { "type": "BreakStatement", - "start": 14073, - "end": 14079, + "start": 14314, + "end": 14320, "loc": { "start": { - "line": 341, + "line": 352, "column": 16 }, "end": { - "line": 341, + "line": 352, "column": 22 } }, @@ -38580,15 +39824,15 @@ ], "test": { "type": "StringLiteral", - "start": 13863, - "end": 13868, + "start": 14104, + "end": 14109, "loc": { "start": { - "line": 334, + "line": 345, "column": 17 }, "end": { - "line": 334, + "line": 345, "column": 22 } }, @@ -38601,58 +39845,58 @@ }, { "type": "SwitchCase", - "start": 14093, - "end": 14314, + "start": 14334, + "end": 14555, "loc": { "start": { - "line": 343, + "line": 354, "column": 12 }, "end": { - "line": 350, + "line": 361, "column": 22 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 14121, - "end": 14291, + "start": 14362, + "end": 14532, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 349, + "line": 360, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 14121, - "end": 14290, + "start": 14362, + "end": 14531, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 349, + "line": 360, "column": 18 } }, "callee": { "type": "Identifier", - "start": 14121, - "end": 14128, + "start": 14362, + "end": 14369, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 344, + "line": 355, "column": 23 }, "identifierName": "convert" @@ -38662,15 +39906,15 @@ "arguments": [ { "type": "Identifier", - "start": 14129, - "end": 14149, + "start": 14370, + "end": 14390, "loc": { "start": { - "line": 344, + "line": 355, "column": 24 }, "end": { - "line": 344, + "line": 355, "column": 44 }, "identifierName": "parseSTLIntoXKTModel" @@ -38679,30 +39923,30 @@ }, { "type": "ObjectExpression", - "start": 14151, - "end": 14289, + "start": 14392, + "end": 14530, "loc": { "start": { - "line": 344, + "line": 355, "column": 46 }, "end": { - "line": 349, + "line": 360, "column": 17 } }, "properties": [ { "type": "ObjectProperty", - "start": 14173, - "end": 14189, + "start": 14414, + "end": 14430, "loc": { "start": { - "line": 345, + "line": 356, "column": 20 }, "end": { - "line": 345, + "line": 356, "column": 36 } }, @@ -38711,15 +39955,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14173, - "end": 14177, + "start": 14414, + "end": 14418, "loc": { "start": { - "line": 345, + "line": 356, "column": 20 }, "end": { - "line": 345, + "line": 356, "column": 24 }, "identifierName": "data" @@ -38728,15 +39972,15 @@ }, "value": { "type": "Identifier", - "start": 14179, - "end": 14189, + "start": 14420, + "end": 14430, "loc": { "start": { - "line": 345, + "line": 356, "column": 26 }, "end": { - "line": 345, + "line": 356, "column": 36 }, "identifierName": "sourceData" @@ -38746,15 +39990,15 @@ }, { "type": "ObjectProperty", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 } }, @@ -38763,15 +40007,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 }, "identifierName": "xktModel" @@ -38780,15 +40024,15 @@ }, "value": { "type": "Identifier", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 }, "identifierName": "xktModel" @@ -38801,15 +40045,15 @@ }, { "type": "ObjectProperty", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 } }, @@ -38818,15 +40062,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 }, "identifierName": "stats" @@ -38835,15 +40079,15 @@ }, "value": { "type": "Identifier", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 }, "identifierName": "stats" @@ -38856,15 +40100,15 @@ }, { "type": "ObjectProperty", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 } }, @@ -38873,15 +40117,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 }, "identifierName": "log" @@ -38890,15 +40134,15 @@ }, "value": { "type": "Identifier", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 }, "identifierName": "log" @@ -38916,15 +40160,15 @@ }, { "type": "BreakStatement", - "start": 14308, - "end": 14314, + "start": 14549, + "end": 14555, "loc": { "start": { - "line": 350, + "line": 361, "column": 16 }, "end": { - "line": 350, + "line": 361, "column": 22 } }, @@ -38933,15 +40177,15 @@ ], "test": { "type": "StringLiteral", - "start": 14098, - "end": 14103, + "start": 14339, + "end": 14344, "loc": { "start": { - "line": 343, + "line": 354, "column": 17 }, "end": { - "line": 343, + "line": 354, "column": 22 } }, @@ -38954,58 +40198,58 @@ }, { "type": "SwitchCase", - "start": 14328, - "end": 14431, + "start": 14569, + "end": 14672, "loc": { "start": { - "line": 352, + "line": 363, "column": 12 }, "end": { - "line": 354, + "line": 365, "column": 23 } }, "consequent": [ { "type": "ExpressionStatement", - "start": 14353, - "end": 14407, + "start": 14594, + "end": 14648, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 14353, - "end": 14406, + "start": 14594, + "end": 14647, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 69 } }, "callee": { "type": "Identifier", - "start": 14353, - "end": 14359, + "start": 14594, + "end": 14600, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 22 }, "identifierName": "reject" @@ -39015,30 +40259,30 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 14360, - "end": 14405, + "start": 14601, + "end": 14646, "loc": { "start": { - "line": 353, + "line": 364, "column": 23 }, "end": { - "line": 353, + "line": 364, "column": 68 } }, "expressions": [ { "type": "Identifier", - "start": 14398, - "end": 14401, + "start": 14639, + "end": 14642, "loc": { "start": { - "line": 353, + "line": 364, "column": 61 }, "end": { - "line": 353, + "line": 364, "column": 64 }, "identifierName": "ext" @@ -39049,15 +40293,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 14361, - "end": 14396, + "start": 14602, + "end": 14637, "loc": { "start": { - "line": 353, + "line": 364, "column": 24 }, "end": { - "line": 353, + "line": 364, "column": 59 } }, @@ -39069,15 +40313,15 @@ }, { "type": "TemplateElement", - "start": 14402, - "end": 14404, + "start": 14643, + "end": 14645, "loc": { "start": { - "line": 353, + "line": 364, "column": 65 }, "end": { - "line": 353, + "line": 364, "column": 67 } }, @@ -39094,15 +40338,15 @@ }, { "type": "ReturnStatement", - "start": 14424, - "end": 14431, + "start": 14665, + "end": 14672, "loc": { "start": { - "line": 354, + "line": 365, "column": 16 }, "end": { - "line": 354, + "line": 365, "column": 23 } }, @@ -39115,29 +40359,29 @@ }, { "type": "FunctionDeclaration", - "start": 14451, - "end": 18120, + "start": 14692, + "end": 18361, "loc": { "start": { - "line": 357, + "line": 368, "column": 8 }, "end": { - "line": 435, + "line": 446, "column": 9 } }, "id": { "type": "Identifier", - "start": 14460, - "end": 14467, + "start": 14701, + "end": 14708, "loc": { "start": { - "line": 357, + "line": 368, "column": 17 }, "end": { - "line": 357, + "line": 368, "column": 24 }, "identifierName": "convert" @@ -39150,15 +40394,15 @@ "params": [ { "type": "Identifier", - "start": 14468, - "end": 14474, + "start": 14709, + "end": 14715, "loc": { "start": { - "line": 357, + "line": 368, "column": 25 }, "end": { - "line": 357, + "line": 368, "column": 31 }, "identifierName": "parser" @@ -39167,15 +40411,15 @@ }, { "type": "Identifier", - "start": 14476, - "end": 14491, + "start": 14717, + "end": 14732, "loc": { "start": { - "line": 357, + "line": 368, "column": 33 }, "end": { - "line": 357, + "line": 368, "column": 48 }, "identifierName": "converterParams" @@ -39185,86 +40429,86 @@ ], "body": { "type": "BlockStatement", - "start": 14493, - "end": 18120, + "start": 14734, + "end": 18361, "loc": { "start": { - "line": 357, + "line": 368, "column": 50 }, "end": { - "line": 435, + "line": 446, "column": 9 } }, "body": [ { "type": "ExpressionStatement", - "start": 14508, - "end": 18110, + "start": 14749, + "end": 18351, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 434, + "line": 445, "column": 15 } }, "expression": { "type": "CallExpression", - "start": 14508, - "end": 18109, + "start": 14749, + "end": 18350, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 434, + "line": 445, "column": 14 } }, "callee": { "type": "MemberExpression", - "start": 14508, - "end": 14536, + "start": 14749, + "end": 14777, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 40 } }, "object": { "type": "CallExpression", - "start": 14508, - "end": 14531, + "start": 14749, + "end": 14772, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 35 } }, "callee": { "type": "Identifier", - "start": 14508, - "end": 14514, + "start": 14749, + "end": 14755, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 18 }, "identifierName": "parser" @@ -39274,15 +40518,15 @@ "arguments": [ { "type": "Identifier", - "start": 14515, - "end": 14530, + "start": 14756, + "end": 14771, "loc": { "start": { - "line": 359, + "line": 370, "column": 19 }, "end": { - "line": 359, + "line": 370, "column": 34 }, "identifierName": "converterParams" @@ -39293,15 +40537,15 @@ }, "property": { "type": "Identifier", - "start": 14532, - "end": 14536, + "start": 14773, + "end": 14777, "loc": { "start": { - "line": 359, + "line": 370, "column": 36 }, "end": { - "line": 359, + "line": 370, "column": 40 }, "identifierName": "then" @@ -39313,15 +40557,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 14537, - "end": 18053, + "start": 14778, + "end": 18294, "loc": { "start": { - "line": 359, + "line": 370, "column": 41 }, "end": { - "line": 432, + "line": 443, "column": 13 } }, @@ -39332,44 +40576,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14543, - "end": 18053, + "start": 14784, + "end": 18294, "loc": { "start": { - "line": 359, + "line": 370, "column": 47 }, "end": { - "line": 432, + "line": 443, "column": 13 } }, "body": [ { "type": "IfStatement", - "start": 14562, - "end": 14720, + "start": 14803, + "end": 14961, "loc": { "start": { - "line": 361, + "line": 372, "column": 16 }, "end": { - "line": 364, + "line": 375, "column": 17 } }, "test": { "type": "UnaryExpression", - "start": 14566, - "end": 14580, + "start": 14807, + "end": 14821, "loc": { "start": { - "line": 361, + "line": 372, "column": 20 }, "end": { - "line": 361, + "line": 372, "column": 34 } }, @@ -39377,15 +40621,15 @@ "prefix": true, "argument": { "type": "Identifier", - "start": 14567, - "end": 14580, + "start": 14808, + "end": 14821, "loc": { "start": { - "line": 361, + "line": 372, "column": 21 }, "end": { - "line": 361, + "line": 372, "column": 34 }, "identifierName": "metaModelJSON" @@ -39398,58 +40642,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 14582, - "end": 14720, + "start": 14823, + "end": 14961, "loc": { "start": { - "line": 361, + "line": 372, "column": 36 }, "end": { - "line": 364, + "line": 375, "column": 17 } }, "body": [ { "type": "ExpressionStatement", - "start": 14604, - "end": 14645, + "start": 14845, + "end": 14886, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 14604, - "end": 14644, + "start": 14845, + "end": 14885, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 60 } }, "callee": { "type": "Identifier", - "start": 14604, - "end": 14607, + "start": 14845, + "end": 14848, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 23 }, "identifierName": "log" @@ -39459,15 +40703,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14608, - "end": 14643, + "start": 14849, + "end": 14884, "loc": { "start": { - "line": 362, + "line": 373, "column": 24 }, "end": { - "line": 362, + "line": 373, "column": 59 } }, @@ -39482,57 +40726,57 @@ }, { "type": "ExpressionStatement", - "start": 14666, - "end": 14702, + "start": 14907, + "end": 14943, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 56 } }, "expression": { "type": "CallExpression", - "start": 14666, - "end": 14701, + "start": 14907, + "end": 14942, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 55 } }, "callee": { "type": "MemberExpression", - "start": 14666, - "end": 14699, + "start": 14907, + "end": 14940, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 53 } }, "object": { "type": "Identifier", - "start": 14666, - "end": 14674, + "start": 14907, + "end": 14915, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 28 }, "identifierName": "xktModel" @@ -39541,15 +40785,15 @@ }, "property": { "type": "Identifier", - "start": 14675, - "end": 14699, + "start": 14916, + "end": 14940, "loc": { "start": { - "line": 363, + "line": 374, "column": 29 }, "end": { - "line": 363, + "line": 374, "column": 53 }, "identifierName": "createDefaultMetaObjects" @@ -39568,43 +40812,43 @@ }, { "type": "ExpressionStatement", - "start": 14738, - "end": 14792, + "start": 14979, + "end": 15033, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 14738, - "end": 14791, + "start": 14979, + "end": 15032, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 69 } }, "callee": { "type": "Identifier", - "start": 14738, - "end": 14741, + "start": 14979, + "end": 14982, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 19 }, "identifierName": "log" @@ -39614,15 +40858,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14742, - "end": 14790, + "start": 14983, + "end": 15031, "loc": { "start": { - "line": 366, + "line": 377, "column": 20 }, "end": { - "line": 366, + "line": 377, "column": 68 } }, @@ -39637,85 +40881,85 @@ }, { "type": "ExpressionStatement", - "start": 14810, - "end": 18039, + "start": 15051, + "end": 18280, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 431, + "line": 442, "column": 19 } }, "expression": { "type": "CallExpression", - "start": 14810, - "end": 18038, + "start": 15051, + "end": 18279, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 431, + "line": 442, "column": 18 } }, "callee": { "type": "MemberExpression", - "start": 14810, - "end": 14834, + "start": 15051, + "end": 15075, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 40 } }, "object": { "type": "CallExpression", - "start": 14810, - "end": 14829, + "start": 15051, + "end": 15070, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 35 } }, "callee": { "type": "MemberExpression", - "start": 14810, - "end": 14827, + "start": 15051, + "end": 15068, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 33 } }, "object": { "type": "Identifier", - "start": 14810, - "end": 14818, + "start": 15051, + "end": 15059, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 24 }, "identifierName": "xktModel" @@ -39724,15 +40968,15 @@ }, "property": { "type": "Identifier", - "start": 14819, - "end": 14827, + "start": 15060, + "end": 15068, "loc": { "start": { - "line": 368, + "line": 379, "column": 25 }, "end": { - "line": 368, + "line": 379, "column": 33 }, "identifierName": "finalize" @@ -39745,15 +40989,15 @@ }, "property": { "type": "Identifier", - "start": 14830, - "end": 14834, + "start": 15071, + "end": 15075, "loc": { "start": { - "line": 368, + "line": 379, "column": 36 }, "end": { - "line": 368, + "line": 379, "column": 40 }, "identifierName": "then" @@ -39765,15 +41009,15 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 14835, - "end": 18037, + "start": 15076, + "end": 18278, "loc": { "start": { - "line": 368, + "line": 379, "column": 41 }, "end": { - "line": 431, + "line": 442, "column": 17 } }, @@ -39784,58 +41028,58 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14841, - "end": 18037, + "start": 15082, + "end": 18278, "loc": { "start": { - "line": 368, + "line": 379, "column": 47 }, "end": { - "line": 431, + "line": 442, "column": 17 } }, "body": [ { "type": "ExpressionStatement", - "start": 14864, - "end": 14917, + "start": 15105, + "end": 15158, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 73 } }, "expression": { "type": "CallExpression", - "start": 14864, - "end": 14916, + "start": 15105, + "end": 15157, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 72 } }, "callee": { "type": "Identifier", - "start": 14864, - "end": 14867, + "start": 15105, + "end": 15108, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 23 }, "identifierName": "log" @@ -39845,15 +41089,15 @@ "arguments": [ { "type": "StringLiteral", - "start": 14868, - "end": 14915, + "start": 15109, + "end": 15156, "loc": { "start": { - "line": 370, + "line": 381, "column": 24 }, "end": { - "line": 370, + "line": 381, "column": 71 } }, @@ -39868,44 +41112,44 @@ }, { "type": "VariableDeclaration", - "start": 14939, - "end": 15034, + "start": 15180, + "end": 15275, "loc": { "start": { - "line": 372, + "line": 383, "column": 20 }, "end": { - "line": 372, + "line": 383, "column": 115 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 14945, - "end": 15033, + "start": 15186, + "end": 15274, "loc": { "start": { - "line": 372, + "line": 383, "column": 26 }, "end": { - "line": 372, + "line": 383, "column": 114 } }, "id": { "type": "Identifier", - "start": 14945, - "end": 14959, + "start": 15186, + "end": 15200, "loc": { "start": { - "line": 372, + "line": 383, "column": 26 }, "end": { - "line": 372, + "line": 383, "column": 40 }, "identifierName": "xktArrayBuffer" @@ -39914,29 +41158,29 @@ }, "init": { "type": "CallExpression", - "start": 14962, - "end": 15033, + "start": 15203, + "end": 15274, "loc": { "start": { - "line": 372, + "line": 383, "column": 43 }, "end": { - "line": 372, + "line": 383, "column": 114 } }, "callee": { "type": "Identifier", - "start": 14962, - "end": 14988, + "start": 15203, + "end": 15229, "loc": { "start": { - "line": 372, + "line": 383, "column": 43 }, "end": { - "line": 372, + "line": 383, "column": 69 }, "identifierName": "writeXKTModelToArrayBuffer" @@ -39946,15 +41190,15 @@ "arguments": [ { "type": "Identifier", - "start": 14989, - "end": 14997, + "start": 15230, + "end": 15238, "loc": { "start": { - "line": 372, + "line": 383, "column": 70 }, "end": { - "line": 372, + "line": 383, "column": 78 }, "identifierName": "xktModel" @@ -39963,15 +41207,15 @@ }, { "type": "Identifier", - "start": 14999, - "end": 15012, + "start": 15240, + "end": 15253, "loc": { "start": { - "line": 372, + "line": 383, "column": 80 }, "end": { - "line": 372, + "line": 383, "column": 93 }, "identifierName": "metaModelJSON" @@ -39980,15 +41224,15 @@ }, { "type": "Identifier", - "start": 15014, - "end": 15019, + "start": 15255, + "end": 15260, "loc": { "start": { - "line": 372, + "line": 383, "column": 95 }, "end": { - "line": 372, + "line": 383, "column": 100 }, "identifierName": "stats" @@ -39997,30 +41241,30 @@ }, { "type": "ObjectExpression", - "start": 15021, - "end": 15032, + "start": 15262, + "end": 15273, "loc": { "start": { - "line": 372, + "line": 383, "column": 102 }, "end": { - "line": 372, + "line": 383, "column": 113 } }, "properties": [ { "type": "ObjectProperty", - "start": 15022, - "end": 15031, + "start": 15263, + "end": 15272, "loc": { "start": { - "line": 372, + "line": 383, "column": 103 }, "end": { - "line": 372, + "line": 383, "column": 112 } }, @@ -40029,15 +41273,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 15022, - "end": 15025, + "start": 15263, + "end": 15266, "loc": { "start": { - "line": 372, + "line": 383, "column": 103 }, "end": { - "line": 372, + "line": 383, "column": 106 }, "identifierName": "zip" @@ -40046,15 +41290,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 15027, - "end": 15031, + "start": 15268, + "end": 15272, "loc": { "start": { - "line": 372, + "line": 383, "column": 108 }, "end": { - "line": 372, + "line": 383, "column": 112 } }, @@ -40071,44 +41315,44 @@ }, { "type": "VariableDeclaration", - "start": 15056, - "end": 15103, + "start": 15297, + "end": 15344, "loc": { "start": { - "line": 374, + "line": 385, "column": 20 }, "end": { - "line": 374, + "line": 385, "column": 67 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 15062, - "end": 15102, + "start": 15303, + "end": 15343, "loc": { "start": { - "line": 374, + "line": 385, "column": 26 }, "end": { - "line": 374, + "line": 385, "column": 66 } }, "id": { "type": "Identifier", - "start": 15062, - "end": 15072, + "start": 15303, + "end": 15313, "loc": { "start": { - "line": 374, + "line": 385, "column": 26 }, "end": { - "line": 374, + "line": 385, "column": 36 }, "identifierName": "xktContent" @@ -40117,43 +41361,43 @@ }, "init": { "type": "CallExpression", - "start": 15075, - "end": 15102, + "start": 15316, + "end": 15343, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 66 } }, "callee": { "type": "MemberExpression", - "start": 15075, - "end": 15086, + "start": 15316, + "end": 15327, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 50 } }, "object": { "type": "Identifier", - "start": 15075, - "end": 15081, + "start": 15316, + "end": 15322, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 45 }, "identifierName": "Buffer" @@ -40162,15 +41406,15 @@ }, "property": { "type": "Identifier", - "start": 15082, - "end": 15086, + "start": 15323, + "end": 15327, "loc": { "start": { - "line": 374, + "line": 385, "column": 46 }, "end": { - "line": 374, + "line": 385, "column": 50 }, "identifierName": "from" @@ -40182,15 +41426,15 @@ "arguments": [ { "type": "Identifier", - "start": 15087, - "end": 15101, + "start": 15328, + "end": 15342, "loc": { "start": { - "line": 374, + "line": 385, "column": 51 }, "end": { - "line": 374, + "line": 385, "column": 65 }, "identifierName": "xktArrayBuffer" @@ -40205,44 +41449,44 @@ }, { "type": "VariableDeclaration", - "start": 15125, - "end": 15179, + "start": 15366, + "end": 15420, "loc": { "start": { - "line": 376, + "line": 387, "column": 20 }, "end": { - "line": 376, + "line": 387, "column": 74 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 15131, - "end": 15178, + "start": 15372, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 26 }, "end": { - "line": 376, + "line": 387, "column": 73 } }, "id": { "type": "Identifier", - "start": 15131, - "end": 15150, + "start": 15372, + "end": 15391, "loc": { "start": { - "line": 376, + "line": 387, "column": 26 }, "end": { - "line": 376, + "line": 387, "column": 45 }, "identifierName": "targetFileSizeBytes" @@ -40251,29 +41495,29 @@ }, "init": { "type": "MemberExpression", - "start": 15153, - "end": 15178, + "start": 15394, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 48 }, "end": { - "line": 376, + "line": 387, "column": 73 } }, "object": { "type": "Identifier", - "start": 15153, - "end": 15167, + "start": 15394, + "end": 15408, "loc": { "start": { - "line": 376, + "line": 387, "column": 48 }, "end": { - "line": 376, + "line": 387, "column": 62 }, "identifierName": "xktArrayBuffer" @@ -40282,15 +41526,15 @@ }, "property": { "type": "Identifier", - "start": 15168, - "end": 15178, + "start": 15409, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 63 }, "end": { - "line": 376, + "line": 387, "column": 73 }, "identifierName": "byteLength" @@ -40305,58 +41549,58 @@ }, { "type": "ExpressionStatement", - "start": 15201, - "end": 15240, + "start": 15442, + "end": 15481, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 59 } }, "expression": { "type": "AssignmentExpression", - "start": 15201, - "end": 15239, + "start": 15442, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15201, - "end": 15218, + "start": 15442, + "end": 15459, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 37 } }, "object": { "type": "Identifier", - "start": 15201, - "end": 15206, + "start": 15442, + "end": 15447, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 25 }, "identifierName": "stats" @@ -40365,15 +41609,15 @@ }, "property": { "type": "Identifier", - "start": 15207, - "end": 15218, + "start": 15448, + "end": 15459, "loc": { "start": { - "line": 378, + "line": 389, "column": 26 }, "end": { - "line": 378, + "line": 389, "column": 37 }, "identifierName": "minTileSize" @@ -40384,29 +41628,29 @@ }, "right": { "type": "LogicalExpression", - "start": 15221, - "end": 15239, + "start": 15462, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 40 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, "left": { "type": "Identifier", - "start": 15221, - "end": 15232, + "start": 15462, + "end": 15473, "loc": { "start": { - "line": 378, + "line": 389, "column": 40 }, "end": { - "line": 378, + "line": 389, "column": 51 }, "identifierName": "minTileSize" @@ -40416,15 +41660,15 @@ "operator": "||", "right": { "type": "NumericLiteral", - "start": 15236, - "end": 15239, + "start": 15477, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 55 }, "end": { - "line": 378, + "line": 389, "column": 58 } }, @@ -40439,58 +41683,58 @@ }, { "type": "ExpressionStatement", - "start": 15261, - "end": 15320, + "start": 15502, + "end": 15561, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 79 } }, "expression": { "type": "AssignmentExpression", - "start": 15261, - "end": 15319, + "start": 15502, + "end": 15560, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 78 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15261, - "end": 15277, + "start": 15502, + "end": 15518, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 36 } }, "object": { "type": "Identifier", - "start": 15261, - "end": 15266, + "start": 15502, + "end": 15507, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 25 }, "identifierName": "stats" @@ -40499,15 +41743,15 @@ }, "property": { "type": "Identifier", - "start": 15267, - "end": 15277, + "start": 15508, + "end": 15518, "loc": { "start": { - "line": 379, + "line": 390, "column": 26 }, "end": { - "line": 379, + "line": 390, "column": 36 }, "identifierName": "sourceSize" @@ -40518,57 +41762,57 @@ }, "right": { "type": "CallExpression", - "start": 15280, - "end": 15319, + "start": 15521, + "end": 15560, "loc": { "start": { - "line": 379, + "line": 390, "column": 39 }, "end": { - "line": 379, + "line": 390, "column": 78 } }, "callee": { "type": "MemberExpression", - "start": 15280, - "end": 15316, + "start": 15521, + "end": 15557, "loc": { "start": { - "line": 379, + "line": 390, "column": 39 }, "end": { - "line": 379, + "line": 390, "column": 75 } }, "object": { "type": "BinaryExpression", - "start": 15281, - "end": 15307, + "start": 15522, + "end": 15548, "loc": { "start": { - "line": 379, + "line": 390, "column": 40 }, "end": { - "line": 379, + "line": 390, "column": 66 } }, "left": { "type": "Identifier", - "start": 15281, - "end": 15300, + "start": 15522, + "end": 15541, "loc": { "start": { - "line": 379, + "line": 390, "column": 40 }, "end": { - "line": 379, + "line": 390, "column": 59 }, "identifierName": "sourceFileSizeBytes" @@ -40578,15 +41822,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 15303, - "end": 15307, + "start": 15544, + "end": 15548, "loc": { "start": { - "line": 379, + "line": 390, "column": 62 }, "end": { - "line": 379, + "line": 390, "column": 66 } }, @@ -40598,20 +41842,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15280 + "parenStart": 15521 } }, "property": { "type": "Identifier", - "start": 15309, - "end": 15316, + "start": 15550, + "end": 15557, "loc": { "start": { - "line": 379, + "line": 390, "column": 68 }, "end": { - "line": 379, + "line": 390, "column": 75 }, "identifierName": "toFixed" @@ -40623,15 +41867,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15317, - "end": 15318, + "start": 15558, + "end": 15559, "loc": { "start": { - "line": 379, + "line": 390, "column": 76 }, "end": { - "line": 379, + "line": 390, "column": 77 } }, @@ -40647,58 +41891,58 @@ }, { "type": "ExpressionStatement", - "start": 15341, - "end": 15397, + "start": 15582, + "end": 15638, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 76 } }, "expression": { "type": "AssignmentExpression", - "start": 15341, - "end": 15396, + "start": 15582, + "end": 15637, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 75 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15341, - "end": 15354, + "start": 15582, + "end": 15595, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 33 } }, "object": { "type": "Identifier", - "start": 15341, - "end": 15346, + "start": 15582, + "end": 15587, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 25 }, "identifierName": "stats" @@ -40707,15 +41951,15 @@ }, "property": { "type": "Identifier", - "start": 15347, - "end": 15354, + "start": 15588, + "end": 15595, "loc": { "start": { - "line": 380, + "line": 391, "column": 26 }, "end": { - "line": 380, + "line": 391, "column": 33 }, "identifierName": "xktSize" @@ -40726,57 +41970,57 @@ }, "right": { "type": "CallExpression", - "start": 15357, - "end": 15396, + "start": 15598, + "end": 15637, "loc": { "start": { - "line": 380, + "line": 391, "column": 36 }, "end": { - "line": 380, + "line": 391, "column": 75 } }, "callee": { "type": "MemberExpression", - "start": 15357, - "end": 15393, + "start": 15598, + "end": 15634, "loc": { "start": { - "line": 380, + "line": 391, "column": 36 }, "end": { - "line": 380, + "line": 391, "column": 72 } }, "object": { "type": "BinaryExpression", - "start": 15358, - "end": 15384, + "start": 15599, + "end": 15625, "loc": { "start": { - "line": 380, + "line": 391, "column": 37 }, "end": { - "line": 380, + "line": 391, "column": 63 } }, "left": { "type": "Identifier", - "start": 15358, - "end": 15377, + "start": 15599, + "end": 15618, "loc": { "start": { - "line": 380, + "line": 391, "column": 37 }, "end": { - "line": 380, + "line": 391, "column": 56 }, "identifierName": "targetFileSizeBytes" @@ -40786,15 +42030,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 15380, - "end": 15384, + "start": 15621, + "end": 15625, "loc": { "start": { - "line": 380, + "line": 391, "column": 59 }, "end": { - "line": 380, + "line": 391, "column": 63 } }, @@ -40806,20 +42050,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15357 + "parenStart": 15598 } }, "property": { "type": "Identifier", - "start": 15386, - "end": 15393, + "start": 15627, + "end": 15634, "loc": { "start": { - "line": 380, + "line": 391, "column": 65 }, "end": { - "line": 380, + "line": 391, "column": 72 }, "identifierName": "toFixed" @@ -40831,15 +42075,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15394, - "end": 15395, + "start": 15635, + "end": 15636, "loc": { "start": { - "line": 380, + "line": 391, "column": 73 }, "end": { - "line": 380, + "line": 391, "column": 74 } }, @@ -40855,58 +42099,58 @@ }, { "type": "ExpressionStatement", - "start": 15418, - "end": 15457, + "start": 15659, + "end": 15698, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 59 } }, "expression": { "type": "AssignmentExpression", - "start": 15418, - "end": 15456, + "start": 15659, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 58 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15418, - "end": 15434, + "start": 15659, + "end": 15675, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 36 } }, "object": { "type": "Identifier", - "start": 15418, - "end": 15423, + "start": 15659, + "end": 15664, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 25 }, "identifierName": "stats" @@ -40915,15 +42159,15 @@ }, "property": { "type": "Identifier", - "start": 15424, - "end": 15434, + "start": 15665, + "end": 15675, "loc": { "start": { - "line": 381, + "line": 392, "column": 26 }, "end": { - "line": 381, + "line": 392, "column": 36 }, "identifierName": "xktVersion" @@ -40934,29 +42178,29 @@ }, "right": { "type": "MemberExpression", - "start": 15437, - "end": 15456, + "start": 15678, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 39 }, "end": { - "line": 381, + "line": 392, "column": 58 } }, "object": { "type": "Identifier", - "start": 15437, - "end": 15445, + "start": 15678, + "end": 15686, "loc": { "start": { - "line": 381, + "line": 392, "column": 39 }, "end": { - "line": 381, + "line": 392, "column": 47 }, "identifierName": "XKT_INFO" @@ -40965,15 +42209,15 @@ }, "property": { "type": "Identifier", - "start": 15446, - "end": 15456, + "start": 15687, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 48 }, "end": { - "line": 381, + "line": 392, "column": 58 }, "identifierName": "xktVersion" @@ -40986,58 +42230,58 @@ }, { "type": "ExpressionStatement", - "start": 15478, - "end": 15558, + "start": 15719, + "end": 15799, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 100 } }, "expression": { "type": "AssignmentExpression", - "start": 15478, - "end": 15557, + "start": 15719, + "end": 15798, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 99 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15478, - "end": 15500, + "start": 15719, + "end": 15741, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 42 } }, "object": { "type": "Identifier", - "start": 15478, - "end": 15483, + "start": 15719, + "end": 15724, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 25 }, "identifierName": "stats" @@ -41046,15 +42290,15 @@ }, "property": { "type": "Identifier", - "start": 15484, - "end": 15500, + "start": 15725, + "end": 15741, "loc": { "start": { - "line": 382, + "line": 393, "column": 26 }, "end": { - "line": 382, + "line": 393, "column": 42 }, "identifierName": "compressionRatio" @@ -41065,57 +42309,57 @@ }, "right": { "type": "CallExpression", - "start": 15503, - "end": 15557, + "start": 15744, + "end": 15798, "loc": { "start": { - "line": 382, + "line": 393, "column": 45 }, "end": { - "line": 382, + "line": 393, "column": 99 } }, "callee": { "type": "MemberExpression", - "start": 15503, - "end": 15554, + "start": 15744, + "end": 15795, "loc": { "start": { - "line": 382, + "line": 393, "column": 45 }, "end": { - "line": 382, + "line": 393, "column": 96 } }, "object": { "type": "BinaryExpression", - "start": 15504, - "end": 15545, + "start": 15745, + "end": 15786, "loc": { "start": { - "line": 382, + "line": 393, "column": 46 }, "end": { - "line": 382, + "line": 393, "column": 87 } }, "left": { "type": "Identifier", - "start": 15504, - "end": 15523, + "start": 15745, + "end": 15764, "loc": { "start": { - "line": 382, + "line": 393, "column": 46 }, "end": { - "line": 382, + "line": 393, "column": 65 }, "identifierName": "sourceFileSizeBytes" @@ -41125,15 +42369,15 @@ "operator": "/", "right": { "type": "Identifier", - "start": 15526, - "end": 15545, + "start": 15767, + "end": 15786, "loc": { "start": { - "line": 382, + "line": 393, "column": 68 }, "end": { - "line": 382, + "line": 393, "column": 87 }, "identifierName": "targetFileSizeBytes" @@ -41142,20 +42386,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15503 + "parenStart": 15744 } }, "property": { "type": "Identifier", - "start": 15547, - "end": 15554, + "start": 15788, + "end": 15795, "loc": { "start": { - "line": 382, + "line": 393, "column": 89 }, "end": { - "line": 382, + "line": 393, "column": 96 }, "identifierName": "toFixed" @@ -41167,15 +42411,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15555, - "end": 15556, + "start": 15796, + "end": 15797, "loc": { "start": { - "line": 382, + "line": 393, "column": 97 }, "end": { - "line": 382, + "line": 393, "column": 98 } }, @@ -41191,58 +42435,58 @@ }, { "type": "ExpressionStatement", - "start": 15579, - "end": 15649, + "start": 15820, + "end": 15890, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 90 } }, "expression": { "type": "AssignmentExpression", - "start": 15579, - "end": 15648, + "start": 15820, + "end": 15889, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 89 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15579, - "end": 15599, + "start": 15820, + "end": 15840, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 40 } }, "object": { "type": "Identifier", - "start": 15579, - "end": 15584, + "start": 15820, + "end": 15825, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 25 }, "identifierName": "stats" @@ -41251,15 +42495,15 @@ }, "property": { "type": "Identifier", - "start": 15585, - "end": 15599, + "start": 15826, + "end": 15840, "loc": { "start": { - "line": 383, + "line": 394, "column": 26 }, "end": { - "line": 383, + "line": 394, "column": 40 }, "identifierName": "conversionTime" @@ -41270,85 +42514,85 @@ }, "right": { "type": "CallExpression", - "start": 15602, - "end": 15648, + "start": 15843, + "end": 15889, "loc": { "start": { - "line": 383, + "line": 394, "column": 43 }, "end": { - "line": 383, + "line": 394, "column": 89 } }, "callee": { "type": "MemberExpression", - "start": 15602, - "end": 15645, + "start": 15843, + "end": 15886, "loc": { "start": { - "line": 383, + "line": 394, "column": 43 }, "end": { - "line": 383, + "line": 394, "column": 86 } }, "object": { "type": "BinaryExpression", - "start": 15603, - "end": 15636, + "start": 15844, + "end": 15877, "loc": { "start": { - "line": 383, + "line": 394, "column": 44 }, "end": { - "line": 383, + "line": 394, "column": 77 } }, "left": { "type": "BinaryExpression", - "start": 15604, - "end": 15626, + "start": 15845, + "end": 15867, "loc": { "start": { - "line": 383, + "line": 394, "column": 45 }, "end": { - "line": 383, + "line": 394, "column": 67 } }, "left": { "type": "NewExpression", - "start": 15604, - "end": 15614, + "start": 15845, + "end": 15855, "loc": { "start": { - "line": 383, + "line": 394, "column": 45 }, "end": { - "line": 383, + "line": 394, "column": 55 } }, "callee": { "type": "Identifier", - "start": 15608, - "end": 15612, + "start": 15849, + "end": 15853, "loc": { "start": { - "line": 383, + "line": 394, "column": 49 }, "end": { - "line": 383, + "line": 394, "column": 53 }, "identifierName": "Date" @@ -41360,15 +42604,15 @@ "operator": "-", "right": { "type": "Identifier", - "start": 15617, - "end": 15626, + "start": 15858, + "end": 15867, "loc": { "start": { - "line": 383, + "line": 394, "column": 58 }, "end": { - "line": 383, + "line": 394, "column": 67 }, "identifierName": "startTime" @@ -41377,21 +42621,21 @@ }, "extra": { "parenthesized": true, - "parenStart": 15603 + "parenStart": 15844 } }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 15630, - "end": 15636, + "start": 15871, + "end": 15877, "loc": { "start": { - "line": 383, + "line": 394, "column": 71 }, "end": { - "line": 383, + "line": 394, "column": 77 } }, @@ -41403,20 +42647,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 15602 + "parenStart": 15843 } }, "property": { "type": "Identifier", - "start": 15638, - "end": 15645, + "start": 15879, + "end": 15886, "loc": { "start": { - "line": 383, + "line": 394, "column": 79 }, "end": { - "line": 383, + "line": 394, "column": 86 }, "identifierName": "toFixed" @@ -41428,15 +42672,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 15646, - "end": 15647, + "start": 15887, + "end": 15888, "loc": { "start": { - "line": 383, + "line": 394, "column": 87 }, "end": { - "line": 383, + "line": 394, "column": 88 } }, @@ -41452,58 +42696,58 @@ }, { "type": "ExpressionStatement", - "start": 15670, - "end": 15697, + "start": 15911, + "end": 15938, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 47 } }, "expression": { "type": "AssignmentExpression", - "start": 15670, - "end": 15696, + "start": 15911, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 46 } }, "operator": "=", "left": { "type": "MemberExpression", - "start": 15670, - "end": 15680, + "start": 15911, + "end": 15921, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 30 } }, "object": { "type": "Identifier", - "start": 15670, - "end": 15675, + "start": 15911, + "end": 15916, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 25 }, "identifierName": "stats" @@ -41512,15 +42756,15 @@ }, "property": { "type": "Identifier", - "start": 15676, - "end": 15680, + "start": 15917, + "end": 15921, "loc": { "start": { - "line": 384, + "line": 395, "column": 26 }, "end": { - "line": 384, + "line": 395, "column": 30 }, "identifierName": "aabb" @@ -41531,29 +42775,29 @@ }, "right": { "type": "MemberExpression", - "start": 15683, - "end": 15696, + "start": 15924, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 33 }, "end": { - "line": 384, + "line": 395, "column": 46 } }, "object": { "type": "Identifier", - "start": 15683, - "end": 15691, + "start": 15924, + "end": 15932, "loc": { "start": { - "line": 384, + "line": 395, "column": 33 }, "end": { - "line": 384, + "line": 395, "column": 41 }, "identifierName": "xktModel" @@ -41562,15 +42806,15 @@ }, "property": { "type": "Identifier", - "start": 15692, - "end": 15696, + "start": 15933, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 42 }, "end": { - "line": 384, + "line": 395, "column": 46 }, "identifierName": "aabb" @@ -41583,43 +42827,43 @@ }, { "type": "ExpressionStatement", - "start": 15718, - "end": 15764, + "start": 15959, + "end": 16005, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 66 } }, "expression": { "type": "CallExpression", - "start": 15718, - "end": 15763, + "start": 15959, + "end": 16004, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 65 } }, "callee": { "type": "Identifier", - "start": 15718, - "end": 15721, + "start": 15959, + "end": 15962, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 23 }, "identifierName": "log" @@ -41629,44 +42873,44 @@ "arguments": [ { "type": "TemplateLiteral", - "start": 15722, - "end": 15762, + "start": 15963, + "end": 16003, "loc": { "start": { - "line": 385, + "line": 396, "column": 24 }, "end": { - "line": 385, + "line": 396, "column": 64 } }, "expressions": [ { "type": "MemberExpression", - "start": 15744, - "end": 15760, + "start": 15985, + "end": 16001, "loc": { "start": { - "line": 385, + "line": 396, "column": 46 }, "end": { - "line": 385, + "line": 396, "column": 62 } }, "object": { "type": "Identifier", - "start": 15744, - "end": 15749, + "start": 15985, + "end": 15990, "loc": { "start": { - "line": 385, + "line": 396, "column": 46 }, "end": { - "line": 385, + "line": 396, "column": 51 }, "identifierName": "stats" @@ -41675,15 +42919,15 @@ }, "property": { "type": "Identifier", - "start": 15750, - "end": 15760, + "start": 15991, + "end": 16001, "loc": { "start": { - "line": 385, + "line": 396, "column": 52 }, "end": { - "line": 385, + "line": 396, "column": 62 }, "identifierName": "xktVersion" @@ -41696,15 +42940,15 @@ "quasis": [ { "type": "TemplateElement", - "start": 15723, - "end": 15742, + "start": 15964, + "end": 15983, "loc": { "start": { - "line": 385, + "line": 396, "column": 25 }, "end": { - "line": 385, + "line": 396, "column": 44 } }, @@ -41716,15 +42960,15 @@ }, { "type": "TemplateElement", - "start": 15761, - "end": 15761, + "start": 16002, + "end": 16002, "loc": { "start": { - "line": 385, + "line": 396, "column": 63 }, "end": { - "line": 385, + "line": 396, "column": 63 } }, @@ -41741,29 +42985,29 @@ }, { "type": "IfStatement", - "start": 15785, - "end": 15924, + "start": 16026, + "end": 16165, "loc": { "start": { - "line": 386, + "line": 397, "column": 20 }, "end": { - "line": 388, + "line": 399, "column": 21 } }, "test": { "type": "Identifier", - "start": 15789, - "end": 15801, + "start": 16030, + "end": 16042, "loc": { "start": { - "line": 386, + "line": 397, "column": 24 }, "end": { - "line": 386, + "line": 397, "column": 36 }, "identifierName": "includeTypes" @@ -41772,58 +43016,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 15803, - "end": 15924, + "start": 16044, + "end": 16165, "loc": { "start": { - "line": 386, + "line": 397, "column": 38 }, "end": { - "line": 388, + "line": 399, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 15829, - "end": 15902, + "start": 16070, + "end": 16143, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 97 } }, "expression": { "type": "CallExpression", - "start": 15829, - "end": 15901, + "start": 16070, + "end": 16142, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 96 } }, "callee": { "type": "Identifier", - "start": 15829, - "end": 15832, + "start": 16070, + "end": 16073, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 27 }, "identifierName": "log" @@ -41833,29 +43077,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 15833, - "end": 15900, + "start": 16074, + "end": 16141, "loc": { "start": { - "line": 387, + "line": 398, "column": 28 }, "end": { - "line": 387, + "line": 398, "column": 95 } }, "left": { "type": "StringLiteral", - "start": 15833, - "end": 15850, + "start": 16074, + "end": 16091, "loc": { "start": { - "line": 387, + "line": 398, "column": 28 }, "end": { - "line": 387, + "line": 398, "column": 45 } }, @@ -41868,29 +43112,29 @@ "operator": "+", "right": { "type": "ConditionalExpression", - "start": 15854, - "end": 15899, + "start": 16095, + "end": 16140, "loc": { "start": { - "line": 387, + "line": 398, "column": 49 }, "end": { - "line": 387, + "line": 398, "column": 94 } }, "test": { "type": "Identifier", - "start": 15854, - "end": 15866, + "start": 16095, + "end": 16107, "loc": { "start": { - "line": 387, + "line": 398, "column": 49 }, "end": { - "line": 387, + "line": 398, "column": 61 }, "identifierName": "includeTypes" @@ -41899,15 +43143,15 @@ }, "consequent": { "type": "Identifier", - "start": 15869, - "end": 15881, + "start": 16110, + "end": 16122, "loc": { "start": { - "line": 387, + "line": 398, "column": 64 }, "end": { - "line": 387, + "line": 398, "column": 76 }, "identifierName": "includeTypes" @@ -41916,15 +43160,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 15884, - "end": 15899, + "start": 16125, + "end": 16140, "loc": { "start": { - "line": 387, + "line": 398, "column": 79 }, "end": { - "line": 387, + "line": 398, "column": 94 } }, @@ -41936,7 +43180,7 @@ }, "extra": { "parenthesized": true, - "parenStart": 15853 + "parenStart": 16094 } } } @@ -41950,29 +43194,29 @@ }, { "type": "IfStatement", - "start": 15945, - "end": 16085, + "start": 16186, + "end": 16326, "loc": { "start": { - "line": 389, + "line": 400, "column": 20 }, "end": { - "line": 391, + "line": 402, "column": 21 } }, "test": { "type": "Identifier", - "start": 15949, - "end": 15961, + "start": 16190, + "end": 16202, "loc": { "start": { - "line": 389, + "line": 400, "column": 24 }, "end": { - "line": 389, + "line": 400, "column": 36 }, "identifierName": "excludeTypes" @@ -41981,58 +43225,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 15963, - "end": 16085, + "start": 16204, + "end": 16326, "loc": { "start": { - "line": 389, + "line": 400, "column": 38 }, "end": { - "line": 391, + "line": 402, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 15989, - "end": 16063, + "start": 16230, + "end": 16304, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 98 } }, "expression": { "type": "CallExpression", - "start": 15989, - "end": 16062, + "start": 16230, + "end": 16303, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 97 } }, "callee": { "type": "Identifier", - "start": 15989, - "end": 15992, + "start": 16230, + "end": 16233, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 27 }, "identifierName": "log" @@ -42042,29 +43286,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 15993, - "end": 16061, + "start": 16234, + "end": 16302, "loc": { "start": { - "line": 390, + "line": 401, "column": 28 }, "end": { - "line": 390, + "line": 401, "column": 96 } }, "left": { "type": "StringLiteral", - "start": 15993, - "end": 16010, + "start": 16234, + "end": 16251, "loc": { "start": { - "line": 390, + "line": 401, "column": 28 }, "end": { - "line": 390, + "line": 401, "column": 45 } }, @@ -42077,29 +43321,29 @@ "operator": "+", "right": { "type": "ConditionalExpression", - "start": 16014, - "end": 16060, + "start": 16255, + "end": 16301, "loc": { "start": { - "line": 390, + "line": 401, "column": 49 }, "end": { - "line": 390, + "line": 401, "column": 95 } }, "test": { "type": "Identifier", - "start": 16014, - "end": 16026, + "start": 16255, + "end": 16267, "loc": { "start": { - "line": 390, + "line": 401, "column": 49 }, "end": { - "line": 390, + "line": 401, "column": 61 }, "identifierName": "excludeTypes" @@ -42108,15 +43352,15 @@ }, "consequent": { "type": "Identifier", - "start": 16029, - "end": 16041, + "start": 16270, + "end": 16282, "loc": { "start": { - "line": 390, + "line": 401, "column": 64 }, "end": { - "line": 390, + "line": 401, "column": 76 }, "identifierName": "excludeTypes" @@ -42125,15 +43369,15 @@ }, "alternate": { "type": "StringLiteral", - "start": 16044, - "end": 16060, + "start": 16285, + "end": 16301, "loc": { "start": { - "line": 390, + "line": 401, "column": 79 }, "end": { - "line": 390, + "line": 401, "column": 95 } }, @@ -42145,7 +43389,7 @@ }, "extra": { "parenthesized": true, - "parenStart": 16013 + "parenStart": 16254 } } } @@ -42159,43 +43403,43 @@ }, { "type": "ExpressionStatement", - "start": 16106, - "end": 16148, + "start": 16347, + "end": 16389, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 62 } }, "expression": { "type": "CallExpression", - "start": 16106, - "end": 16147, + "start": 16347, + "end": 16388, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 61 } }, "callee": { "type": "Identifier", - "start": 16106, - "end": 16109, + "start": 16347, + "end": 16350, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 23 }, "identifierName": "log" @@ -42205,43 +43449,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16110, - "end": 16146, + "start": 16351, + "end": 16387, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 60 } }, "left": { "type": "BinaryExpression", - "start": 16110, - "end": 16138, + "start": 16351, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 52 } }, "left": { "type": "StringLiteral", - "start": 16110, - "end": 16122, + "start": 16351, + "end": 16363, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 36 } }, @@ -42254,29 +43498,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16125, - "end": 16138, + "start": 16366, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 39 }, "end": { - "line": 392, + "line": 403, "column": 52 } }, "object": { "type": "Identifier", - "start": 16125, - "end": 16130, + "start": 16366, + "end": 16371, "loc": { "start": { - "line": 392, + "line": 403, "column": 39 }, "end": { - "line": 392, + "line": 403, "column": 44 }, "identifierName": "stats" @@ -42285,15 +43529,15 @@ }, "property": { "type": "Identifier", - "start": 16131, - "end": 16138, + "start": 16372, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 45 }, "end": { - "line": 392, + "line": 403, "column": 52 }, "identifierName": "xktSize" @@ -42306,15 +43550,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16141, - "end": 16146, + "start": 16382, + "end": 16387, "loc": { "start": { - "line": 392, + "line": 403, "column": 55 }, "end": { - "line": 392, + "line": 403, "column": 60 } }, @@ -42330,43 +43574,43 @@ }, { "type": "ExpressionStatement", - "start": 16169, - "end": 16244, + "start": 16410, + "end": 16485, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 95 } }, "expression": { "type": "CallExpression", - "start": 16169, - "end": 16243, + "start": 16410, + "end": 16484, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 94 } }, "callee": { "type": "Identifier", - "start": 16169, - "end": 16172, + "start": 16410, + "end": 16413, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 23 }, "identifierName": "log" @@ -42376,43 +43620,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16173, - "end": 16242, + "start": 16414, + "end": 16483, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 93 } }, "left": { "type": "BinaryExpression", - "start": 16173, - "end": 16235, + "start": 16414, + "end": 16476, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 86 } }, "left": { "type": "StringLiteral", - "start": 16173, - "end": 16194, + "start": 16414, + "end": 16435, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 45 } }, @@ -42425,71 +43669,71 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 16197, - "end": 16235, + "start": 16438, + "end": 16476, "loc": { "start": { - "line": 393, + "line": 404, "column": 48 }, "end": { - "line": 393, + "line": 404, "column": 86 } }, "callee": { "type": "MemberExpression", - "start": 16197, - "end": 16232, + "start": 16438, + "end": 16473, "loc": { "start": { - "line": 393, + "line": 404, "column": 48 }, "end": { - "line": 393, + "line": 404, "column": 83 } }, "object": { "type": "BinaryExpression", - "start": 16198, - "end": 16223, + "start": 16439, + "end": 16464, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 74 } }, "left": { "type": "MemberExpression", - "start": 16198, - "end": 16216, + "start": 16439, + "end": 16457, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 67 } }, "object": { "type": "Identifier", - "start": 16198, - "end": 16203, + "start": 16439, + "end": 16444, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 54 }, "identifierName": "stats" @@ -42498,15 +43742,15 @@ }, "property": { "type": "Identifier", - "start": 16204, - "end": 16216, + "start": 16445, + "end": 16457, "loc": { "start": { - "line": 393, + "line": 404, "column": 55 }, "end": { - "line": 393, + "line": 404, "column": 67 }, "identifierName": "texturesSize" @@ -42518,15 +43762,15 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 16219, - "end": 16223, + "start": 16460, + "end": 16464, "loc": { "start": { - "line": 393, + "line": 404, "column": 70 }, "end": { - "line": 393, + "line": 404, "column": 74 } }, @@ -42538,20 +43782,20 @@ }, "extra": { "parenthesized": true, - "parenStart": 16197 + "parenStart": 16438 } }, "property": { "type": "Identifier", - "start": 16225, - "end": 16232, + "start": 16466, + "end": 16473, "loc": { "start": { - "line": 393, + "line": 404, "column": 76 }, "end": { - "line": 393, + "line": 404, "column": 83 }, "identifierName": "toFixed" @@ -42563,15 +43807,15 @@ "arguments": [ { "type": "NumericLiteral", - "start": 16233, - "end": 16234, + "start": 16474, + "end": 16475, "loc": { "start": { - "line": 393, + "line": 404, "column": 84 }, "end": { - "line": 393, + "line": 404, "column": 85 } }, @@ -42587,15 +43831,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16238, - "end": 16242, + "start": 16479, + "end": 16483, "loc": { "start": { - "line": 393, + "line": 404, "column": 89 }, "end": { - "line": 393, + "line": 404, "column": 93 } }, @@ -42611,43 +43855,43 @@ }, { "type": "ExpressionStatement", - "start": 16265, - "end": 16317, + "start": 16506, + "end": 16558, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 72 } }, "expression": { "type": "CallExpression", - "start": 16265, - "end": 16316, + "start": 16506, + "end": 16557, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 71 } }, "callee": { "type": "Identifier", - "start": 16265, - "end": 16268, + "start": 16506, + "end": 16509, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 23 }, "identifierName": "log" @@ -42657,29 +43901,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16269, - "end": 16315, + "start": 16510, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 24 }, "end": { - "line": 394, + "line": 405, "column": 70 } }, "left": { "type": "StringLiteral", - "start": 16269, - "end": 16290, + "start": 16510, + "end": 16531, "loc": { "start": { - "line": 394, + "line": 405, "column": 24 }, "end": { - "line": 394, + "line": 405, "column": 45 } }, @@ -42692,29 +43936,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16293, - "end": 16315, + "start": 16534, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 48 }, "end": { - "line": 394, + "line": 405, "column": 70 } }, "object": { "type": "Identifier", - "start": 16293, - "end": 16298, + "start": 16534, + "end": 16539, "loc": { "start": { - "line": 394, + "line": 405, "column": 48 }, "end": { - "line": 394, + "line": 405, "column": 53 }, "identifierName": "stats" @@ -42723,15 +43967,15 @@ }, "property": { "type": "Identifier", - "start": 16299, - "end": 16315, + "start": 16540, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 54 }, "end": { - "line": 394, + "line": 405, "column": 70 }, "identifierName": "compressionRatio" @@ -42746,43 +43990,43 @@ }, { "type": "ExpressionStatement", - "start": 16338, - "end": 16393, + "start": 16579, + "end": 16634, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 75 } }, "expression": { "type": "CallExpression", - "start": 16338, - "end": 16392, + "start": 16579, + "end": 16633, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 74 } }, "callee": { "type": "Identifier", - "start": 16338, - "end": 16341, + "start": 16579, + "end": 16582, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 23 }, "identifierName": "log" @@ -42792,43 +44036,43 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16342, - "end": 16391, + "start": 16583, + "end": 16632, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 73 } }, "left": { "type": "BinaryExpression", - "start": 16342, - "end": 16384, + "start": 16583, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16342, - "end": 16361, + "start": 16583, + "end": 16602, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 43 } }, @@ -42841,29 +44085,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16364, - "end": 16384, + "start": 16605, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 46 }, "end": { - "line": 395, + "line": 406, "column": 66 } }, "object": { "type": "Identifier", - "start": 16364, - "end": 16369, + "start": 16605, + "end": 16610, "loc": { "start": { - "line": 395, + "line": 406, "column": 46 }, "end": { - "line": 395, + "line": 406, "column": 51 }, "identifierName": "stats" @@ -42872,15 +44116,15 @@ }, "property": { "type": "Identifier", - "start": 16370, - "end": 16384, + "start": 16611, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 52 }, "end": { - "line": 395, + "line": 406, "column": 66 }, "identifierName": "conversionTime" @@ -42893,15 +44137,15 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 16387, - "end": 16391, + "start": 16628, + "end": 16632, "loc": { "start": { - "line": 395, + "line": 406, "column": 69 }, "end": { - "line": 395, + "line": 406, "column": 73 } }, @@ -42917,43 +44161,43 @@ }, { "type": "ExpressionStatement", - "start": 16414, - "end": 16468, + "start": 16655, + "end": 16709, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 74 } }, "expression": { "type": "CallExpression", - "start": 16414, - "end": 16467, + "start": 16655, + "end": 16708, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 73 } }, "callee": { "type": "Identifier", - "start": 16414, - "end": 16417, + "start": 16655, + "end": 16658, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 23 }, "identifierName": "log" @@ -42963,29 +44207,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16418, - "end": 16466, + "start": 16659, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 24 }, "end": { - "line": 396, + "line": 407, "column": 72 } }, "left": { "type": "StringLiteral", - "start": 16418, - "end": 16443, + "start": 16659, + "end": 16684, "loc": { "start": { - "line": 396, + "line": 407, "column": 24 }, "end": { - "line": 396, + "line": 407, "column": 49 } }, @@ -42998,29 +44242,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16446, - "end": 16466, + "start": 16687, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 52 }, "end": { - "line": 396, + "line": 407, "column": 72 } }, "object": { "type": "Identifier", - "start": 16446, - "end": 16451, + "start": 16687, + "end": 16692, "loc": { "start": { - "line": 396, + "line": 407, "column": 52 }, "end": { - "line": 396, + "line": 407, "column": 57 }, "identifierName": "stats" @@ -43029,15 +44273,15 @@ }, "property": { "type": "Identifier", - "start": 16452, - "end": 16466, + "start": 16693, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 58 }, "end": { - "line": 396, + "line": 407, "column": 72 }, "identifierName": "numMetaObjects" @@ -43052,43 +44296,43 @@ }, { "type": "ExpressionStatement", - "start": 16489, - "end": 16546, + "start": 16730, + "end": 16787, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 77 } }, "expression": { "type": "CallExpression", - "start": 16489, - "end": 16545, + "start": 16730, + "end": 16786, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 76 } }, "callee": { "type": "Identifier", - "start": 16489, - "end": 16492, + "start": 16730, + "end": 16733, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 23 }, "identifierName": "log" @@ -43098,29 +44342,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16493, - "end": 16544, + "start": 16734, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 24 }, "end": { - "line": 397, + "line": 408, "column": 75 } }, "left": { "type": "StringLiteral", - "start": 16493, - "end": 16520, + "start": 16734, + "end": 16761, "loc": { "start": { - "line": 397, + "line": 408, "column": 24 }, "end": { - "line": 397, + "line": 408, "column": 51 } }, @@ -43133,29 +44377,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16523, - "end": 16544, + "start": 16764, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 54 }, "end": { - "line": 397, + "line": 408, "column": 75 } }, "object": { "type": "Identifier", - "start": 16523, - "end": 16528, + "start": 16764, + "end": 16769, "loc": { "start": { - "line": 397, + "line": 408, "column": 54 }, "end": { - "line": 397, + "line": 408, "column": 59 }, "identifierName": "stats" @@ -43164,15 +44408,15 @@ }, "property": { "type": "Identifier", - "start": 16529, - "end": 16544, + "start": 16770, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 60 }, "end": { - "line": 397, + "line": 408, "column": 75 }, "identifierName": "numPropertySets" @@ -43187,43 +44431,43 @@ }, { "type": "ExpressionStatement", - "start": 16567, - "end": 16622, + "start": 16808, + "end": 16863, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 75 } }, "expression": { "type": "CallExpression", - "start": 16567, - "end": 16621, + "start": 16808, + "end": 16862, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 74 } }, "callee": { "type": "Identifier", - "start": 16567, - "end": 16570, + "start": 16808, + "end": 16811, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 23 }, "identifierName": "log" @@ -43233,29 +44477,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16571, - "end": 16620, + "start": 16812, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 24 }, "end": { - "line": 398, + "line": 409, "column": 73 } }, "left": { "type": "StringLiteral", - "start": 16571, - "end": 16601, + "start": 16812, + "end": 16842, "loc": { "start": { - "line": 398, + "line": 409, "column": 24 }, "end": { - "line": 398, + "line": 409, "column": 54 } }, @@ -43268,29 +44512,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16604, - "end": 16620, + "start": 16845, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 57 }, "end": { - "line": 398, + "line": 409, "column": 73 } }, "object": { "type": "Identifier", - "start": 16604, - "end": 16609, + "start": 16845, + "end": 16850, "loc": { "start": { - "line": 398, + "line": 409, "column": 57 }, "end": { - "line": 398, + "line": 409, "column": 62 }, "identifierName": "stats" @@ -43299,15 +44543,15 @@ }, "property": { "type": "Identifier", - "start": 16610, - "end": 16620, + "start": 16851, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 63 }, "end": { - "line": 398, + "line": 409, "column": 73 }, "identifierName": "numObjects" @@ -43322,43 +44566,43 @@ }, { "type": "ExpressionStatement", - "start": 16643, - "end": 16695, + "start": 16884, + "end": 16936, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 72 } }, "expression": { "type": "CallExpression", - "start": 16643, - "end": 16694, + "start": 16884, + "end": 16935, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 71 } }, "callee": { "type": "Identifier", - "start": 16643, - "end": 16646, + "start": 16884, + "end": 16887, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 23 }, "identifierName": "log" @@ -43368,29 +44612,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16647, - "end": 16693, + "start": 16888, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 24 }, "end": { - "line": 399, + "line": 410, "column": 70 } }, "left": { "type": "StringLiteral", - "start": 16647, - "end": 16671, + "start": 16888, + "end": 16912, "loc": { "start": { - "line": 399, + "line": 410, "column": 24 }, "end": { - "line": 399, + "line": 410, "column": 48 } }, @@ -43403,29 +44647,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16674, - "end": 16693, + "start": 16915, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 51 }, "end": { - "line": 399, + "line": 410, "column": 70 } }, "object": { "type": "Identifier", - "start": 16674, - "end": 16679, + "start": 16915, + "end": 16920, "loc": { "start": { - "line": 399, + "line": 410, "column": 51 }, "end": { - "line": 399, + "line": 410, "column": 56 }, "identifierName": "stats" @@ -43434,15 +44678,15 @@ }, "property": { "type": "Identifier", - "start": 16680, - "end": 16693, + "start": 16921, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 57 }, "end": { - "line": 399, + "line": 410, "column": 70 }, "identifierName": "numGeometries" @@ -43457,43 +44701,43 @@ }, { "type": "ExpressionStatement", - "start": 16716, - "end": 16764, + "start": 16957, + "end": 17005, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 68 } }, "expression": { "type": "CallExpression", - "start": 16716, - "end": 16763, + "start": 16957, + "end": 17004, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 67 } }, "callee": { "type": "Identifier", - "start": 16716, - "end": 16719, + "start": 16957, + "end": 16960, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 23 }, "identifierName": "log" @@ -43503,29 +44747,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16720, - "end": 16762, + "start": 16961, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 24 }, "end": { - "line": 400, + "line": 411, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16720, - "end": 16742, + "start": 16961, + "end": 16983, "loc": { "start": { - "line": 400, + "line": 411, "column": 24 }, "end": { - "line": 400, + "line": 411, "column": 46 } }, @@ -43538,29 +44782,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16745, - "end": 16762, + "start": 16986, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 49 }, "end": { - "line": 400, + "line": 411, "column": 66 } }, "object": { "type": "Identifier", - "start": 16745, - "end": 16750, + "start": 16986, + "end": 16991, "loc": { "start": { - "line": 400, + "line": 411, "column": 49 }, "end": { - "line": 400, + "line": 411, "column": 54 }, "identifierName": "stats" @@ -43569,15 +44813,15 @@ }, "property": { "type": "Identifier", - "start": 16751, - "end": 16762, + "start": 16992, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 55 }, "end": { - "line": 400, + "line": 411, "column": 66 }, "identifierName": "numTextures" @@ -43592,43 +44836,43 @@ }, { "type": "ExpressionStatement", - "start": 16785, - "end": 16839, + "start": 17026, + "end": 17080, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 74 } }, "expression": { "type": "CallExpression", - "start": 16785, - "end": 16838, + "start": 17026, + "end": 17079, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 73 } }, "callee": { "type": "Identifier", - "start": 16785, - "end": 16788, + "start": 17026, + "end": 17029, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 23 }, "identifierName": "log" @@ -43638,29 +44882,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16789, - "end": 16837, + "start": 17030, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 24 }, "end": { - "line": 401, + "line": 412, "column": 72 } }, "left": { "type": "StringLiteral", - "start": 16789, - "end": 16814, + "start": 17030, + "end": 17055, "loc": { "start": { - "line": 401, + "line": 412, "column": 24 }, "end": { - "line": 401, + "line": 412, "column": 49 } }, @@ -43673,29 +44917,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16817, - "end": 16837, + "start": 17058, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 52 }, "end": { - "line": 401, + "line": 412, "column": 72 } }, "object": { "type": "Identifier", - "start": 16817, - "end": 16822, + "start": 17058, + "end": 17063, "loc": { "start": { - "line": 401, + "line": 412, "column": 52 }, "end": { - "line": 401, + "line": 412, "column": 57 }, "identifierName": "stats" @@ -43704,15 +44948,15 @@ }, "property": { "type": "Identifier", - "start": 16823, - "end": 16837, + "start": 17064, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 58 }, "end": { - "line": 401, + "line": 412, "column": 72 }, "identifierName": "numTextureSets" @@ -43727,43 +44971,43 @@ }, { "type": "ExpressionStatement", - "start": 16860, - "end": 16910, + "start": 17101, + "end": 17151, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 70 } }, "expression": { "type": "CallExpression", - "start": 16860, - "end": 16909, + "start": 17101, + "end": 17150, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 69 } }, "callee": { "type": "Identifier", - "start": 16860, - "end": 16863, + "start": 17101, + "end": 17104, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 23 }, "identifierName": "log" @@ -43773,29 +45017,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16864, - "end": 16908, + "start": 17105, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 24 }, "end": { - "line": 402, + "line": 413, "column": 68 } }, "left": { "type": "StringLiteral", - "start": 16864, - "end": 16887, + "start": 17105, + "end": 17128, "loc": { "start": { - "line": 402, + "line": 413, "column": 24 }, "end": { - "line": 402, + "line": 413, "column": 47 } }, @@ -43808,29 +45052,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16890, - "end": 16908, + "start": 17131, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 50 }, "end": { - "line": 402, + "line": 413, "column": 68 } }, "object": { "type": "Identifier", - "start": 16890, - "end": 16895, + "start": 17131, + "end": 17136, "loc": { "start": { - "line": 402, + "line": 413, "column": 50 }, "end": { - "line": 402, + "line": 413, "column": 55 }, "identifierName": "stats" @@ -43839,15 +45083,15 @@ }, "property": { "type": "Identifier", - "start": 16896, - "end": 16908, + "start": 17137, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 56 }, "end": { - "line": 402, + "line": 413, "column": 68 }, "identifierName": "numTriangles" @@ -43862,43 +45106,43 @@ }, { "type": "ExpressionStatement", - "start": 16931, - "end": 16979, + "start": 17172, + "end": 17220, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 68 } }, "expression": { "type": "CallExpression", - "start": 16931, - "end": 16978, + "start": 17172, + "end": 17219, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 67 } }, "callee": { "type": "Identifier", - "start": 16931, - "end": 16934, + "start": 17172, + "end": 17175, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 23 }, "identifierName": "log" @@ -43908,29 +45152,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 16935, - "end": 16977, + "start": 17176, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 24 }, "end": { - "line": 403, + "line": 414, "column": 66 } }, "left": { "type": "StringLiteral", - "start": 16935, - "end": 16957, + "start": 17176, + "end": 17198, "loc": { "start": { - "line": 403, + "line": 414, "column": 24 }, "end": { - "line": 403, + "line": 414, "column": 46 } }, @@ -43943,29 +45187,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 16960, - "end": 16977, + "start": 17201, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 49 }, "end": { - "line": 403, + "line": 414, "column": 66 } }, "object": { "type": "Identifier", - "start": 16960, - "end": 16965, + "start": 17201, + "end": 17206, "loc": { "start": { - "line": 403, + "line": 414, "column": 49 }, "end": { - "line": 403, + "line": 414, "column": 54 }, "identifierName": "stats" @@ -43974,15 +45218,15 @@ }, "property": { "type": "Identifier", - "start": 16966, - "end": 16977, + "start": 17207, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 55 }, "end": { - "line": 403, + "line": 414, "column": 66 }, "identifierName": "numVertices" @@ -43997,43 +45241,43 @@ }, { "type": "ExpressionStatement", - "start": 17000, - "end": 17038, + "start": 17241, + "end": 17279, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 58 } }, "expression": { "type": "CallExpression", - "start": 17000, - "end": 17037, + "start": 17241, + "end": 17278, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 57 } }, "callee": { "type": "Identifier", - "start": 17000, - "end": 17003, + "start": 17241, + "end": 17244, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 23 }, "identifierName": "log" @@ -44043,29 +45287,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17004, - "end": 17036, + "start": 17245, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 24 }, "end": { - "line": 404, + "line": 415, "column": 56 } }, "left": { "type": "StringLiteral", - "start": 17004, - "end": 17021, + "start": 17245, + "end": 17262, "loc": { "start": { - "line": 404, + "line": 415, "column": 24 }, "end": { - "line": 404, + "line": 415, "column": 41 } }, @@ -44078,29 +45322,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17024, - "end": 17036, + "start": 17265, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 44 }, "end": { - "line": 404, + "line": 415, "column": 56 } }, "object": { "type": "Identifier", - "start": 17024, - "end": 17029, + "start": 17265, + "end": 17270, "loc": { "start": { - "line": 404, + "line": 415, "column": 44 }, "end": { - "line": 404, + "line": 415, "column": 49 }, "identifierName": "stats" @@ -44109,15 +45353,15 @@ }, "property": { "type": "Identifier", - "start": 17030, - "end": 17036, + "start": 17271, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 50 }, "end": { - "line": 404, + "line": 415, "column": 56 }, "identifierName": "numUVs" @@ -44132,43 +45376,43 @@ }, { "type": "ExpressionStatement", - "start": 17059, - "end": 17105, + "start": 17300, + "end": 17346, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 66 } }, "expression": { "type": "CallExpression", - "start": 17059, - "end": 17104, + "start": 17300, + "end": 17345, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 65 } }, "callee": { "type": "Identifier", - "start": 17059, - "end": 17062, + "start": 17300, + "end": 17303, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 23 }, "identifierName": "log" @@ -44178,29 +45422,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17063, - "end": 17103, + "start": 17304, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 24 }, "end": { - "line": 405, + "line": 416, "column": 64 } }, "left": { "type": "StringLiteral", - "start": 17063, - "end": 17084, + "start": 17304, + "end": 17325, "loc": { "start": { - "line": 405, + "line": 416, "column": 24 }, "end": { - "line": 405, + "line": 416, "column": 45 } }, @@ -44213,29 +45457,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17087, - "end": 17103, + "start": 17328, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 48 }, "end": { - "line": 405, + "line": 416, "column": 64 } }, "object": { "type": "Identifier", - "start": 17087, - "end": 17092, + "start": 17328, + "end": 17333, "loc": { "start": { - "line": 405, + "line": 416, "column": 48 }, "end": { - "line": 405, + "line": 416, "column": 53 }, "identifierName": "stats" @@ -44244,15 +45488,15 @@ }, "property": { "type": "Identifier", - "start": 17093, - "end": 17103, + "start": 17334, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 54 }, "end": { - "line": 405, + "line": 416, "column": 64 }, "identifierName": "numNormals" @@ -44267,43 +45511,43 @@ }, { "type": "ExpressionStatement", - "start": 17126, - "end": 17179, + "start": 17367, + "end": 17420, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 73 } }, "expression": { "type": "CallExpression", - "start": 17126, - "end": 17178, + "start": 17367, + "end": 17419, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 72 } }, "callee": { "type": "Identifier", - "start": 17126, - "end": 17129, + "start": 17367, + "end": 17370, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 23 }, "identifierName": "log" @@ -44313,29 +45557,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17130, - "end": 17177, + "start": 17371, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 24 }, "end": { - "line": 406, + "line": 417, "column": 71 } }, "left": { "type": "StringLiteral", - "start": 17130, - "end": 17149, + "start": 17371, + "end": 17390, "loc": { "start": { - "line": 406, + "line": 417, "column": 24 }, "end": { - "line": 406, + "line": 417, "column": 43 } }, @@ -44348,43 +45592,43 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17152, - "end": 17177, + "start": 17393, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 71 } }, "object": { "type": "MemberExpression", - "start": 17152, - "end": 17170, + "start": 17393, + "end": 17411, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 64 } }, "object": { "type": "Identifier", - "start": 17152, - "end": 17160, + "start": 17393, + "end": 17401, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 54 }, "identifierName": "xktModel" @@ -44393,15 +45637,15 @@ }, "property": { "type": "Identifier", - "start": 17161, - "end": 17170, + "start": 17402, + "end": 17411, "loc": { "start": { - "line": 406, + "line": 417, "column": 55 }, "end": { - "line": 406, + "line": 417, "column": 64 }, "identifierName": "tilesList" @@ -44412,15 +45656,15 @@ }, "property": { "type": "Identifier", - "start": 17171, - "end": 17177, + "start": 17412, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 65 }, "end": { - "line": 406, + "line": 417, "column": 71 }, "identifierName": "length" @@ -44435,43 +45679,43 @@ }, { "type": "ExpressionStatement", - "start": 17200, - "end": 17241, + "start": 17441, + "end": 17482, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 17200, - "end": 17240, + "start": 17441, + "end": 17481, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 60 } }, "callee": { "type": "Identifier", - "start": 17200, - "end": 17203, + "start": 17441, + "end": 17444, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 23 }, "identifierName": "log" @@ -44481,29 +45725,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17204, - "end": 17239, + "start": 17445, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 24 }, "end": { - "line": 407, + "line": 418, "column": 59 } }, "left": { "type": "StringLiteral", - "start": 17204, - "end": 17219, + "start": 17445, + "end": 17460, "loc": { "start": { - "line": 407, + "line": 418, "column": 24 }, "end": { - "line": 407, + "line": 418, "column": 39 } }, @@ -44516,29 +45760,29 @@ "operator": "+", "right": { "type": "MemberExpression", - "start": 17222, - "end": 17239, + "start": 17463, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 42 }, "end": { - "line": 407, + "line": 418, "column": 59 } }, "object": { "type": "Identifier", - "start": 17222, - "end": 17227, + "start": 17463, + "end": 17468, "loc": { "start": { - "line": 407, + "line": 418, "column": 42 }, "end": { - "line": 407, + "line": 418, "column": 47 }, "identifierName": "stats" @@ -44547,15 +45791,15 @@ }, "property": { "type": "Identifier", - "start": 17228, - "end": 17239, + "start": 17469, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 48 }, "end": { - "line": 407, + "line": 418, "column": 59 }, "identifierName": "minTileSize" @@ -44570,29 +45814,29 @@ }, { "type": "IfStatement", - "start": 17263, - "end": 17659, + "start": 17504, + "end": 17900, "loc": { "start": { - "line": 409, + "line": 420, "column": 20 }, "end": { - "line": 416, + "line": 427, "column": 21 } }, "test": { "type": "Identifier", - "start": 17267, - "end": 17273, + "start": 17508, + "end": 17514, "loc": { "start": { - "line": 409, + "line": 420, "column": 24 }, "end": { - "line": 409, + "line": 420, "column": 30 }, "identifierName": "output" @@ -44601,59 +45845,59 @@ }, "consequent": { "type": "BlockStatement", - "start": 17275, - "end": 17659, + "start": 17516, + "end": 17900, "loc": { "start": { - "line": 409, + "line": 420, "column": 32 }, "end": { - "line": 416, + "line": 427, "column": 21 } }, "body": [ { "type": "VariableDeclaration", - "start": 17301, - "end": 17340, + "start": 17542, + "end": 17581, "loc": { "start": { - "line": 410, + "line": 421, "column": 24 }, "end": { - "line": 410, + "line": 421, "column": 63 } }, "declarations": [ { "type": "VariableDeclarator", - "start": 17307, - "end": 17339, + "start": 17548, + "end": 17580, "loc": { "start": { - "line": 410, + "line": 421, "column": 30 }, "end": { - "line": 410, + "line": 421, "column": 62 } }, "id": { "type": "Identifier", - "start": 17307, - "end": 17316, + "start": 17548, + "end": 17557, "loc": { "start": { - "line": 410, + "line": 421, "column": 30 }, "end": { - "line": 410, + "line": 421, "column": 39 }, "identifierName": "outputDir" @@ -44662,43 +45906,43 @@ }, "init": { "type": "CallExpression", - "start": 17319, - "end": 17339, + "start": 17560, + "end": 17580, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 62 } }, "callee": { "type": "MemberExpression", - "start": 17319, - "end": 17331, + "start": 17560, + "end": 17572, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 54 } }, "object": { "type": "Identifier", - "start": 17319, - "end": 17323, + "start": 17560, + "end": 17564, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 46 }, "identifierName": "path" @@ -44707,15 +45951,15 @@ }, "property": { "type": "Identifier", - "start": 17324, - "end": 17331, + "start": 17565, + "end": 17572, "loc": { "start": { - "line": 410, + "line": 421, "column": 47 }, "end": { - "line": 410, + "line": 421, "column": 54 }, "identifierName": "dirname" @@ -44727,15 +45971,15 @@ "arguments": [ { "type": "Identifier", - "start": 17332, - "end": 17338, + "start": 17573, + "end": 17579, "loc": { "start": { - "line": 410, + "line": 421, "column": 55 }, "end": { - "line": 410, + "line": 421, "column": 61 }, "identifierName": "output" @@ -44750,57 +45994,57 @@ }, { "type": "IfStatement", - "start": 17365, - "end": 17515, + "start": 17606, + "end": 17756, "loc": { "start": { - "line": 411, + "line": 422, "column": 24 }, "end": { - "line": 413, + "line": 424, "column": 25 } }, "test": { "type": "LogicalExpression", - "start": 17369, - "end": 17414, + "start": 17610, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, "left": { "type": "BinaryExpression", - "start": 17369, - "end": 17385, + "start": 17610, + "end": 17626, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 44 } }, "left": { "type": "Identifier", - "start": 17369, - "end": 17378, + "start": 17610, + "end": 17619, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 37 }, "identifierName": "outputDir" @@ -44810,15 +46054,15 @@ "operator": "!==", "right": { "type": "StringLiteral", - "start": 17383, - "end": 17385, + "start": 17624, + "end": 17626, "loc": { "start": { - "line": 411, + "line": 422, "column": 42 }, "end": { - "line": 411, + "line": 422, "column": 44 } }, @@ -44832,15 +46076,15 @@ "operator": "&&", "right": { "type": "UnaryExpression", - "start": 17389, - "end": 17414, + "start": 17630, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 48 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, @@ -44848,43 +46092,43 @@ "prefix": true, "argument": { "type": "CallExpression", - "start": 17390, - "end": 17414, + "start": 17631, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 73 } }, "callee": { "type": "MemberExpression", - "start": 17390, - "end": 17403, + "start": 17631, + "end": 17644, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 62 } }, "object": { "type": "Identifier", - "start": 17390, - "end": 17392, + "start": 17631, + "end": 17633, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 51 }, "identifierName": "fs" @@ -44893,15 +46137,15 @@ }, "property": { "type": "Identifier", - "start": 17393, - "end": 17403, + "start": 17634, + "end": 17644, "loc": { "start": { - "line": 411, + "line": 422, "column": 52 }, "end": { - "line": 411, + "line": 422, "column": 62 }, "identifierName": "existsSync" @@ -44913,15 +46157,15 @@ "arguments": [ { "type": "Identifier", - "start": 17404, - "end": 17413, + "start": 17645, + "end": 17654, "loc": { "start": { - "line": 411, + "line": 422, "column": 63 }, "end": { - "line": 411, + "line": 422, "column": 72 }, "identifierName": "outputDir" @@ -44937,72 +46181,72 @@ }, "consequent": { "type": "BlockStatement", - "start": 17416, - "end": 17515, + "start": 17657, + "end": 17756, "loc": { "start": { - "line": 411, + "line": 422, "column": 75 }, "end": { - "line": 413, + "line": 424, "column": 25 } }, "body": [ { "type": "ExpressionStatement", - "start": 17446, - "end": 17489, + "start": 17687, + "end": 17730, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 71 } }, "expression": { "type": "CallExpression", - "start": 17446, - "end": 17488, + "start": 17687, + "end": 17729, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 70 } }, "callee": { "type": "MemberExpression", - "start": 17446, - "end": 17458, + "start": 17687, + "end": 17699, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 40 } }, "object": { "type": "Identifier", - "start": 17446, - "end": 17448, + "start": 17687, + "end": 17689, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 30 }, "identifierName": "fs" @@ -45011,15 +46255,15 @@ }, "property": { "type": "Identifier", - "start": 17449, - "end": 17458, + "start": 17690, + "end": 17699, "loc": { "start": { - "line": 412, + "line": 423, "column": 31 }, "end": { - "line": 412, + "line": 423, "column": 40 }, "identifierName": "mkdirSync" @@ -45031,15 +46275,15 @@ "arguments": [ { "type": "Identifier", - "start": 17459, - "end": 17468, + "start": 17700, + "end": 17709, "loc": { "start": { - "line": 412, + "line": 423, "column": 41 }, "end": { - "line": 412, + "line": 423, "column": 50 }, "identifierName": "outputDir" @@ -45048,30 +46292,30 @@ }, { "type": "ObjectExpression", - "start": 17470, - "end": 17487, + "start": 17711, + "end": 17728, "loc": { "start": { - "line": 412, + "line": 423, "column": 52 }, "end": { - "line": 412, + "line": 423, "column": 69 } }, "properties": [ { "type": "ObjectProperty", - "start": 17471, - "end": 17486, + "start": 17712, + "end": 17727, "loc": { "start": { - "line": 412, + "line": 423, "column": 53 }, "end": { - "line": 412, + "line": 423, "column": 68 } }, @@ -45080,15 +46324,15 @@ "computed": false, "key": { "type": "Identifier", - "start": 17471, - "end": 17480, + "start": 17712, + "end": 17721, "loc": { "start": { - "line": 412, + "line": 423, "column": 53 }, "end": { - "line": 412, + "line": 423, "column": 62 }, "identifierName": "recursive" @@ -45097,15 +46341,15 @@ }, "value": { "type": "BooleanLiteral", - "start": 17482, - "end": 17486, + "start": 17723, + "end": 17727, "loc": { "start": { - "line": 412, + "line": 423, "column": 64 }, "end": { - "line": 412, + "line": 423, "column": 68 } }, @@ -45124,43 +46368,43 @@ }, { "type": "ExpressionStatement", - "start": 17540, - "end": 17575, + "start": 17781, + "end": 17816, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 59 } }, "expression": { "type": "CallExpression", - "start": 17540, - "end": 17574, + "start": 17781, + "end": 17815, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 58 } }, "callee": { "type": "Identifier", - "start": 17540, - "end": 17543, + "start": 17781, + "end": 17784, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 27 }, "identifierName": "log" @@ -45170,29 +46414,29 @@ "arguments": [ { "type": "BinaryExpression", - "start": 17544, - "end": 17573, + "start": 17785, + "end": 17814, "loc": { "start": { - "line": 414, + "line": 425, "column": 28 }, "end": { - "line": 414, + "line": 425, "column": 57 } }, "left": { "type": "StringLiteral", - "start": 17544, - "end": 17564, + "start": 17785, + "end": 17805, "loc": { "start": { - "line": 414, + "line": 425, "column": 28 }, "end": { - "line": 414, + "line": 425, "column": 48 } }, @@ -45205,15 +46449,15 @@ "operator": "+", "right": { "type": "Identifier", - "start": 17567, - "end": 17573, + "start": 17808, + "end": 17814, "loc": { "start": { - "line": 414, + "line": 425, "column": 51 }, "end": { - "line": 414, + "line": 425, "column": 57 }, "identifierName": "output" @@ -45226,57 +46470,57 @@ }, { "type": "ExpressionStatement", - "start": 17600, - "end": 17637, + "start": 17841, + "end": 17878, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 61 } }, "expression": { "type": "CallExpression", - "start": 17600, - "end": 17636, + "start": 17841, + "end": 17877, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 60 } }, "callee": { "type": "MemberExpression", - "start": 17600, - "end": 17616, + "start": 17841, + "end": 17857, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 40 } }, "object": { "type": "Identifier", - "start": 17600, - "end": 17602, + "start": 17841, + "end": 17843, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 26 }, "identifierName": "fs" @@ -45285,15 +46529,15 @@ }, "property": { "type": "Identifier", - "start": 17603, - "end": 17616, + "start": 17844, + "end": 17857, "loc": { "start": { - "line": 415, + "line": 426, "column": 27 }, "end": { - "line": 415, + "line": 426, "column": 40 }, "identifierName": "writeFileSync" @@ -45305,15 +46549,15 @@ "arguments": [ { "type": "Identifier", - "start": 17617, - "end": 17623, + "start": 17858, + "end": 17864, "loc": { "start": { - "line": 415, + "line": 426, "column": 41 }, "end": { - "line": 415, + "line": 426, "column": 47 }, "identifierName": "output" @@ -45322,15 +46566,15 @@ }, { "type": "Identifier", - "start": 17625, - "end": 17635, + "start": 17866, + "end": 17876, "loc": { "start": { - "line": 415, + "line": 426, "column": 49 }, "end": { - "line": 415, + "line": 426, "column": 59 }, "identifierName": "xktContent" @@ -45347,29 +46591,29 @@ }, { "type": "IfStatement", - "start": 17681, - "end": 17774, + "start": 17922, + "end": 18015, "loc": { "start": { - "line": 418, + "line": 429, "column": 20 }, "end": { - "line": 420, + "line": 431, "column": 21 } }, "test": { "type": "Identifier", - "start": 17685, - "end": 17699, + "start": 17926, + "end": 17940, "loc": { "start": { - "line": 418, + "line": 429, "column": 24 }, "end": { - "line": 418, + "line": 429, "column": 38 }, "identifierName": "outputXKTModel" @@ -45378,58 +46622,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17701, - "end": 17774, + "start": 17942, + "end": 18015, "loc": { "start": { - "line": 418, + "line": 429, "column": 40 }, "end": { - "line": 420, + "line": 431, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17727, - "end": 17752, + "start": 17968, + "end": 17993, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 49 } }, "expression": { "type": "CallExpression", - "start": 17727, - "end": 17751, + "start": 17968, + "end": 17992, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 48 } }, "callee": { "type": "Identifier", - "start": 17727, - "end": 17741, + "start": 17968, + "end": 17982, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 38 }, "identifierName": "outputXKTModel" @@ -45439,15 +46683,15 @@ "arguments": [ { "type": "Identifier", - "start": 17742, - "end": 17750, + "start": 17983, + "end": 17991, "loc": { "start": { - "line": 419, + "line": 430, "column": 39 }, "end": { - "line": 419, + "line": 430, "column": 47 }, "identifierName": "xktModel" @@ -45464,29 +46708,29 @@ }, { "type": "IfStatement", - "start": 17796, - "end": 17881, + "start": 18037, + "end": 18122, "loc": { "start": { - "line": 422, + "line": 433, "column": 20 }, "end": { - "line": 424, + "line": 435, "column": 21 } }, "test": { "type": "Identifier", - "start": 17800, - "end": 17809, + "start": 18041, + "end": 18050, "loc": { "start": { - "line": 422, + "line": 433, "column": 24 }, "end": { - "line": 422, + "line": 433, "column": 33 }, "identifierName": "outputXKT" @@ -45495,58 +46739,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17811, - "end": 17881, + "start": 18052, + "end": 18122, "loc": { "start": { - "line": 422, + "line": 433, "column": 35 }, "end": { - "line": 424, + "line": 435, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17837, - "end": 17859, + "start": 18078, + "end": 18100, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 46 } }, "expression": { "type": "CallExpression", - "start": 17837, - "end": 17858, + "start": 18078, + "end": 18099, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 45 } }, "callee": { "type": "Identifier", - "start": 17837, - "end": 17846, + "start": 18078, + "end": 18087, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 33 }, "identifierName": "outputXKT" @@ -45556,15 +46800,15 @@ "arguments": [ { "type": "Identifier", - "start": 17847, - "end": 17857, + "start": 18088, + "end": 18098, "loc": { "start": { - "line": 423, + "line": 434, "column": 34 }, "end": { - "line": 423, + "line": 434, "column": 44 }, "identifierName": "xktContent" @@ -45581,29 +46825,29 @@ }, { "type": "IfStatement", - "start": 17903, - "end": 17987, + "start": 18144, + "end": 18228, "loc": { "start": { - "line": 426, + "line": 437, "column": 20 }, "end": { - "line": 428, + "line": 439, "column": 21 } }, "test": { "type": "Identifier", - "start": 17907, - "end": 17918, + "start": 18148, + "end": 18159, "loc": { "start": { - "line": 426, + "line": 437, "column": 24 }, "end": { - "line": 426, + "line": 437, "column": 35 }, "identifierName": "outputStats" @@ -45612,58 +46856,58 @@ }, "consequent": { "type": "BlockStatement", - "start": 17920, - "end": 17987, + "start": 18161, + "end": 18228, "loc": { "start": { - "line": 426, + "line": 437, "column": 37 }, "end": { - "line": 428, + "line": 439, "column": 21 } }, "body": [ { "type": "ExpressionStatement", - "start": 17946, - "end": 17965, + "start": 18187, + "end": 18206, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 43 } }, "expression": { "type": "CallExpression", - "start": 17946, - "end": 17964, + "start": 18187, + "end": 18205, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 42 } }, "callee": { "type": "Identifier", - "start": 17946, - "end": 17957, + "start": 18187, + "end": 18198, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 35 }, "identifierName": "outputStats" @@ -45673,15 +46917,15 @@ "arguments": [ { "type": "Identifier", - "start": 17958, - "end": 17963, + "start": 18199, + "end": 18204, "loc": { "start": { - "line": 427, + "line": 438, "column": 36 }, "end": { - "line": 427, + "line": 438, "column": 41 }, "identifierName": "stats" @@ -45698,43 +46942,43 @@ }, { "type": "ExpressionStatement", - "start": 18009, - "end": 18019, + "start": 18250, + "end": 18260, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 30 } }, "expression": { "type": "CallExpression", - "start": 18009, - "end": 18018, + "start": 18250, + "end": 18259, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 29 } }, "callee": { "type": "Identifier", - "start": 18009, - "end": 18016, + "start": 18250, + "end": 18257, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 27 }, "identifierName": "resolve" @@ -45757,15 +47001,15 @@ }, { "type": "ArrowFunctionExpression", - "start": 18055, - "end": 18108, + "start": 18296, + "end": 18349, "loc": { "start": { - "line": 432, + "line": 443, "column": 15 }, "end": { - "line": 434, + "line": 445, "column": 13 } }, @@ -45776,15 +47020,15 @@ "params": [ { "type": "Identifier", - "start": 18056, - "end": 18059, + "start": 18297, + "end": 18300, "loc": { "start": { - "line": 432, + "line": 443, "column": 16 }, "end": { - "line": 432, + "line": 443, "column": 19 }, "identifierName": "err" @@ -45794,58 +47038,58 @@ ], "body": { "type": "BlockStatement", - "start": 18064, - "end": 18108, + "start": 18305, + "end": 18349, "loc": { "start": { - "line": 432, + "line": 443, "column": 24 }, "end": { - "line": 434, + "line": 445, "column": 13 } }, "body": [ { "type": "ExpressionStatement", - "start": 18082, - "end": 18094, + "start": 18323, + "end": 18335, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 28 } }, "expression": { "type": "CallExpression", - "start": 18082, - "end": 18093, + "start": 18323, + "end": 18334, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 27 } }, "callee": { "type": "Identifier", - "start": 18082, - "end": 18088, + "start": 18323, + "end": 18329, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 22 }, "identifierName": "reject" @@ -45855,15 +47099,15 @@ "arguments": [ { "type": "Identifier", - "start": 18089, - "end": 18092, + "start": 18330, + "end": 18333, "loc": { "start": { - "line": 433, + "line": 444, "column": 23 }, "end": { - "line": 433, + "line": 444, "column": 26 }, "identifierName": "err" @@ -45941,15 +47185,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -45957,15 +47201,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -45973,15 +47217,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -45989,15 +47233,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -46005,15 +47249,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -46021,15 +47265,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -46037,15 +47281,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -46053,15 +47297,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -46069,15 +47313,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -46085,15 +47329,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -46101,15 +47345,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -46117,15 +47361,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -46133,15 +47377,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -46149,15 +47393,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -46165,15 +47409,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -46181,15 +47425,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -46197,15 +47441,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -46213,15 +47457,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -46229,15 +47473,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -46245,15 +47489,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -46261,15 +47505,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -46277,15 +47521,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -53839,6 +55083,992 @@ } } }, + { + "type": { + "label": "function", + "keyword": "function", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "function", + "start": 6605, + "end": 6613, + "loc": { + "start": { + "line": 123, + "column": 4 + }, + "end": { + "line": 123, + "column": 12 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "getFileExtension", + "start": 6614, + "end": 6630, + "loc": { + "start": { + "line": 123, + "column": 13 + }, + "end": { + "line": 123, + "column": 29 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6630, + "end": 6631, + "loc": { + "start": { + "line": 123, + "column": 29 + }, + "end": { + "line": 123, + "column": 30 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "fileName", + "start": 6631, + "end": 6639, + "loc": { + "start": { + "line": 123, + "column": 30 + }, + "end": { + "line": 123, + "column": 38 + } + } + }, + { + "type": { + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6639, + "end": 6640, + "loc": { + "start": { + "line": 123, + "column": 38 + }, + "end": { + "line": 123, + "column": 39 + } + } + }, + { + "type": { + "label": "{", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6641, + "end": 6642, + "loc": { + "start": { + "line": 123, + "column": 40 + }, + "end": { + "line": 123, + "column": 41 + } + } + }, + { + "type": { + "label": "let", + "keyword": "let", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "let", + "start": 6650, + "end": 6653, + "loc": { + "start": { + "line": 124, + "column": 7 + }, + "end": { + "line": 124, + "column": 10 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "ext", + "start": 6654, + "end": 6657, + "loc": { + "start": { + "line": 124, + "column": 11 + }, + "end": { + "line": 124, + "column": 14 + } + } + }, + { + "type": { + "label": "=", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": true, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "=", + "start": 6658, + "end": 6659, + "loc": { + "start": { + "line": 124, + "column": 15 + }, + "end": { + "line": 124, + "column": 16 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "path", + "start": 6661, + "end": 6665, + "loc": { + "start": { + "line": 124, + "column": 18 + }, + "end": { + "line": 124, + "column": 22 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6665, + "end": 6666, + "loc": { + "start": { + "line": 124, + "column": 22 + }, + "end": { + "line": 124, + "column": 23 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "extname", + "start": 6666, + "end": 6673, + "loc": { + "start": { + "line": 124, + "column": 23 + }, + "end": { + "line": 124, + "column": 30 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6673, + "end": 6674, + "loc": { + "start": { + "line": 124, + "column": 30 + }, + "end": { + "line": 124, + "column": 31 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "source", + "start": 6674, + "end": 6680, + "loc": { + "start": { + "line": 124, + "column": 31 + }, + "end": { + "line": 124, + "column": 37 + } + } + }, + { + "type": { + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6680, + "end": 6681, + "loc": { + "start": { + "line": 124, + "column": 37 + }, + "end": { + "line": 124, + "column": 38 + } + } + }, + { + "type": { + "label": ";", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6681, + "end": 6682, + "loc": { + "start": { + "line": 124, + "column": 38 + }, + "end": { + "line": 124, + "column": 39 + } + } + }, + { + "type": { + "label": "if", + "keyword": "if", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "if", + "start": 6690, + "end": 6692, + "loc": { + "start": { + "line": 125, + "column": 7 + }, + "end": { + "line": 125, + "column": 9 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6693, + "end": 6694, + "loc": { + "start": { + "line": 125, + "column": 10 + }, + "end": { + "line": 125, + "column": 11 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "ext", + "start": 6694, + "end": 6697, + "loc": { + "start": { + "line": 125, + "column": 11 + }, + "end": { + "line": 125, + "column": 14 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6697, + "end": 6698, + "loc": { + "start": { + "line": 125, + "column": 14 + }, + "end": { + "line": 125, + "column": 15 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "charAt", + "start": 6698, + "end": 6704, + "loc": { + "start": { + "line": 125, + "column": 15 + }, + "end": { + "line": 125, + "column": 21 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6704, + "end": 6705, + "loc": { + "start": { + "line": 125, + "column": 21 + }, + "end": { + "line": 125, + "column": 22 + } + } + }, + { + "type": { + "label": "num", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": 0, + "start": 6705, + "end": 6706, + "loc": { + "start": { + "line": 125, + "column": 22 + }, + "end": { + "line": 125, + "column": 23 + } + } + }, + { + "type": { + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6706, + "end": 6707, + "loc": { + "start": { + "line": 125, + "column": 23 + }, + "end": { + "line": 125, + "column": 24 + } + } + }, + { + "type": { + "label": "==/!=", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": 6, + "updateContext": null + }, + "value": "===", + "start": 6708, + "end": 6711, + "loc": { + "start": { + "line": 125, + "column": 25 + }, + "end": { + "line": 125, + "column": 28 + } + } + }, + { + "type": { + "label": "string", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": ".", + "start": 6712, + "end": 6715, + "loc": { + "start": { + "line": 125, + "column": 29 + }, + "end": { + "line": 125, + "column": 32 + } + } + }, + { + "type": { + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6715, + "end": 6716, + "loc": { + "start": { + "line": 125, + "column": 32 + }, + "end": { + "line": 125, + "column": 33 + } + } + }, + { + "type": { + "label": "{", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6717, + "end": 6718, + "loc": { + "start": { + "line": 125, + "column": 34 + }, + "end": { + "line": 125, + "column": 35 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "ext", + "start": 6730, + "end": 6733, + "loc": { + "start": { + "line": 126, + "column": 11 + }, + "end": { + "line": 126, + "column": 14 + } + } + }, + { + "type": { + "label": "=", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": true, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "=", + "start": 6734, + "end": 6735, + "loc": { + "start": { + "line": 126, + "column": 15 + }, + "end": { + "line": 126, + "column": 16 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "ext", + "start": 6736, + "end": 6739, + "loc": { + "start": { + "line": 126, + "column": 17 + }, + "end": { + "line": 126, + "column": 20 + } + } + }, + { + "type": { + "label": ".", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6739, + "end": 6740, + "loc": { + "start": { + "line": 126, + "column": 20 + }, + "end": { + "line": 126, + "column": 21 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "substring", + "start": 6740, + "end": 6749, + "loc": { + "start": { + "line": 126, + "column": 21 + }, + "end": { + "line": 126, + "column": 30 + } + } + }, + { + "type": { + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6749, + "end": 6750, + "loc": { + "start": { + "line": 126, + "column": 30 + }, + "end": { + "line": 126, + "column": 31 + } + } + }, + { + "type": { + "label": "num", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": 1, + "start": 6750, + "end": 6751, + "loc": { + "start": { + "line": 126, + "column": 31 + }, + "end": { + "line": 126, + "column": 32 + } + } + }, + { + "type": { + "label": ")", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6751, + "end": 6752, + "loc": { + "start": { + "line": 126, + "column": 32 + }, + "end": { + "line": 126, + "column": 33 + } + } + }, + { + "type": { + "label": ";", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6752, + "end": 6753, + "loc": { + "start": { + "line": 126, + "column": 33 + }, + "end": { + "line": 126, + "column": 34 + } + } + }, + { + "type": { + "label": "}", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6761, + "end": 6762, + "loc": { + "start": { + "line": 127, + "column": 7 + }, + "end": { + "line": 127, + "column": 8 + } + } + }, { "type": { "label": "return", @@ -53854,15 +56084,120 @@ "updateContext": null }, "value": "return", - "start": 6605, - "end": 6611, + "start": 6770, + "end": 6776, "loc": { "start": { - "line": 123, + "line": 128, + "column": 7 + }, + "end": { + "line": 128, + "column": 13 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "ext", + "start": 6777, + "end": 6780, + "loc": { + "start": { + "line": 128, + "column": 14 + }, + "end": { + "line": 128, + "column": 17 + } + } + }, + { + "type": { + "label": ";", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 6780, + "end": 6781, + "loc": { + "start": { + "line": 128, + "column": 17 + }, + "end": { + "line": 128, + "column": 18 + } + } + }, + { + "type": { + "label": "}", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 6786, + "end": 6787, + "loc": { + "start": { + "line": 129, "column": 4 }, "end": { - "line": 123, + "line": 129, + "column": 5 + } + } + }, + { + "type": { + "label": "return", + "keyword": "return", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "return", + "start": 6793, + "end": 6799, + "loc": { + "start": { + "line": 131, + "column": 4 + }, + "end": { + "line": 131, "column": 10 } } @@ -53882,15 +56217,15 @@ "updateContext": null }, "value": "new", - "start": 6612, - "end": 6615, + "start": 6800, + "end": 6803, "loc": { "start": { - "line": 123, + "line": 131, "column": 11 }, "end": { - "line": 123, + "line": 131, "column": 14 } } @@ -53908,15 +56243,15 @@ "binop": null }, "value": "Promise", - "start": 6616, - "end": 6623, + "start": 6804, + "end": 6811, "loc": { "start": { - "line": 123, + "line": 131, "column": 15 }, "end": { - "line": 123, + "line": 131, "column": 22 } } @@ -53933,15 +56268,15 @@ "postfix": false, "binop": null }, - "start": 6623, - "end": 6624, + "start": 6811, + "end": 6812, "loc": { "start": { - "line": 123, + "line": 131, "column": 22 }, "end": { - "line": 123, + "line": 131, "column": 23 } } @@ -53960,15 +56295,15 @@ "binop": null }, "value": "function", - "start": 6624, - "end": 6632, + "start": 6812, + "end": 6820, "loc": { "start": { - "line": 123, + "line": 131, "column": 23 }, "end": { - "line": 123, + "line": 131, "column": 31 } } @@ -53985,15 +56320,15 @@ "postfix": false, "binop": null }, - "start": 6633, - "end": 6634, + "start": 6821, + "end": 6822, "loc": { "start": { - "line": 123, + "line": 131, "column": 32 }, "end": { - "line": 123, + "line": 131, "column": 33 } } @@ -54011,15 +56346,15 @@ "binop": null }, "value": "resolve", - "start": 6634, - "end": 6641, + "start": 6822, + "end": 6829, "loc": { "start": { - "line": 123, + "line": 131, "column": 33 }, "end": { - "line": 123, + "line": 131, "column": 40 } } @@ -54037,15 +56372,15 @@ "binop": null, "updateContext": null }, - "start": 6641, - "end": 6642, + "start": 6829, + "end": 6830, "loc": { "start": { - "line": 123, + "line": 131, "column": 40 }, "end": { - "line": 123, + "line": 131, "column": 41 } } @@ -54063,15 +56398,15 @@ "binop": null }, "value": "reject", - "start": 6643, - "end": 6649, + "start": 6831, + "end": 6837, "loc": { "start": { - "line": 123, + "line": 131, "column": 42 }, "end": { - "line": 123, + "line": 131, "column": 48 } } @@ -54088,15 +56423,15 @@ "postfix": false, "binop": null }, - "start": 6649, - "end": 6650, + "start": 6837, + "end": 6838, "loc": { "start": { - "line": 123, + "line": 131, "column": 48 }, "end": { - "line": 123, + "line": 131, "column": 49 } } @@ -54113,15 +56448,15 @@ "postfix": false, "binop": null }, - "start": 6651, - "end": 6652, + "start": 6839, + "end": 6840, "loc": { "start": { - "line": 123, + "line": 131, "column": 50 }, "end": { - "line": 123, + "line": 131, "column": 51 } } @@ -54141,15 +56476,15 @@ "updateContext": null }, "value": "const", - "start": 6661, - "end": 6666, + "start": 6849, + "end": 6854, "loc": { "start": { - "line": 124, + "line": 132, "column": 8 }, "end": { - "line": 124, + "line": 132, "column": 13 } } @@ -54167,15 +56502,15 @@ "binop": null }, "value": "_log", - "start": 6667, - "end": 6671, + "start": 6855, + "end": 6859, "loc": { "start": { - "line": 124, + "line": 132, "column": 14 }, "end": { - "line": 124, + "line": 132, "column": 18 } } @@ -54194,15 +56529,15 @@ "updateContext": null }, "value": "=", - "start": 6672, - "end": 6673, + "start": 6860, + "end": 6861, "loc": { "start": { - "line": 124, + "line": 132, "column": 19 }, "end": { - "line": 124, + "line": 132, "column": 20 } } @@ -54220,15 +56555,15 @@ "binop": null }, "value": "log", - "start": 6674, - "end": 6677, + "start": 6862, + "end": 6865, "loc": { "start": { - "line": 124, + "line": 132, "column": 21 }, "end": { - "line": 124, + "line": 132, "column": 24 } } @@ -54246,15 +56581,15 @@ "binop": null, "updateContext": null }, - "start": 6677, - "end": 6678, + "start": 6865, + "end": 6866, "loc": { "start": { - "line": 124, + "line": 132, "column": 24 }, "end": { - "line": 124, + "line": 132, "column": 25 } } @@ -54272,15 +56607,15 @@ "binop": null }, "value": "log", - "start": 6687, - "end": 6690, + "start": 6875, + "end": 6878, "loc": { "start": { - "line": 125, + "line": 133, "column": 8 }, "end": { - "line": 125, + "line": 133, "column": 11 } } @@ -54299,15 +56634,15 @@ "updateContext": null }, "value": "=", - "start": 6691, - "end": 6692, + "start": 6879, + "end": 6880, "loc": { "start": { - "line": 125, + "line": 133, "column": 12 }, "end": { - "line": 125, + "line": 133, "column": 13 } } @@ -54324,15 +56659,15 @@ "postfix": false, "binop": null }, - "start": 6693, - "end": 6694, + "start": 6881, + "end": 6882, "loc": { "start": { - "line": 125, + "line": 133, "column": 14 }, "end": { - "line": 125, + "line": 133, "column": 15 } } @@ -54350,15 +56685,15 @@ "binop": null }, "value": "msg", - "start": 6694, - "end": 6697, + "start": 6882, + "end": 6885, "loc": { "start": { - "line": 125, + "line": 133, "column": 15 }, "end": { - "line": 125, + "line": 133, "column": 18 } } @@ -54375,15 +56710,15 @@ "postfix": false, "binop": null }, - "start": 6697, - "end": 6698, + "start": 6885, + "end": 6886, "loc": { "start": { - "line": 125, + "line": 133, "column": 18 }, "end": { - "line": 125, + "line": 133, "column": 19 } } @@ -54401,15 +56736,15 @@ "binop": null, "updateContext": null }, - "start": 6699, - "end": 6701, + "start": 6887, + "end": 6889, "loc": { "start": { - "line": 125, + "line": 133, "column": 20 }, "end": { - "line": 125, + "line": 133, "column": 22 } } @@ -54426,15 +56761,15 @@ "postfix": false, "binop": null }, - "start": 6702, - "end": 6703, + "start": 6890, + "end": 6891, "loc": { "start": { - "line": 125, + "line": 133, "column": 23 }, "end": { - "line": 125, + "line": 133, "column": 24 } } @@ -54452,15 +56787,15 @@ "binop": null }, "value": "_log", - "start": 6716, - "end": 6720, + "start": 6904, + "end": 6908, "loc": { "start": { - "line": 126, + "line": 134, "column": 12 }, "end": { - "line": 126, + "line": 134, "column": 16 } } @@ -54477,15 +56812,15 @@ "postfix": false, "binop": null }, - "start": 6720, - "end": 6721, + "start": 6908, + "end": 6909, "loc": { "start": { - "line": 126, + "line": 134, "column": 16 }, "end": { - "line": 126, + "line": 134, "column": 17 } } @@ -54502,15 +56837,15 @@ "postfix": false, "binop": null }, - "start": 6721, - "end": 6722, + "start": 6909, + "end": 6910, "loc": { "start": { - "line": 126, + "line": 134, "column": 17 }, "end": { - "line": 126, + "line": 134, "column": 18 } } @@ -54529,15 +56864,15 @@ "updateContext": null }, "value": "[convert2xkt] ", - "start": 6722, - "end": 6736, + "start": 6910, + "end": 6924, "loc": { "start": { - "line": 126, + "line": 134, "column": 18 }, "end": { - "line": 126, + "line": 134, "column": 32 } } @@ -54554,15 +56889,15 @@ "postfix": false, "binop": null }, - "start": 6736, - "end": 6738, + "start": 6924, + "end": 6926, "loc": { "start": { - "line": 126, + "line": 134, "column": 32 }, "end": { - "line": 126, + "line": 134, "column": 34 } } @@ -54580,15 +56915,15 @@ "binop": null }, "value": "msg", - "start": 6738, - "end": 6741, + "start": 6926, + "end": 6929, "loc": { "start": { - "line": 126, + "line": 134, "column": 34 }, "end": { - "line": 126, + "line": 134, "column": 37 } } @@ -54605,15 +56940,15 @@ "postfix": false, "binop": null }, - "start": 6741, - "end": 6742, + "start": 6929, + "end": 6930, "loc": { "start": { - "line": 126, + "line": 134, "column": 37 }, "end": { - "line": 126, + "line": 134, "column": 38 } } @@ -54632,15 +56967,15 @@ "updateContext": null }, "value": "", - "start": 6742, - "end": 6742, + "start": 6930, + "end": 6930, "loc": { "start": { - "line": 126, + "line": 134, "column": 38 }, "end": { - "line": 126, + "line": 134, "column": 38 } } @@ -54657,15 +56992,15 @@ "postfix": false, "binop": null }, - "start": 6742, - "end": 6743, + "start": 6930, + "end": 6931, "loc": { "start": { - "line": 126, + "line": 134, "column": 38 }, "end": { - "line": 126, + "line": 134, "column": 39 } } @@ -54682,15 +57017,15 @@ "postfix": false, "binop": null }, - "start": 6743, - "end": 6744, + "start": 6931, + "end": 6932, "loc": { "start": { - "line": 126, + "line": 134, "column": 39 }, "end": { - "line": 126, + "line": 134, "column": 40 } } @@ -54707,15 +57042,15 @@ "postfix": false, "binop": null }, - "start": 6753, - "end": 6754, + "start": 6941, + "end": 6942, "loc": { "start": { - "line": 127, + "line": 135, "column": 8 }, "end": { - "line": 127, + "line": 135, "column": 9 } } @@ -54735,15 +57070,15 @@ "updateContext": null }, "value": "if", - "start": 6764, - "end": 6766, + "start": 6952, + "end": 6954, "loc": { "start": { - "line": 129, + "line": 137, "column": 8 }, "end": { - "line": 129, + "line": 137, "column": 10 } } @@ -54760,15 +57095,15 @@ "postfix": false, "binop": null }, - "start": 6767, - "end": 6768, + "start": 6955, + "end": 6956, "loc": { "start": { - "line": 129, + "line": 137, "column": 11 }, "end": { - "line": 129, + "line": 137, "column": 12 } } @@ -54787,15 +57122,15 @@ "updateContext": null }, "value": "!", - "start": 6768, - "end": 6769, + "start": 6956, + "end": 6957, "loc": { "start": { - "line": 129, + "line": 137, "column": 12 }, "end": { - "line": 129, + "line": 137, "column": 13 } } @@ -54813,15 +57148,15 @@ "binop": null }, "value": "source", - "start": 6769, - "end": 6775, + "start": 6957, + "end": 6963, "loc": { "start": { - "line": 129, + "line": 137, "column": 13 }, "end": { - "line": 129, + "line": 137, "column": 19 } } @@ -54840,15 +57175,15 @@ "updateContext": null }, "value": "&&", - "start": 6776, - "end": 6778, + "start": 6964, + "end": 6966, "loc": { "start": { - "line": 129, + "line": 137, "column": 20 }, "end": { - "line": 129, + "line": 137, "column": 22 } } @@ -54867,15 +57202,15 @@ "updateContext": null }, "value": "!", - "start": 6779, - "end": 6780, + "start": 6967, + "end": 6968, "loc": { "start": { - "line": 129, + "line": 137, "column": 23 }, "end": { - "line": 129, + "line": 137, "column": 24 } } @@ -54893,15 +57228,15 @@ "binop": null }, "value": "sourceData", - "start": 6780, - "end": 6790, + "start": 6968, + "end": 6978, "loc": { "start": { - "line": 129, + "line": 137, "column": 24 }, "end": { - "line": 129, + "line": 137, "column": 34 } } @@ -54918,15 +57253,15 @@ "postfix": false, "binop": null }, - "start": 6790, - "end": 6791, + "start": 6978, + "end": 6979, "loc": { "start": { - "line": 129, + "line": 137, "column": 34 }, "end": { - "line": 129, + "line": 137, "column": 35 } } @@ -54943,15 +57278,15 @@ "postfix": false, "binop": null }, - "start": 6792, - "end": 6793, + "start": 6980, + "end": 6981, "loc": { "start": { - "line": 129, + "line": 137, "column": 36 }, "end": { - "line": 129, + "line": 137, "column": 37 } } @@ -54969,15 +57304,15 @@ "binop": null }, "value": "reject", - "start": 6806, - "end": 6812, + "start": 6994, + "end": 7000, "loc": { "start": { - "line": 130, + "line": 138, "column": 12 }, "end": { - "line": 130, + "line": 138, "column": 18 } } @@ -54994,15 +57329,15 @@ "postfix": false, "binop": null }, - "start": 6812, - "end": 6813, + "start": 7000, + "end": 7001, "loc": { "start": { - "line": 130, + "line": 138, "column": 18 }, "end": { - "line": 130, + "line": 138, "column": 19 } } @@ -55021,15 +57356,15 @@ "updateContext": null }, "value": "Argument expected: source or sourceData", - "start": 6813, - "end": 6854, + "start": 7001, + "end": 7042, "loc": { "start": { - "line": 130, + "line": 138, "column": 19 }, "end": { - "line": 130, + "line": 138, "column": 60 } } @@ -55046,15 +57381,15 @@ "postfix": false, "binop": null }, - "start": 6854, - "end": 6855, + "start": 7042, + "end": 7043, "loc": { "start": { - "line": 130, + "line": 138, "column": 60 }, "end": { - "line": 130, + "line": 138, "column": 61 } } @@ -55072,15 +57407,15 @@ "binop": null, "updateContext": null }, - "start": 6855, - "end": 6856, + "start": 7043, + "end": 7044, "loc": { "start": { - "line": 130, + "line": 138, "column": 61 }, "end": { - "line": 130, + "line": 138, "column": 62 } } @@ -55100,15 +57435,15 @@ "updateContext": null }, "value": "return", - "start": 6869, - "end": 6875, + "start": 7057, + "end": 7063, "loc": { "start": { - "line": 131, + "line": 139, "column": 12 }, "end": { - "line": 131, + "line": 139, "column": 18 } } @@ -55126,15 +57461,15 @@ "binop": null, "updateContext": null }, - "start": 6875, - "end": 6876, + "start": 7063, + "end": 7064, "loc": { "start": { - "line": 131, + "line": 139, "column": 18 }, "end": { - "line": 131, + "line": 139, "column": 19 } } @@ -55151,15 +57486,15 @@ "postfix": false, "binop": null }, - "start": 6885, - "end": 6886, + "start": 7073, + "end": 7074, "loc": { "start": { - "line": 132, + "line": 140, "column": 8 }, "end": { - "line": 132, + "line": 140, "column": 9 } } @@ -55179,15 +57514,15 @@ "updateContext": null }, "value": "if", - "start": 6896, - "end": 6898, + "start": 7084, + "end": 7086, "loc": { "start": { - "line": 134, + "line": 142, "column": 8 }, "end": { - "line": 134, + "line": 142, "column": 10 } } @@ -55204,15 +57539,15 @@ "postfix": false, "binop": null }, - "start": 6899, - "end": 6900, + "start": 7087, + "end": 7088, "loc": { "start": { - "line": 134, + "line": 142, "column": 11 }, "end": { - "line": 134, + "line": 142, "column": 12 } } @@ -55231,15 +57566,15 @@ "updateContext": null }, "value": "!", - "start": 6900, - "end": 6901, + "start": 7088, + "end": 7089, "loc": { "start": { - "line": 134, + "line": 142, "column": 12 }, "end": { - "line": 134, + "line": 142, "column": 13 } } @@ -55257,15 +57592,15 @@ "binop": null }, "value": "sourceFormat", - "start": 6901, - "end": 6913, + "start": 7089, + "end": 7101, "loc": { "start": { - "line": 134, + "line": 142, "column": 13 }, "end": { - "line": 134, + "line": 142, "column": 25 } } @@ -55284,15 +57619,15 @@ "updateContext": null }, "value": "&&", - "start": 6914, - "end": 6916, + "start": 7102, + "end": 7104, "loc": { "start": { - "line": 134, + "line": 142, "column": 26 }, "end": { - "line": 134, + "line": 142, "column": 28 } } @@ -55310,15 +57645,15 @@ "binop": null }, "value": "sourceData", - "start": 6917, - "end": 6927, + "start": 7105, + "end": 7115, "loc": { "start": { - "line": 134, + "line": 142, "column": 29 }, "end": { - "line": 134, + "line": 142, "column": 39 } } @@ -55335,15 +57670,15 @@ "postfix": false, "binop": null }, - "start": 6927, - "end": 6928, + "start": 7115, + "end": 7116, "loc": { "start": { - "line": 134, + "line": 142, "column": 39 }, "end": { - "line": 134, + "line": 142, "column": 40 } } @@ -55360,15 +57695,15 @@ "postfix": false, "binop": null }, - "start": 6929, - "end": 6930, + "start": 7117, + "end": 7118, "loc": { "start": { - "line": 134, + "line": 142, "column": 41 }, "end": { - "line": 134, + "line": 142, "column": 42 } } @@ -55386,15 +57721,15 @@ "binop": null }, "value": "reject", - "start": 6943, - "end": 6949, + "start": 7131, + "end": 7137, "loc": { "start": { - "line": 135, + "line": 143, "column": 12 }, "end": { - "line": 135, + "line": 143, "column": 18 } } @@ -55411,15 +57746,15 @@ "postfix": false, "binop": null }, - "start": 6949, - "end": 6950, + "start": 7137, + "end": 7138, "loc": { "start": { - "line": 135, + "line": 143, "column": 18 }, "end": { - "line": 135, + "line": 143, "column": 19 } } @@ -55438,15 +57773,15 @@ "updateContext": null }, "value": "Argument expected: sourceFormat is required with sourceData", - "start": 6950, - "end": 7011, + "start": 7138, + "end": 7199, "loc": { "start": { - "line": 135, + "line": 143, "column": 19 }, "end": { - "line": 135, + "line": 143, "column": 80 } } @@ -55463,15 +57798,15 @@ "postfix": false, "binop": null }, - "start": 7011, - "end": 7012, + "start": 7199, + "end": 7200, "loc": { "start": { - "line": 135, + "line": 143, "column": 80 }, "end": { - "line": 135, + "line": 143, "column": 81 } } @@ -55489,15 +57824,15 @@ "binop": null, "updateContext": null }, - "start": 7012, - "end": 7013, + "start": 7200, + "end": 7201, "loc": { "start": { - "line": 135, + "line": 143, "column": 81 }, "end": { - "line": 135, + "line": 143, "column": 82 } } @@ -55517,15 +57852,15 @@ "updateContext": null }, "value": "return", - "start": 7026, - "end": 7032, + "start": 7214, + "end": 7220, "loc": { "start": { - "line": 136, + "line": 144, "column": 12 }, "end": { - "line": 136, + "line": 144, "column": 18 } } @@ -55543,15 +57878,15 @@ "binop": null, "updateContext": null }, - "start": 7032, - "end": 7033, + "start": 7220, + "end": 7221, "loc": { "start": { - "line": 136, + "line": 144, "column": 18 }, "end": { - "line": 136, + "line": 144, "column": 19 } } @@ -55568,15 +57903,15 @@ "postfix": false, "binop": null }, - "start": 7042, - "end": 7043, + "start": 7230, + "end": 7231, "loc": { "start": { - "line": 137, + "line": 145, "column": 8 }, "end": { - "line": 137, + "line": 145, "column": 9 } } @@ -55596,15 +57931,15 @@ "updateContext": null }, "value": "if", - "start": 7053, - "end": 7055, + "start": 7241, + "end": 7243, "loc": { "start": { - "line": 139, + "line": 147, "column": 8 }, "end": { - "line": 139, + "line": 147, "column": 10 } } @@ -55621,15 +57956,15 @@ "postfix": false, "binop": null }, - "start": 7056, - "end": 7057, + "start": 7244, + "end": 7245, "loc": { "start": { - "line": 139, + "line": 147, "column": 11 }, "end": { - "line": 139, + "line": 147, "column": 12 } } @@ -55648,15 +57983,15 @@ "updateContext": null }, "value": "!", - "start": 7057, - "end": 7058, + "start": 7245, + "end": 7246, "loc": { "start": { - "line": 139, + "line": 147, "column": 12 }, "end": { - "line": 139, + "line": 147, "column": 13 } } @@ -55674,15 +58009,15 @@ "binop": null }, "value": "output", - "start": 7058, - "end": 7064, + "start": 7246, + "end": 7252, "loc": { "start": { - "line": 139, + "line": 147, "column": 13 }, "end": { - "line": 139, + "line": 147, "column": 19 } } @@ -55701,15 +58036,15 @@ "updateContext": null }, "value": "&&", - "start": 7065, - "end": 7067, + "start": 7253, + "end": 7255, "loc": { "start": { - "line": 139, + "line": 147, "column": 20 }, "end": { - "line": 139, + "line": 147, "column": 22 } } @@ -55728,15 +58063,15 @@ "updateContext": null }, "value": "!", - "start": 7068, - "end": 7069, + "start": 7256, + "end": 7257, "loc": { "start": { - "line": 139, + "line": 147, "column": 23 }, "end": { - "line": 139, + "line": 147, "column": 24 } } @@ -55754,15 +58089,15 @@ "binop": null }, "value": "outputXKTModel", - "start": 7069, - "end": 7083, + "start": 7257, + "end": 7271, "loc": { "start": { - "line": 139, + "line": 147, "column": 24 }, "end": { - "line": 139, + "line": 147, "column": 38 } } @@ -55781,15 +58116,15 @@ "updateContext": null }, "value": "&&", - "start": 7084, - "end": 7086, + "start": 7272, + "end": 7274, "loc": { "start": { - "line": 139, + "line": 147, "column": 39 }, "end": { - "line": 139, + "line": 147, "column": 41 } } @@ -55808,15 +58143,15 @@ "updateContext": null }, "value": "!", - "start": 7087, - "end": 7088, + "start": 7275, + "end": 7276, "loc": { "start": { - "line": 139, + "line": 147, "column": 42 }, "end": { - "line": 139, + "line": 147, "column": 43 } } @@ -55834,15 +58169,15 @@ "binop": null }, "value": "outputXKT", - "start": 7088, - "end": 7097, + "start": 7276, + "end": 7285, "loc": { "start": { - "line": 139, + "line": 147, "column": 43 }, "end": { - "line": 139, + "line": 147, "column": 52 } } @@ -55859,15 +58194,15 @@ "postfix": false, "binop": null }, - "start": 7097, - "end": 7098, + "start": 7285, + "end": 7286, "loc": { "start": { - "line": 139, + "line": 147, "column": 52 }, "end": { - "line": 139, + "line": 147, "column": 53 } } @@ -55884,15 +58219,15 @@ "postfix": false, "binop": null }, - "start": 7099, - "end": 7100, + "start": 7287, + "end": 7288, "loc": { "start": { - "line": 139, + "line": 147, "column": 54 }, "end": { - "line": 139, + "line": 147, "column": 55 } } @@ -55910,15 +58245,15 @@ "binop": null }, "value": "reject", - "start": 7113, - "end": 7119, + "start": 7301, + "end": 7307, "loc": { "start": { - "line": 140, + "line": 148, "column": 12 }, "end": { - "line": 140, + "line": 148, "column": 18 } } @@ -55935,15 +58270,15 @@ "postfix": false, "binop": null }, - "start": 7119, - "end": 7120, + "start": 7307, + "end": 7308, "loc": { "start": { - "line": 140, + "line": 148, "column": 18 }, "end": { - "line": 140, + "line": 148, "column": 19 } } @@ -55962,15 +58297,15 @@ "updateContext": null }, "value": "Argument expected: output, outputXKTModel or outputXKT", - "start": 7120, - "end": 7176, + "start": 7308, + "end": 7364, "loc": { "start": { - "line": 140, + "line": 148, "column": 19 }, "end": { - "line": 140, + "line": 148, "column": 75 } } @@ -55987,15 +58322,15 @@ "postfix": false, "binop": null }, - "start": 7176, - "end": 7177, + "start": 7364, + "end": 7365, "loc": { "start": { - "line": 140, + "line": 148, "column": 75 }, "end": { - "line": 140, + "line": 148, "column": 76 } } @@ -56013,15 +58348,15 @@ "binop": null, "updateContext": null }, - "start": 7177, - "end": 7178, + "start": 7365, + "end": 7366, "loc": { "start": { - "line": 140, + "line": 148, "column": 76 }, "end": { - "line": 140, + "line": 148, "column": 77 } } @@ -56041,15 +58376,15 @@ "updateContext": null }, "value": "return", - "start": 7191, - "end": 7197, + "start": 7379, + "end": 7385, "loc": { "start": { - "line": 141, + "line": 149, "column": 12 }, "end": { - "line": 141, + "line": 149, "column": 18 } } @@ -56067,15 +58402,15 @@ "binop": null, "updateContext": null }, - "start": 7197, - "end": 7198, + "start": 7385, + "end": 7386, "loc": { "start": { - "line": 141, + "line": 149, "column": 18 }, "end": { - "line": 141, + "line": 149, "column": 19 } } @@ -56092,15 +58427,15 @@ "postfix": false, "binop": null }, - "start": 7207, - "end": 7208, + "start": 7395, + "end": 7396, "loc": { "start": { - "line": 142, + "line": 150, "column": 8 }, "end": { - "line": 142, + "line": 150, "column": 9 } } @@ -56120,15 +58455,15 @@ "updateContext": null }, "value": "if", - "start": 7218, - "end": 7220, + "start": 7406, + "end": 7408, "loc": { "start": { - "line": 144, + "line": 152, "column": 8 }, "end": { - "line": 144, + "line": 152, "column": 10 } } @@ -56145,15 +58480,15 @@ "postfix": false, "binop": null }, - "start": 7221, - "end": 7222, + "start": 7409, + "end": 7410, "loc": { "start": { - "line": 144, + "line": 152, "column": 11 }, "end": { - "line": 144, + "line": 152, "column": 12 } } @@ -56171,15 +58506,15 @@ "binop": null }, "value": "source", - "start": 7222, - "end": 7228, + "start": 7410, + "end": 7416, "loc": { "start": { - "line": 144, + "line": 152, "column": 12 }, "end": { - "line": 144, + "line": 152, "column": 18 } } @@ -56196,15 +58531,15 @@ "postfix": false, "binop": null }, - "start": 7228, - "end": 7229, + "start": 7416, + "end": 7417, "loc": { "start": { - "line": 144, + "line": 152, "column": 18 }, "end": { - "line": 144, + "line": 152, "column": 19 } } @@ -56221,15 +58556,15 @@ "postfix": false, "binop": null }, - "start": 7230, - "end": 7231, + "start": 7418, + "end": 7419, "loc": { "start": { - "line": 144, + "line": 152, "column": 20 }, "end": { - "line": 144, + "line": 152, "column": 21 } } @@ -56247,15 +58582,15 @@ "binop": null }, "value": "log", - "start": 7244, - "end": 7247, + "start": 7432, + "end": 7435, "loc": { "start": { - "line": 145, + "line": 153, "column": 12 }, "end": { - "line": 145, + "line": 153, "column": 15 } } @@ -56272,15 +58607,15 @@ "postfix": false, "binop": null }, - "start": 7247, - "end": 7248, + "start": 7435, + "end": 7436, "loc": { "start": { - "line": 145, + "line": 153, "column": 15 }, "end": { - "line": 145, + "line": 153, "column": 16 } } @@ -56299,15 +58634,15 @@ "updateContext": null }, "value": "Reading input file: ", - "start": 7248, - "end": 7270, + "start": 7436, + "end": 7458, "loc": { "start": { - "line": 145, + "line": 153, "column": 16 }, "end": { - "line": 145, + "line": 153, "column": 38 } } @@ -56326,15 +58661,15 @@ "updateContext": null }, "value": "+", - "start": 7271, - "end": 7272, + "start": 7459, + "end": 7460, "loc": { "start": { - "line": 145, + "line": 153, "column": 39 }, "end": { - "line": 145, + "line": 153, "column": 40 } } @@ -56352,15 +58687,15 @@ "binop": null }, "value": "source", - "start": 7273, - "end": 7279, + "start": 7461, + "end": 7467, "loc": { "start": { - "line": 145, + "line": 153, "column": 41 }, "end": { - "line": 145, + "line": 153, "column": 47 } } @@ -56377,15 +58712,15 @@ "postfix": false, "binop": null }, - "start": 7279, - "end": 7280, + "start": 7467, + "end": 7468, "loc": { "start": { - "line": 145, + "line": 153, "column": 47 }, "end": { - "line": 145, + "line": 153, "column": 48 } } @@ -56403,15 +58738,15 @@ "binop": null, "updateContext": null }, - "start": 7280, - "end": 7281, + "start": 7468, + "end": 7469, "loc": { "start": { - "line": 145, + "line": 153, "column": 48 }, "end": { - "line": 145, + "line": 153, "column": 49 } } @@ -56428,15 +58763,15 @@ "postfix": false, "binop": null }, - "start": 7290, - "end": 7291, + "start": 7478, + "end": 7479, "loc": { "start": { - "line": 146, + "line": 154, "column": 8 }, "end": { - "line": 146, + "line": 154, "column": 9 } } @@ -56456,15 +58791,15 @@ "updateContext": null }, "value": "const", - "start": 7301, - "end": 7306, + "start": 7489, + "end": 7494, "loc": { "start": { - "line": 148, + "line": 156, "column": 8 }, "end": { - "line": 148, + "line": 156, "column": 13 } } @@ -56482,15 +58817,15 @@ "binop": null }, "value": "startTime", - "start": 7307, - "end": 7316, + "start": 7495, + "end": 7504, "loc": { "start": { - "line": 148, + "line": 156, "column": 14 }, "end": { - "line": 148, + "line": 156, "column": 23 } } @@ -56509,15 +58844,15 @@ "updateContext": null }, "value": "=", - "start": 7317, - "end": 7318, + "start": 7505, + "end": 7506, "loc": { "start": { - "line": 148, + "line": 156, "column": 24 }, "end": { - "line": 148, + "line": 156, "column": 25 } } @@ -56537,15 +58872,15 @@ "updateContext": null }, "value": "new", - "start": 7319, - "end": 7322, + "start": 7507, + "end": 7510, "loc": { "start": { - "line": 148, + "line": 156, "column": 26 }, "end": { - "line": 148, + "line": 156, "column": 29 } } @@ -56563,15 +58898,15 @@ "binop": null }, "value": "Date", - "start": 7323, - "end": 7327, + "start": 7511, + "end": 7515, "loc": { "start": { - "line": 148, + "line": 156, "column": 30 }, "end": { - "line": 148, + "line": 156, "column": 34 } } @@ -56588,15 +58923,15 @@ "postfix": false, "binop": null }, - "start": 7327, - "end": 7328, + "start": 7515, + "end": 7516, "loc": { "start": { - "line": 148, + "line": 156, "column": 34 }, "end": { - "line": 148, + "line": 156, "column": 35 } } @@ -56613,15 +58948,15 @@ "postfix": false, "binop": null }, - "start": 7328, - "end": 7329, + "start": 7516, + "end": 7517, "loc": { "start": { - "line": 148, + "line": 156, "column": 35 }, "end": { - "line": 148, + "line": 156, "column": 36 } } @@ -56639,15 +58974,15 @@ "binop": null, "updateContext": null }, - "start": 7329, - "end": 7330, + "start": 7517, + "end": 7518, "loc": { "start": { - "line": 148, + "line": 156, "column": 36 }, "end": { - "line": 148, + "line": 156, "column": 37 } } @@ -56667,15 +59002,15 @@ "updateContext": null }, "value": "const", - "start": 7340, - "end": 7345, + "start": 7528, + "end": 7533, "loc": { "start": { - "line": 150, + "line": 158, "column": 8 }, "end": { - "line": 150, + "line": 158, "column": 13 } } @@ -56693,15 +59028,15 @@ "binop": null }, "value": "sourceConfigs", - "start": 7346, - "end": 7359, + "start": 7534, + "end": 7547, "loc": { "start": { - "line": 150, + "line": 158, "column": 14 }, "end": { - "line": 150, + "line": 158, "column": 27 } } @@ -56720,15 +59055,15 @@ "updateContext": null }, "value": "=", - "start": 7360, - "end": 7361, + "start": 7548, + "end": 7549, "loc": { "start": { - "line": 150, + "line": 158, "column": 28 }, "end": { - "line": 150, + "line": 158, "column": 29 } } @@ -56746,15 +59081,15 @@ "binop": null }, "value": "configs", - "start": 7362, - "end": 7369, + "start": 7550, + "end": 7557, "loc": { "start": { - "line": 150, + "line": 158, "column": 30 }, "end": { - "line": 150, + "line": 158, "column": 37 } } @@ -56772,15 +59107,15 @@ "binop": null, "updateContext": null }, - "start": 7369, - "end": 7370, + "start": 7557, + "end": 7558, "loc": { "start": { - "line": 150, + "line": 158, "column": 37 }, "end": { - "line": 150, + "line": 158, "column": 38 } } @@ -56798,15 +59133,15 @@ "binop": null }, "value": "sourceConfigs", - "start": 7370, - "end": 7383, + "start": 7558, + "end": 7571, "loc": { "start": { - "line": 150, + "line": 158, "column": 38 }, "end": { - "line": 150, + "line": 158, "column": 51 } } @@ -56825,15 +59160,15 @@ "updateContext": null }, "value": "||", - "start": 7384, - "end": 7386, + "start": 7572, + "end": 7574, "loc": { "start": { - "line": 150, + "line": 158, "column": 52 }, "end": { - "line": 150, + "line": 158, "column": 54 } } @@ -56850,15 +59185,15 @@ "postfix": false, "binop": null }, - "start": 7387, - "end": 7388, + "start": 7575, + "end": 7576, "loc": { "start": { - "line": 150, + "line": 158, "column": 55 }, "end": { - "line": 150, + "line": 158, "column": 56 } } @@ -56875,15 +59210,15 @@ "postfix": false, "binop": null }, - "start": 7388, - "end": 7389, + "start": 7576, + "end": 7577, "loc": { "start": { - "line": 150, + "line": 158, "column": 56 }, "end": { - "line": 150, + "line": 158, "column": 57 } } @@ -56901,15 +59236,15 @@ "binop": null, "updateContext": null }, - "start": 7389, - "end": 7390, + "start": 7577, + "end": 7578, "loc": { "start": { - "line": 150, + "line": 158, "column": 57 }, "end": { - "line": 150, + "line": 158, "column": 58 } } @@ -56929,15 +59264,15 @@ "updateContext": null }, "value": "const", - "start": 7399, - "end": 7404, + "start": 7587, + "end": 7592, "loc": { "start": { - "line": 151, + "line": 159, "column": 8 }, "end": { - "line": 151, + "line": 159, "column": 13 } } @@ -56955,15 +59290,15 @@ "binop": null }, "value": "ext", - "start": 7405, - "end": 7408, + "start": 7593, + "end": 7596, "loc": { "start": { - "line": 151, + "line": 159, "column": 14 }, "end": { - "line": 151, + "line": 159, "column": 17 } } @@ -56982,15 +59317,15 @@ "updateContext": null }, "value": "=", - "start": 7409, - "end": 7410, + "start": 7597, + "end": 7598, "loc": { "start": { - "line": 151, + "line": 159, "column": 18 }, "end": { - "line": 151, + "line": 159, "column": 19 } } @@ -57008,15 +59343,15 @@ "binop": null }, "value": "sourceFormat", - "start": 7411, - "end": 7423, + "start": 7599, + "end": 7611, "loc": { "start": { - "line": 151, + "line": 159, "column": 20 }, "end": { - "line": 151, + "line": 159, "column": 32 } } @@ -57035,15 +59370,15 @@ "updateContext": null }, "value": "||", - "start": 7424, - "end": 7426, + "start": 7612, + "end": 7614, "loc": { "start": { - "line": 151, + "line": 159, "column": 33 }, "end": { - "line": 151, + "line": 159, "column": 35 } } @@ -57060,23 +59395,74 @@ "postfix": false, "binop": null }, - "value": "path", - "start": 7427, - "end": 7431, + "value": "getFileExtension", + "start": 7615, + "end": 7631, "loc": { "start": { - "line": 151, + "line": 159, "column": 36 }, "end": { - "line": 151, - "column": 40 + "line": 159, + "column": 52 } } }, { "type": { - "label": ".", + "label": "(", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 7631, + "end": 7632, + "loc": { + "start": { + "line": 159, + "column": 52 + }, + "end": { + "line": 159, + "column": 53 + } + } + }, + { + "type": { + "label": "name", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "value": "source", + "start": 7632, + "end": 7638, + "loc": { + "start": { + "line": 159, + "column": 53 + }, + "end": { + "line": 159, + "column": 59 + } + } + }, + { + "type": { + "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, @@ -57084,19 +59470,44 @@ "isAssign": false, "prefix": false, "postfix": false, + "binop": null + }, + "start": 7638, + "end": 7639, + "loc": { + "start": { + "line": 159, + "column": 59 + }, + "end": { + "line": 159, + "column": 60 + } + } + }, + { + "type": { + "label": ";", + "beforeExpr": true, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, "binop": null, "updateContext": null }, - "start": 7431, - "end": 7432, + "start": 7639, + "end": 7640, "loc": { "start": { - "line": 151, - "column": 40 + "line": 159, + "column": 60 }, "end": { - "line": 151, - "column": 41 + "line": 159, + "column": 61 } } }, @@ -57112,17 +59523,17 @@ "postfix": false, "binop": null }, - "value": "extname", - "start": 7432, - "end": 7439, + "value": "log", + "start": 7650, + "end": 7653, "loc": { "start": { - "line": 151, - "column": 41 + "line": 161, + "column": 8 }, "end": { - "line": 151, - "column": 48 + "line": 161, + "column": 11 } } }, @@ -57138,16 +59549,93 @@ "postfix": false, "binop": null }, - "start": 7439, - "end": 7440, + "start": 7653, + "end": 7654, "loc": { "start": { - "line": 151, - "column": 48 + "line": 161, + "column": 11 }, "end": { - "line": 151, - "column": 49 + "line": 161, + "column": 12 + } + } + }, + { + "type": { + "label": "`", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 7654, + "end": 7655, + "loc": { + "start": { + "line": 161, + "column": 12 + }, + "end": { + "line": 161, + "column": 13 + } + } + }, + { + "type": { + "label": "template", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "Input file extension: \"", + "start": 7655, + "end": 7678, + "loc": { + "start": { + "line": 161, + "column": 13 + }, + "end": { + "line": 161, + "column": 36 + } + } + }, + { + "type": { + "label": "${", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 7678, + "end": 7680, + "loc": { + "start": { + "line": 161, + "column": 36 + }, + "end": { + "line": 161, + "column": 38 } } }, @@ -57163,17 +59651,94 @@ "postfix": false, "binop": null }, - "value": "source", - "start": 7440, - "end": 7446, + "value": "ext", + "start": 7680, + "end": 7683, "loc": { "start": { - "line": 151, - "column": 49 + "line": 161, + "column": 38 }, "end": { - "line": 151, - "column": 55 + "line": 161, + "column": 41 + } + } + }, + { + "type": { + "label": "}", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 7683, + "end": 7684, + "loc": { + "start": { + "line": 161, + "column": 41 + }, + "end": { + "line": 161, + "column": 42 + } + } + }, + { + "type": { + "label": "template", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "value": "\"", + "start": 7684, + "end": 7685, + "loc": { + "start": { + "line": 161, + "column": 42 + }, + "end": { + "line": 161, + "column": 43 + } + } + }, + { + "type": { + "label": "`", + "beforeExpr": false, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, + "start": 7685, + "end": 7686, + "loc": { + "start": { + "line": 161, + "column": 43 + }, + "end": { + "line": 161, + "column": 44 } } }, @@ -57189,16 +59754,16 @@ "postfix": false, "binop": null }, - "start": 7446, - "end": 7447, + "start": 7686, + "end": 7687, "loc": { "start": { - "line": 151, - "column": 55 + "line": 161, + "column": 44 }, "end": { - "line": 151, - "column": 56 + "line": 161, + "column": 45 } } }, @@ -57215,16 +59780,16 @@ "binop": null, "updateContext": null }, - "start": 7447, - "end": 7448, + "start": 7687, + "end": 7688, "loc": { "start": { - "line": 151, - "column": 56 + "line": 161, + "column": 45 }, "end": { - "line": 151, - "column": 57 + "line": 161, + "column": 46 } } }, @@ -57243,15 +59808,15 @@ "updateContext": null }, "value": "let", - "start": 7457, - "end": 7460, + "start": 7698, + "end": 7701, "loc": { "start": { - "line": 152, + "line": 163, "column": 8 }, "end": { - "line": 152, + "line": 163, "column": 11 } } @@ -57269,15 +59834,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 7461, - "end": 7476, + "start": 7702, + "end": 7717, "loc": { "start": { - "line": 152, + "line": 163, "column": 12 }, "end": { - "line": 152, + "line": 163, "column": 27 } } @@ -57296,15 +59861,15 @@ "updateContext": null }, "value": "=", - "start": 7477, - "end": 7478, + "start": 7718, + "end": 7719, "loc": { "start": { - "line": 152, + "line": 163, "column": 28 }, "end": { - "line": 152, + "line": 163, "column": 29 } } @@ -57322,15 +59887,15 @@ "binop": null }, "value": "sourceConfigs", - "start": 7479, - "end": 7492, + "start": 7720, + "end": 7733, "loc": { "start": { - "line": 152, + "line": 163, "column": 30 }, "end": { - "line": 152, + "line": 163, "column": 43 } } @@ -57348,15 +59913,15 @@ "binop": null, "updateContext": null }, - "start": 7492, - "end": 7493, + "start": 7733, + "end": 7734, "loc": { "start": { - "line": 152, + "line": 163, "column": 43 }, "end": { - "line": 152, + "line": 163, "column": 44 } } @@ -57374,15 +59939,15 @@ "binop": null }, "value": "ext", - "start": 7493, - "end": 7496, + "start": 7734, + "end": 7737, "loc": { "start": { - "line": 152, + "line": 163, "column": 44 }, "end": { - "line": 152, + "line": 163, "column": 47 } } @@ -57400,15 +59965,15 @@ "binop": null, "updateContext": null }, - "start": 7496, - "end": 7497, + "start": 7737, + "end": 7738, "loc": { "start": { - "line": 152, + "line": 163, "column": 47 }, "end": { - "line": 152, + "line": 163, "column": 48 } } @@ -57426,15 +59991,15 @@ "binop": null, "updateContext": null }, - "start": 7497, - "end": 7498, + "start": 7738, + "end": 7739, "loc": { "start": { - "line": 152, + "line": 163, "column": 48 }, "end": { - "line": 152, + "line": 163, "column": 49 } } @@ -57454,15 +60019,15 @@ "updateContext": null }, "value": "if", - "start": 7508, - "end": 7510, + "start": 7749, + "end": 7751, "loc": { "start": { - "line": 154, + "line": 165, "column": 8 }, "end": { - "line": 154, + "line": 165, "column": 10 } } @@ -57479,15 +60044,15 @@ "postfix": false, "binop": null }, - "start": 7511, - "end": 7512, + "start": 7752, + "end": 7753, "loc": { "start": { - "line": 154, + "line": 165, "column": 11 }, "end": { - "line": 154, + "line": 165, "column": 12 } } @@ -57506,15 +60071,15 @@ "updateContext": null }, "value": "!", - "start": 7512, - "end": 7513, + "start": 7753, + "end": 7754, "loc": { "start": { - "line": 154, + "line": 165, "column": 12 }, "end": { - "line": 154, + "line": 165, "column": 13 } } @@ -57532,15 +60097,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 7513, - "end": 7528, + "start": 7754, + "end": 7769, "loc": { "start": { - "line": 154, + "line": 165, "column": 13 }, "end": { - "line": 154, + "line": 165, "column": 28 } } @@ -57557,15 +60122,15 @@ "postfix": false, "binop": null }, - "start": 7528, - "end": 7529, + "start": 7769, + "end": 7770, "loc": { "start": { - "line": 154, + "line": 165, "column": 28 }, "end": { - "line": 154, + "line": 165, "column": 29 } } @@ -57582,15 +60147,15 @@ "postfix": false, "binop": null }, - "start": 7530, - "end": 7531, + "start": 7771, + "end": 7772, "loc": { "start": { - "line": 154, + "line": 165, "column": 30 }, "end": { - "line": 154, + "line": 165, "column": 31 } } @@ -57608,15 +60173,15 @@ "binop": null }, "value": "log", - "start": 7544, - "end": 7547, + "start": 7785, + "end": 7788, "loc": { "start": { - "line": 155, + "line": 166, "column": 12 }, "end": { - "line": 155, + "line": 166, "column": 15 } } @@ -57633,15 +60198,15 @@ "postfix": false, "binop": null }, - "start": 7547, - "end": 7548, + "start": 7788, + "end": 7789, "loc": { "start": { - "line": 155, + "line": 166, "column": 15 }, "end": { - "line": 155, + "line": 166, "column": 16 } } @@ -57658,15 +60223,15 @@ "postfix": false, "binop": null }, - "start": 7548, - "end": 7549, + "start": 7789, + "end": 7790, "loc": { "start": { - "line": 155, + "line": 166, "column": 16 }, "end": { - "line": 155, + "line": 166, "column": 17 } } @@ -57685,15 +60250,15 @@ "updateContext": null }, "value": "[WARNING] Could not find configs sourceConfigs entry for source format \"", - "start": 7549, - "end": 7621, + "start": 7790, + "end": 7862, "loc": { "start": { - "line": 155, + "line": 166, "column": 17 }, "end": { - "line": 155, + "line": 166, "column": 89 } } @@ -57710,15 +60275,15 @@ "postfix": false, "binop": null }, - "start": 7621, - "end": 7623, + "start": 7862, + "end": 7864, "loc": { "start": { - "line": 155, + "line": 166, "column": 89 }, "end": { - "line": 155, + "line": 166, "column": 91 } } @@ -57736,15 +60301,15 @@ "binop": null }, "value": "ext", - "start": 7623, - "end": 7626, + "start": 7864, + "end": 7867, "loc": { "start": { - "line": 155, + "line": 166, "column": 91 }, "end": { - "line": 155, + "line": 166, "column": 94 } } @@ -57761,15 +60326,15 @@ "postfix": false, "binop": null }, - "start": 7626, - "end": 7627, + "start": 7867, + "end": 7868, "loc": { "start": { - "line": 155, + "line": 166, "column": 94 }, "end": { - "line": 155, + "line": 166, "column": 95 } } @@ -57788,15 +60353,15 @@ "updateContext": null }, "value": "\". This is derived from the source file name extension. Will use internal default configs.", - "start": 7627, - "end": 7717, + "start": 7868, + "end": 7958, "loc": { "start": { - "line": 155, + "line": 166, "column": 95 }, "end": { - "line": 155, + "line": 166, "column": 185 } } @@ -57813,15 +60378,15 @@ "postfix": false, "binop": null }, - "start": 7717, - "end": 7718, + "start": 7958, + "end": 7959, "loc": { "start": { - "line": 155, + "line": 166, "column": 185 }, "end": { - "line": 155, + "line": 166, "column": 186 } } @@ -57838,15 +60403,15 @@ "postfix": false, "binop": null }, - "start": 7718, - "end": 7719, + "start": 7959, + "end": 7960, "loc": { "start": { - "line": 155, + "line": 166, "column": 186 }, "end": { - "line": 155, + "line": 166, "column": 187 } } @@ -57864,15 +60429,15 @@ "binop": null, "updateContext": null }, - "start": 7719, - "end": 7720, + "start": 7960, + "end": 7961, "loc": { "start": { - "line": 155, + "line": 166, "column": 187 }, "end": { - "line": 155, + "line": 166, "column": 188 } } @@ -57890,15 +60455,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 7733, - "end": 7748, + "start": 7974, + "end": 7989, "loc": { "start": { - "line": 156, + "line": 167, "column": 12 }, "end": { - "line": 156, + "line": 167, "column": 27 } } @@ -57917,15 +60482,15 @@ "updateContext": null }, "value": "=", - "start": 7749, - "end": 7750, + "start": 7990, + "end": 7991, "loc": { "start": { - "line": 156, + "line": 167, "column": 28 }, "end": { - "line": 156, + "line": 167, "column": 29 } } @@ -57942,15 +60507,15 @@ "postfix": false, "binop": null }, - "start": 7751, - "end": 7752, + "start": 7992, + "end": 7993, "loc": { "start": { - "line": 156, + "line": 167, "column": 30 }, "end": { - "line": 156, + "line": 167, "column": 31 } } @@ -57967,15 +60532,15 @@ "postfix": false, "binop": null }, - "start": 7752, - "end": 7753, + "start": 7993, + "end": 7994, "loc": { "start": { - "line": 156, + "line": 167, "column": 31 }, "end": { - "line": 156, + "line": 167, "column": 32 } } @@ -57993,15 +60558,15 @@ "binop": null, "updateContext": null }, - "start": 7753, - "end": 7754, + "start": 7994, + "end": 7995, "loc": { "start": { - "line": 156, + "line": 167, "column": 32 }, "end": { - "line": 156, + "line": 167, "column": 33 } } @@ -58018,15 +60583,15 @@ "postfix": false, "binop": null }, - "start": 7763, - "end": 7764, + "start": 8004, + "end": 8005, "loc": { "start": { - "line": 157, + "line": 168, "column": 8 }, "end": { - "line": 157, + "line": 168, "column": 9 } } @@ -58045,15 +60610,15 @@ "binop": null }, "value": "function", - "start": 7773, - "end": 7781, + "start": 8014, + "end": 8022, "loc": { "start": { - "line": 158, + "line": 169, "column": 8 }, "end": { - "line": 158, + "line": 169, "column": 16 } } @@ -58071,15 +60636,15 @@ "binop": null }, "value": "overrideOption", - "start": 7782, - "end": 7796, + "start": 8023, + "end": 8037, "loc": { "start": { - "line": 158, + "line": 169, "column": 17 }, "end": { - "line": 158, + "line": 169, "column": 31 } } @@ -58096,15 +60661,15 @@ "postfix": false, "binop": null }, - "start": 7796, - "end": 7797, + "start": 8037, + "end": 8038, "loc": { "start": { - "line": 158, + "line": 169, "column": 31 }, "end": { - "line": 158, + "line": 169, "column": 32 } } @@ -58122,15 +60687,15 @@ "binop": null }, "value": "option1", - "start": 7797, - "end": 7804, + "start": 8038, + "end": 8045, "loc": { "start": { - "line": 158, + "line": 169, "column": 32 }, "end": { - "line": 158, + "line": 169, "column": 39 } } @@ -58148,15 +60713,15 @@ "binop": null, "updateContext": null }, - "start": 7804, - "end": 7805, + "start": 8045, + "end": 8046, "loc": { "start": { - "line": 158, + "line": 169, "column": 39 }, "end": { - "line": 158, + "line": 169, "column": 40 } } @@ -58174,15 +60739,15 @@ "binop": null }, "value": "option2", - "start": 7806, - "end": 7813, + "start": 8047, + "end": 8054, "loc": { "start": { - "line": 158, + "line": 169, "column": 41 }, "end": { - "line": 158, + "line": 169, "column": 48 } } @@ -58199,15 +60764,15 @@ "postfix": false, "binop": null }, - "start": 7813, - "end": 7814, + "start": 8054, + "end": 8055, "loc": { "start": { - "line": 158, + "line": 169, "column": 48 }, "end": { - "line": 158, + "line": 169, "column": 49 } } @@ -58224,15 +60789,15 @@ "postfix": false, "binop": null }, - "start": 7815, - "end": 7816, + "start": 8056, + "end": 8057, "loc": { "start": { - "line": 158, + "line": 169, "column": 50 }, "end": { - "line": 158, + "line": 169, "column": 51 } } @@ -58252,15 +60817,15 @@ "updateContext": null }, "value": "if", - "start": 7829, - "end": 7831, + "start": 8070, + "end": 8072, "loc": { "start": { - "line": 159, + "line": 170, "column": 12 }, "end": { - "line": 159, + "line": 170, "column": 14 } } @@ -58277,15 +60842,15 @@ "postfix": false, "binop": null }, - "start": 7832, - "end": 7833, + "start": 8073, + "end": 8074, "loc": { "start": { - "line": 159, + "line": 170, "column": 15 }, "end": { - "line": 159, + "line": 170, "column": 16 } } @@ -58303,15 +60868,15 @@ "binop": null }, "value": "option1", - "start": 7833, - "end": 7840, + "start": 8074, + "end": 8081, "loc": { "start": { - "line": 159, + "line": 170, "column": 16 }, "end": { - "line": 159, + "line": 170, "column": 23 } } @@ -58330,15 +60895,15 @@ "updateContext": null }, "value": "!==", - "start": 7841, - "end": 7844, + "start": 8082, + "end": 8085, "loc": { "start": { - "line": 159, + "line": 170, "column": 24 }, "end": { - "line": 159, + "line": 170, "column": 27 } } @@ -58356,15 +60921,15 @@ "binop": null }, "value": "undefined", - "start": 7845, - "end": 7854, + "start": 8086, + "end": 8095, "loc": { "start": { - "line": 159, + "line": 170, "column": 28 }, "end": { - "line": 159, + "line": 170, "column": 37 } } @@ -58381,15 +60946,15 @@ "postfix": false, "binop": null }, - "start": 7854, - "end": 7855, + "start": 8095, + "end": 8096, "loc": { "start": { - "line": 159, + "line": 170, "column": 37 }, "end": { - "line": 159, + "line": 170, "column": 38 } } @@ -58406,15 +60971,15 @@ "postfix": false, "binop": null }, - "start": 7856, - "end": 7857, + "start": 8097, + "end": 8098, "loc": { "start": { - "line": 159, + "line": 170, "column": 39 }, "end": { - "line": 159, + "line": 170, "column": 40 } } @@ -58434,15 +60999,15 @@ "updateContext": null }, "value": "return", - "start": 7874, - "end": 7880, + "start": 8115, + "end": 8121, "loc": { "start": { - "line": 160, + "line": 171, "column": 16 }, "end": { - "line": 160, + "line": 171, "column": 22 } } @@ -58460,15 +61025,15 @@ "binop": null }, "value": "option1", - "start": 7881, - "end": 7888, + "start": 8122, + "end": 8129, "loc": { "start": { - "line": 160, + "line": 171, "column": 23 }, "end": { - "line": 160, + "line": 171, "column": 30 } } @@ -58486,15 +61051,15 @@ "binop": null, "updateContext": null }, - "start": 7888, - "end": 7889, + "start": 8129, + "end": 8130, "loc": { "start": { - "line": 160, + "line": 171, "column": 30 }, "end": { - "line": 160, + "line": 171, "column": 31 } } @@ -58511,15 +61076,15 @@ "postfix": false, "binop": null }, - "start": 7902, - "end": 7903, + "start": 8143, + "end": 8144, "loc": { "start": { - "line": 161, + "line": 172, "column": 12 }, "end": { - "line": 161, + "line": 172, "column": 13 } } @@ -58539,15 +61104,15 @@ "updateContext": null }, "value": "return", - "start": 7916, - "end": 7922, + "start": 8157, + "end": 8163, "loc": { "start": { - "line": 162, + "line": 173, "column": 12 }, "end": { - "line": 162, + "line": 173, "column": 18 } } @@ -58565,15 +61130,15 @@ "binop": null }, "value": "option2", - "start": 7923, - "end": 7930, + "start": 8164, + "end": 8171, "loc": { "start": { - "line": 162, + "line": 173, "column": 19 }, "end": { - "line": 162, + "line": 173, "column": 26 } } @@ -58591,15 +61156,15 @@ "binop": null, "updateContext": null }, - "start": 7930, - "end": 7931, + "start": 8171, + "end": 8172, "loc": { "start": { - "line": 162, + "line": 173, "column": 26 }, "end": { - "line": 162, + "line": 173, "column": 27 } } @@ -58616,15 +61181,15 @@ "postfix": false, "binop": null }, - "start": 7940, - "end": 7941, + "start": 8181, + "end": 8182, "loc": { "start": { - "line": 163, + "line": 174, "column": 8 }, "end": { - "line": 163, + "line": 174, "column": 9 } } @@ -58644,15 +61209,15 @@ "updateContext": null }, "value": "if", - "start": 7951, - "end": 7953, + "start": 8192, + "end": 8194, "loc": { "start": { - "line": 165, + "line": 176, "column": 8 }, "end": { - "line": 165, + "line": 176, "column": 10 } } @@ -58669,15 +61234,15 @@ "postfix": false, "binop": null }, - "start": 7954, - "end": 7955, + "start": 8195, + "end": 8196, "loc": { "start": { - "line": 165, + "line": 176, "column": 11 }, "end": { - "line": 165, + "line": 176, "column": 12 } } @@ -58696,15 +61261,15 @@ "updateContext": null }, "value": "!", - "start": 7955, - "end": 7956, + "start": 8196, + "end": 8197, "loc": { "start": { - "line": 165, + "line": 176, "column": 12 }, "end": { - "line": 165, + "line": 176, "column": 13 } } @@ -58722,15 +61287,15 @@ "binop": null }, "value": "sourceData", - "start": 7956, - "end": 7966, + "start": 8197, + "end": 8207, "loc": { "start": { - "line": 165, + "line": 176, "column": 13 }, "end": { - "line": 165, + "line": 176, "column": 23 } } @@ -58747,15 +61312,15 @@ "postfix": false, "binop": null }, - "start": 7966, - "end": 7967, + "start": 8207, + "end": 8208, "loc": { "start": { - "line": 165, + "line": 176, "column": 23 }, "end": { - "line": 165, + "line": 176, "column": 24 } } @@ -58772,15 +61337,15 @@ "postfix": false, "binop": null }, - "start": 7968, - "end": 7969, + "start": 8209, + "end": 8210, "loc": { "start": { - "line": 165, + "line": 176, "column": 25 }, "end": { - "line": 165, + "line": 176, "column": 26 } } @@ -58800,15 +61365,15 @@ "updateContext": null }, "value": "try", - "start": 7982, - "end": 7985, + "start": 8223, + "end": 8226, "loc": { "start": { - "line": 166, + "line": 177, "column": 12 }, "end": { - "line": 166, + "line": 177, "column": 15 } } @@ -58825,15 +61390,15 @@ "postfix": false, "binop": null }, - "start": 7986, - "end": 7987, + "start": 8227, + "end": 8228, "loc": { "start": { - "line": 166, + "line": 177, "column": 16 }, "end": { - "line": 166, + "line": 177, "column": 17 } } @@ -58851,15 +61416,15 @@ "binop": null }, "value": "sourceData", - "start": 8004, - "end": 8014, + "start": 8245, + "end": 8255, "loc": { "start": { - "line": 167, + "line": 178, "column": 16 }, "end": { - "line": 167, + "line": 178, "column": 26 } } @@ -58878,15 +61443,15 @@ "updateContext": null }, "value": "=", - "start": 8015, - "end": 8016, + "start": 8256, + "end": 8257, "loc": { "start": { - "line": 167, + "line": 178, "column": 27 }, "end": { - "line": 167, + "line": 178, "column": 28 } } @@ -58904,15 +61469,15 @@ "binop": null }, "value": "fs", - "start": 8017, - "end": 8019, + "start": 8258, + "end": 8260, "loc": { "start": { - "line": 167, + "line": 178, "column": 29 }, "end": { - "line": 167, + "line": 178, "column": 31 } } @@ -58930,15 +61495,15 @@ "binop": null, "updateContext": null }, - "start": 8019, - "end": 8020, + "start": 8260, + "end": 8261, "loc": { "start": { - "line": 167, + "line": 178, "column": 31 }, "end": { - "line": 167, + "line": 178, "column": 32 } } @@ -58956,15 +61521,15 @@ "binop": null }, "value": "readFileSync", - "start": 8020, - "end": 8032, + "start": 8261, + "end": 8273, "loc": { "start": { - "line": 167, + "line": 178, "column": 32 }, "end": { - "line": 167, + "line": 178, "column": 44 } } @@ -58981,15 +61546,15 @@ "postfix": false, "binop": null }, - "start": 8032, - "end": 8033, + "start": 8273, + "end": 8274, "loc": { "start": { - "line": 167, + "line": 178, "column": 44 }, "end": { - "line": 167, + "line": 178, "column": 45 } } @@ -59007,15 +61572,15 @@ "binop": null }, "value": "source", - "start": 8033, - "end": 8039, + "start": 8274, + "end": 8280, "loc": { "start": { - "line": 167, + "line": 178, "column": 45 }, "end": { - "line": 167, + "line": 178, "column": 51 } } @@ -59032,15 +61597,15 @@ "postfix": false, "binop": null }, - "start": 8039, - "end": 8040, + "start": 8280, + "end": 8281, "loc": { "start": { - "line": 167, + "line": 178, "column": 51 }, "end": { - "line": 167, + "line": 178, "column": 52 } } @@ -59058,15 +61623,15 @@ "binop": null, "updateContext": null }, - "start": 8040, - "end": 8041, + "start": 8281, + "end": 8282, "loc": { "start": { - "line": 167, + "line": 178, "column": 52 }, "end": { - "line": 167, + "line": 178, "column": 53 } } @@ -59083,15 +61648,15 @@ "postfix": false, "binop": null }, - "start": 8054, - "end": 8055, + "start": 8295, + "end": 8296, "loc": { "start": { - "line": 168, + "line": 179, "column": 12 }, "end": { - "line": 168, + "line": 179, "column": 13 } } @@ -59111,15 +61676,15 @@ "updateContext": null }, "value": "catch", - "start": 8056, - "end": 8061, + "start": 8297, + "end": 8302, "loc": { "start": { - "line": 168, + "line": 179, "column": 14 }, "end": { - "line": 168, + "line": 179, "column": 19 } } @@ -59136,15 +61701,15 @@ "postfix": false, "binop": null }, - "start": 8062, - "end": 8063, + "start": 8303, + "end": 8304, "loc": { "start": { - "line": 168, + "line": 179, "column": 20 }, "end": { - "line": 168, + "line": 179, "column": 21 } } @@ -59162,15 +61727,15 @@ "binop": null }, "value": "err", - "start": 8063, - "end": 8066, + "start": 8304, + "end": 8307, "loc": { "start": { - "line": 168, + "line": 179, "column": 21 }, "end": { - "line": 168, + "line": 179, "column": 24 } } @@ -59187,15 +61752,15 @@ "postfix": false, "binop": null }, - "start": 8066, - "end": 8067, + "start": 8307, + "end": 8308, "loc": { "start": { - "line": 168, + "line": 179, "column": 24 }, "end": { - "line": 168, + "line": 179, "column": 25 } } @@ -59212,15 +61777,15 @@ "postfix": false, "binop": null }, - "start": 8068, - "end": 8069, + "start": 8309, + "end": 8310, "loc": { "start": { - "line": 168, + "line": 179, "column": 26 }, "end": { - "line": 168, + "line": 179, "column": 27 } } @@ -59238,15 +61803,15 @@ "binop": null }, "value": "reject", - "start": 8086, - "end": 8092, + "start": 8327, + "end": 8333, "loc": { "start": { - "line": 169, + "line": 180, "column": 16 }, "end": { - "line": 169, + "line": 180, "column": 22 } } @@ -59263,15 +61828,15 @@ "postfix": false, "binop": null }, - "start": 8092, - "end": 8093, + "start": 8333, + "end": 8334, "loc": { "start": { - "line": 169, + "line": 180, "column": 22 }, "end": { - "line": 169, + "line": 180, "column": 23 } } @@ -59289,15 +61854,15 @@ "binop": null }, "value": "err", - "start": 8093, - "end": 8096, + "start": 8334, + "end": 8337, "loc": { "start": { - "line": 169, + "line": 180, "column": 23 }, "end": { - "line": 169, + "line": 180, "column": 26 } } @@ -59314,15 +61879,15 @@ "postfix": false, "binop": null }, - "start": 8096, - "end": 8097, + "start": 8337, + "end": 8338, "loc": { "start": { - "line": 169, + "line": 180, "column": 26 }, "end": { - "line": 169, + "line": 180, "column": 27 } } @@ -59340,15 +61905,15 @@ "binop": null, "updateContext": null }, - "start": 8097, - "end": 8098, + "start": 8338, + "end": 8339, "loc": { "start": { - "line": 169, + "line": 180, "column": 27 }, "end": { - "line": 169, + "line": 180, "column": 28 } } @@ -59368,15 +61933,15 @@ "updateContext": null }, "value": "return", - "start": 8115, - "end": 8121, + "start": 8356, + "end": 8362, "loc": { "start": { - "line": 170, + "line": 181, "column": 16 }, "end": { - "line": 170, + "line": 181, "column": 22 } } @@ -59394,15 +61959,15 @@ "binop": null, "updateContext": null }, - "start": 8121, - "end": 8122, + "start": 8362, + "end": 8363, "loc": { "start": { - "line": 170, + "line": 181, "column": 22 }, "end": { - "line": 170, + "line": 181, "column": 23 } } @@ -59419,15 +61984,15 @@ "postfix": false, "binop": null }, - "start": 8135, - "end": 8136, + "start": 8376, + "end": 8377, "loc": { "start": { - "line": 171, + "line": 182, "column": 12 }, "end": { - "line": 171, + "line": 182, "column": 13 } } @@ -59444,15 +62009,15 @@ "postfix": false, "binop": null }, - "start": 8145, - "end": 8146, + "start": 8386, + "end": 8387, "loc": { "start": { - "line": 172, + "line": 183, "column": 8 }, "end": { - "line": 172, + "line": 183, "column": 9 } } @@ -59472,15 +62037,15 @@ "updateContext": null }, "value": "const", - "start": 8156, - "end": 8161, + "start": 8397, + "end": 8402, "loc": { "start": { - "line": 174, + "line": 185, "column": 8 }, "end": { - "line": 174, + "line": 185, "column": 13 } } @@ -59498,15 +62063,15 @@ "binop": null }, "value": "sourceFileSizeBytes", - "start": 8162, - "end": 8181, + "start": 8403, + "end": 8422, "loc": { "start": { - "line": 174, + "line": 185, "column": 14 }, "end": { - "line": 174, + "line": 185, "column": 33 } } @@ -59525,15 +62090,15 @@ "updateContext": null }, "value": "=", - "start": 8182, - "end": 8183, + "start": 8423, + "end": 8424, "loc": { "start": { - "line": 174, + "line": 185, "column": 34 }, "end": { - "line": 174, + "line": 185, "column": 35 } } @@ -59551,15 +62116,15 @@ "binop": null }, "value": "sourceData", - "start": 8184, - "end": 8194, + "start": 8425, + "end": 8435, "loc": { "start": { - "line": 174, + "line": 185, "column": 36 }, "end": { - "line": 174, + "line": 185, "column": 46 } } @@ -59577,15 +62142,15 @@ "binop": null, "updateContext": null }, - "start": 8194, - "end": 8195, + "start": 8435, + "end": 8436, "loc": { "start": { - "line": 174, + "line": 185, "column": 46 }, "end": { - "line": 174, + "line": 185, "column": 47 } } @@ -59603,15 +62168,15 @@ "binop": null }, "value": "byteLength", - "start": 8195, - "end": 8205, + "start": 8436, + "end": 8446, "loc": { "start": { - "line": 174, + "line": 185, "column": 47 }, "end": { - "line": 174, + "line": 185, "column": 57 } } @@ -59629,15 +62194,15 @@ "binop": null, "updateContext": null }, - "start": 8205, - "end": 8206, + "start": 8446, + "end": 8447, "loc": { "start": { - "line": 174, + "line": 185, "column": 57 }, "end": { - "line": 174, + "line": 185, "column": 58 } } @@ -59655,15 +62220,15 @@ "binop": null }, "value": "log", - "start": 8216, - "end": 8219, + "start": 8457, + "end": 8460, "loc": { "start": { - "line": 176, + "line": 187, "column": 8 }, "end": { - "line": 176, + "line": 187, "column": 11 } } @@ -59680,15 +62245,15 @@ "postfix": false, "binop": null }, - "start": 8219, - "end": 8220, + "start": 8460, + "end": 8461, "loc": { "start": { - "line": 176, + "line": 187, "column": 11 }, "end": { - "line": 176, + "line": 187, "column": 12 } } @@ -59707,15 +62272,15 @@ "updateContext": null }, "value": "Input file size: ", - "start": 8220, - "end": 8239, + "start": 8461, + "end": 8480, "loc": { "start": { - "line": 176, + "line": 187, "column": 12 }, "end": { - "line": 176, + "line": 187, "column": 31 } } @@ -59734,15 +62299,15 @@ "updateContext": null }, "value": "+", - "start": 8240, - "end": 8241, + "start": 8481, + "end": 8482, "loc": { "start": { - "line": 176, + "line": 187, "column": 32 }, "end": { - "line": 176, + "line": 187, "column": 33 } } @@ -59759,15 +62324,15 @@ "postfix": false, "binop": null }, - "start": 8242, - "end": 8243, + "start": 8483, + "end": 8484, "loc": { "start": { - "line": 176, + "line": 187, "column": 34 }, "end": { - "line": 176, + "line": 187, "column": 35 } } @@ -59785,15 +62350,15 @@ "binop": null }, "value": "sourceFileSizeBytes", - "start": 8243, - "end": 8262, + "start": 8484, + "end": 8503, "loc": { "start": { - "line": 176, + "line": 187, "column": 35 }, "end": { - "line": 176, + "line": 187, "column": 54 } } @@ -59812,15 +62377,15 @@ "updateContext": null }, "value": "/", - "start": 8263, - "end": 8264, + "start": 8504, + "end": 8505, "loc": { "start": { - "line": 176, + "line": 187, "column": 55 }, "end": { - "line": 176, + "line": 187, "column": 56 } } @@ -59839,15 +62404,15 @@ "updateContext": null }, "value": 1000, - "start": 8265, - "end": 8269, + "start": 8506, + "end": 8510, "loc": { "start": { - "line": 176, + "line": 187, "column": 57 }, "end": { - "line": 176, + "line": 187, "column": 61 } } @@ -59864,15 +62429,15 @@ "postfix": false, "binop": null }, - "start": 8269, - "end": 8270, + "start": 8510, + "end": 8511, "loc": { "start": { - "line": 176, + "line": 187, "column": 61 }, "end": { - "line": 176, + "line": 187, "column": 62 } } @@ -59890,15 +62455,15 @@ "binop": null, "updateContext": null }, - "start": 8270, - "end": 8271, + "start": 8511, + "end": 8512, "loc": { "start": { - "line": 176, + "line": 187, "column": 62 }, "end": { - "line": 176, + "line": 187, "column": 63 } } @@ -59916,15 +62481,15 @@ "binop": null }, "value": "toFixed", - "start": 8271, - "end": 8278, + "start": 8512, + "end": 8519, "loc": { "start": { - "line": 176, + "line": 187, "column": 63 }, "end": { - "line": 176, + "line": 187, "column": 70 } } @@ -59941,15 +62506,15 @@ "postfix": false, "binop": null }, - "start": 8278, - "end": 8279, + "start": 8519, + "end": 8520, "loc": { "start": { - "line": 176, + "line": 187, "column": 70 }, "end": { - "line": 176, + "line": 187, "column": 71 } } @@ -59968,15 +62533,15 @@ "updateContext": null }, "value": 2, - "start": 8279, - "end": 8280, + "start": 8520, + "end": 8521, "loc": { "start": { - "line": 176, + "line": 187, "column": 71 }, "end": { - "line": 176, + "line": 187, "column": 72 } } @@ -59993,15 +62558,15 @@ "postfix": false, "binop": null }, - "start": 8280, - "end": 8281, + "start": 8521, + "end": 8522, "loc": { "start": { - "line": 176, + "line": 187, "column": 72 }, "end": { - "line": 176, + "line": 187, "column": 73 } } @@ -60020,15 +62585,15 @@ "updateContext": null }, "value": "+", - "start": 8282, - "end": 8283, + "start": 8523, + "end": 8524, "loc": { "start": { - "line": 176, + "line": 187, "column": 74 }, "end": { - "line": 176, + "line": 187, "column": 75 } } @@ -60047,15 +62612,15 @@ "updateContext": null }, "value": " kB", - "start": 8284, - "end": 8289, + "start": 8525, + "end": 8530, "loc": { "start": { - "line": 176, + "line": 187, "column": 76 }, "end": { - "line": 176, + "line": 187, "column": 81 } } @@ -60072,15 +62637,15 @@ "postfix": false, "binop": null }, - "start": 8289, - "end": 8290, + "start": 8530, + "end": 8531, "loc": { "start": { - "line": 176, + "line": 187, "column": 81 }, "end": { - "line": 176, + "line": 187, "column": 82 } } @@ -60098,15 +62663,15 @@ "binop": null, "updateContext": null }, - "start": 8290, - "end": 8291, + "start": 8531, + "end": 8532, "loc": { "start": { - "line": 176, + "line": 187, "column": 82 }, "end": { - "line": 176, + "line": 187, "column": 83 } } @@ -60126,15 +62691,15 @@ "updateContext": null }, "value": "if", - "start": 8301, - "end": 8303, + "start": 8542, + "end": 8544, "loc": { "start": { - "line": 178, + "line": 189, "column": 8 }, "end": { - "line": 178, + "line": 189, "column": 10 } } @@ -60151,15 +62716,15 @@ "postfix": false, "binop": null }, - "start": 8304, - "end": 8305, + "start": 8545, + "end": 8546, "loc": { "start": { - "line": 178, + "line": 189, "column": 11 }, "end": { - "line": 178, + "line": 189, "column": 12 } } @@ -60178,15 +62743,15 @@ "updateContext": null }, "value": "!", - "start": 8305, - "end": 8306, + "start": 8546, + "end": 8547, "loc": { "start": { - "line": 178, + "line": 189, "column": 12 }, "end": { - "line": 178, + "line": 189, "column": 13 } } @@ -60204,15 +62769,15 @@ "binop": null }, "value": "metaModelDataStr", - "start": 8306, - "end": 8322, + "start": 8547, + "end": 8563, "loc": { "start": { - "line": 178, + "line": 189, "column": 13 }, "end": { - "line": 178, + "line": 189, "column": 29 } } @@ -60231,15 +62796,15 @@ "updateContext": null }, "value": "&&", - "start": 8323, - "end": 8325, + "start": 8564, + "end": 8566, "loc": { "start": { - "line": 178, + "line": 189, "column": 30 }, "end": { - "line": 178, + "line": 189, "column": 32 } } @@ -60257,15 +62822,15 @@ "binop": null }, "value": "metaModelSource", - "start": 8326, - "end": 8341, + "start": 8567, + "end": 8582, "loc": { "start": { - "line": 178, + "line": 189, "column": 33 }, "end": { - "line": 178, + "line": 189, "column": 48 } } @@ -60282,15 +62847,15 @@ "postfix": false, "binop": null }, - "start": 8341, - "end": 8342, + "start": 8582, + "end": 8583, "loc": { "start": { - "line": 178, + "line": 189, "column": 48 }, "end": { - "line": 178, + "line": 189, "column": 49 } } @@ -60307,15 +62872,15 @@ "postfix": false, "binop": null }, - "start": 8343, - "end": 8344, + "start": 8584, + "end": 8585, "loc": { "start": { - "line": 178, + "line": 189, "column": 50 }, "end": { - "line": 178, + "line": 189, "column": 51 } } @@ -60333,15 +62898,15 @@ "binop": null }, "value": "log", - "start": 8357, - "end": 8360, + "start": 8598, + "end": 8601, "loc": { "start": { - "line": 179, + "line": 190, "column": 12 }, "end": { - "line": 179, + "line": 190, "column": 15 } } @@ -60358,15 +62923,15 @@ "postfix": false, "binop": null }, - "start": 8360, - "end": 8361, + "start": 8601, + "end": 8602, "loc": { "start": { - "line": 179, + "line": 190, "column": 15 }, "end": { - "line": 179, + "line": 190, "column": 16 } } @@ -60385,15 +62950,15 @@ "updateContext": null }, "value": "Reading input metadata file: ", - "start": 8361, - "end": 8392, + "start": 8602, + "end": 8633, "loc": { "start": { - "line": 179, + "line": 190, "column": 16 }, "end": { - "line": 179, + "line": 190, "column": 47 } } @@ -60412,15 +62977,15 @@ "updateContext": null }, "value": "+", - "start": 8393, - "end": 8394, + "start": 8634, + "end": 8635, "loc": { "start": { - "line": 179, + "line": 190, "column": 48 }, "end": { - "line": 179, + "line": 190, "column": 49 } } @@ -60438,15 +63003,15 @@ "binop": null }, "value": "metaModelSource", - "start": 8395, - "end": 8410, + "start": 8636, + "end": 8651, "loc": { "start": { - "line": 179, + "line": 190, "column": 50 }, "end": { - "line": 179, + "line": 190, "column": 65 } } @@ -60463,15 +63028,15 @@ "postfix": false, "binop": null }, - "start": 8410, - "end": 8411, + "start": 8651, + "end": 8652, "loc": { "start": { - "line": 179, + "line": 190, "column": 65 }, "end": { - "line": 179, + "line": 190, "column": 66 } } @@ -60489,15 +63054,15 @@ "binop": null, "updateContext": null }, - "start": 8411, - "end": 8412, + "start": 8652, + "end": 8653, "loc": { "start": { - "line": 179, + "line": 190, "column": 66 }, "end": { - "line": 179, + "line": 190, "column": 67 } } @@ -60517,15 +63082,15 @@ "updateContext": null }, "value": "try", - "start": 8425, - "end": 8428, + "start": 8666, + "end": 8669, "loc": { "start": { - "line": 180, + "line": 191, "column": 12 }, "end": { - "line": 180, + "line": 191, "column": 15 } } @@ -60542,15 +63107,15 @@ "postfix": false, "binop": null }, - "start": 8429, - "end": 8430, + "start": 8670, + "end": 8671, "loc": { "start": { - "line": 180, + "line": 191, "column": 16 }, "end": { - "line": 180, + "line": 191, "column": 17 } } @@ -60568,15 +63133,15 @@ "binop": null }, "value": "metaModelDataStr", - "start": 8447, - "end": 8463, + "start": 8688, + "end": 8704, "loc": { "start": { - "line": 181, + "line": 192, "column": 16 }, "end": { - "line": 181, + "line": 192, "column": 32 } } @@ -60595,15 +63160,15 @@ "updateContext": null }, "value": "=", - "start": 8464, - "end": 8465, + "start": 8705, + "end": 8706, "loc": { "start": { - "line": 181, + "line": 192, "column": 33 }, "end": { - "line": 181, + "line": 192, "column": 34 } } @@ -60621,15 +63186,15 @@ "binop": null }, "value": "fs", - "start": 8466, - "end": 8468, + "start": 8707, + "end": 8709, "loc": { "start": { - "line": 181, + "line": 192, "column": 35 }, "end": { - "line": 181, + "line": 192, "column": 37 } } @@ -60647,15 +63212,15 @@ "binop": null, "updateContext": null }, - "start": 8468, - "end": 8469, + "start": 8709, + "end": 8710, "loc": { "start": { - "line": 181, + "line": 192, "column": 37 }, "end": { - "line": 181, + "line": 192, "column": 38 } } @@ -60673,15 +63238,15 @@ "binop": null }, "value": "readFileSync", - "start": 8469, - "end": 8481, + "start": 8710, + "end": 8722, "loc": { "start": { - "line": 181, + "line": 192, "column": 38 }, "end": { - "line": 181, + "line": 192, "column": 50 } } @@ -60698,15 +63263,15 @@ "postfix": false, "binop": null }, - "start": 8481, - "end": 8482, + "start": 8722, + "end": 8723, "loc": { "start": { - "line": 181, + "line": 192, "column": 50 }, "end": { - "line": 181, + "line": 192, "column": 51 } } @@ -60724,15 +63289,15 @@ "binop": null }, "value": "metaModelSource", - "start": 8482, - "end": 8497, + "start": 8723, + "end": 8738, "loc": { "start": { - "line": 181, + "line": 192, "column": 51 }, "end": { - "line": 181, + "line": 192, "column": 66 } } @@ -60749,15 +63314,15 @@ "postfix": false, "binop": null }, - "start": 8497, - "end": 8498, + "start": 8738, + "end": 8739, "loc": { "start": { - "line": 181, + "line": 192, "column": 66 }, "end": { - "line": 181, + "line": 192, "column": 67 } } @@ -60775,15 +63340,15 @@ "binop": null, "updateContext": null }, - "start": 8498, - "end": 8499, + "start": 8739, + "end": 8740, "loc": { "start": { - "line": 181, + "line": 192, "column": 67 }, "end": { - "line": 181, + "line": 192, "column": 68 } } @@ -60800,15 +63365,15 @@ "postfix": false, "binop": null }, - "start": 8512, - "end": 8513, + "start": 8753, + "end": 8754, "loc": { "start": { - "line": 182, + "line": 193, "column": 12 }, "end": { - "line": 182, + "line": 193, "column": 13 } } @@ -60828,15 +63393,15 @@ "updateContext": null }, "value": "catch", - "start": 8514, - "end": 8519, + "start": 8755, + "end": 8760, "loc": { "start": { - "line": 182, + "line": 193, "column": 14 }, "end": { - "line": 182, + "line": 193, "column": 19 } } @@ -60853,15 +63418,15 @@ "postfix": false, "binop": null }, - "start": 8520, - "end": 8521, + "start": 8761, + "end": 8762, "loc": { "start": { - "line": 182, + "line": 193, "column": 20 }, "end": { - "line": 182, + "line": 193, "column": 21 } } @@ -60879,15 +63444,15 @@ "binop": null }, "value": "err", - "start": 8521, - "end": 8524, + "start": 8762, + "end": 8765, "loc": { "start": { - "line": 182, + "line": 193, "column": 21 }, "end": { - "line": 182, + "line": 193, "column": 24 } } @@ -60904,15 +63469,15 @@ "postfix": false, "binop": null }, - "start": 8524, - "end": 8525, + "start": 8765, + "end": 8766, "loc": { "start": { - "line": 182, + "line": 193, "column": 24 }, "end": { - "line": 182, + "line": 193, "column": 25 } } @@ -60929,15 +63494,15 @@ "postfix": false, "binop": null }, - "start": 8526, - "end": 8527, + "start": 8767, + "end": 8768, "loc": { "start": { - "line": 182, + "line": 193, "column": 26 }, "end": { - "line": 182, + "line": 193, "column": 27 } } @@ -60955,15 +63520,15 @@ "binop": null }, "value": "reject", - "start": 8544, - "end": 8550, + "start": 8785, + "end": 8791, "loc": { "start": { - "line": 183, + "line": 194, "column": 16 }, "end": { - "line": 183, + "line": 194, "column": 22 } } @@ -60980,15 +63545,15 @@ "postfix": false, "binop": null }, - "start": 8550, - "end": 8551, + "start": 8791, + "end": 8792, "loc": { "start": { - "line": 183, + "line": 194, "column": 22 }, "end": { - "line": 183, + "line": 194, "column": 23 } } @@ -61006,15 +63571,15 @@ "binop": null }, "value": "err", - "start": 8551, - "end": 8554, + "start": 8792, + "end": 8795, "loc": { "start": { - "line": 183, + "line": 194, "column": 23 }, "end": { - "line": 183, + "line": 194, "column": 26 } } @@ -61031,15 +63596,15 @@ "postfix": false, "binop": null }, - "start": 8554, - "end": 8555, + "start": 8795, + "end": 8796, "loc": { "start": { - "line": 183, + "line": 194, "column": 26 }, "end": { - "line": 183, + "line": 194, "column": 27 } } @@ -61057,15 +63622,15 @@ "binop": null, "updateContext": null }, - "start": 8555, - "end": 8556, + "start": 8796, + "end": 8797, "loc": { "start": { - "line": 183, + "line": 194, "column": 27 }, "end": { - "line": 183, + "line": 194, "column": 28 } } @@ -61085,15 +63650,15 @@ "updateContext": null }, "value": "return", - "start": 8573, - "end": 8579, + "start": 8814, + "end": 8820, "loc": { "start": { - "line": 184, + "line": 195, "column": 16 }, "end": { - "line": 184, + "line": 195, "column": 22 } } @@ -61111,15 +63676,15 @@ "binop": null, "updateContext": null }, - "start": 8579, - "end": 8580, + "start": 8820, + "end": 8821, "loc": { "start": { - "line": 184, + "line": 195, "column": 22 }, "end": { - "line": 184, + "line": 195, "column": 23 } } @@ -61136,15 +63701,15 @@ "postfix": false, "binop": null }, - "start": 8593, - "end": 8594, + "start": 8834, + "end": 8835, "loc": { "start": { - "line": 185, + "line": 196, "column": 12 }, "end": { - "line": 185, + "line": 196, "column": 13 } } @@ -61161,15 +63726,15 @@ "postfix": false, "binop": null }, - "start": 8603, - "end": 8604, + "start": 8844, + "end": 8845, "loc": { "start": { - "line": 186, + "line": 197, "column": 8 }, "end": { - "line": 186, + "line": 197, "column": 9 } } @@ -61189,15 +63754,15 @@ "updateContext": null }, "value": "else", - "start": 8605, - "end": 8609, + "start": 8846, + "end": 8850, "loc": { "start": { - "line": 186, + "line": 197, "column": 10 }, "end": { - "line": 186, + "line": 197, "column": 14 } } @@ -61214,15 +63779,15 @@ "postfix": false, "binop": null }, - "start": 8610, - "end": 8611, + "start": 8851, + "end": 8852, "loc": { "start": { - "line": 186, + "line": 197, "column": 15 }, "end": { - "line": 186, + "line": 197, "column": 16 } } @@ -61240,15 +63805,15 @@ "binop": null }, "value": "log", - "start": 8624, - "end": 8627, + "start": 8865, + "end": 8868, "loc": { "start": { - "line": 187, + "line": 198, "column": 12 }, "end": { - "line": 187, + "line": 198, "column": 15 } } @@ -61265,15 +63830,15 @@ "postfix": false, "binop": null }, - "start": 8627, - "end": 8628, + "start": 8868, + "end": 8869, "loc": { "start": { - "line": 187, + "line": 198, "column": 15 }, "end": { - "line": 187, + "line": 198, "column": 16 } } @@ -61290,15 +63855,15 @@ "postfix": false, "binop": null }, - "start": 8628, - "end": 8629, + "start": 8869, + "end": 8870, "loc": { "start": { - "line": 187, + "line": 198, "column": 16 }, "end": { - "line": 187, + "line": 198, "column": 17 } } @@ -61317,15 +63882,15 @@ "updateContext": null }, "value": "Not embedding metadata in XKT", - "start": 8629, - "end": 8658, + "start": 8870, + "end": 8899, "loc": { "start": { - "line": 187, + "line": 198, "column": 17 }, "end": { - "line": 187, + "line": 198, "column": 46 } } @@ -61342,15 +63907,15 @@ "postfix": false, "binop": null }, - "start": 8658, - "end": 8659, + "start": 8899, + "end": 8900, "loc": { "start": { - "line": 187, + "line": 198, "column": 46 }, "end": { - "line": 187, + "line": 198, "column": 47 } } @@ -61367,15 +63932,15 @@ "postfix": false, "binop": null }, - "start": 8659, - "end": 8660, + "start": 8900, + "end": 8901, "loc": { "start": { - "line": 187, + "line": 198, "column": 47 }, "end": { - "line": 187, + "line": 198, "column": 48 } } @@ -61393,15 +63958,15 @@ "binop": null, "updateContext": null }, - "start": 8660, - "end": 8661, + "start": 8901, + "end": 8902, "loc": { "start": { - "line": 187, + "line": 198, "column": 48 }, "end": { - "line": 187, + "line": 198, "column": 49 } } @@ -61418,15 +63983,15 @@ "postfix": false, "binop": null }, - "start": 8670, - "end": 8671, + "start": 8911, + "end": 8912, "loc": { "start": { - "line": 188, + "line": 199, "column": 8 }, "end": { - "line": 188, + "line": 199, "column": 9 } } @@ -61446,15 +64011,15 @@ "updateContext": null }, "value": "let", - "start": 8681, - "end": 8684, + "start": 8922, + "end": 8925, "loc": { "start": { - "line": 190, + "line": 201, "column": 8 }, "end": { - "line": 190, + "line": 201, "column": 11 } } @@ -61472,15 +64037,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 8685, - "end": 8698, + "start": 8926, + "end": 8939, "loc": { "start": { - "line": 190, + "line": 201, "column": 12 }, "end": { - "line": 190, + "line": 201, "column": 25 } } @@ -61498,15 +64063,15 @@ "binop": null, "updateContext": null }, - "start": 8698, - "end": 8699, + "start": 8939, + "end": 8940, "loc": { "start": { - "line": 190, + "line": 201, "column": 25 }, "end": { - "line": 190, + "line": 201, "column": 26 } } @@ -61526,15 +64091,15 @@ "updateContext": null }, "value": "if", - "start": 8709, - "end": 8711, + "start": 8950, + "end": 8952, "loc": { "start": { - "line": 192, + "line": 203, "column": 8 }, "end": { - "line": 192, + "line": 203, "column": 10 } } @@ -61551,15 +64116,15 @@ "postfix": false, "binop": null }, - "start": 8712, - "end": 8713, + "start": 8953, + "end": 8954, "loc": { "start": { - "line": 192, + "line": 203, "column": 11 }, "end": { - "line": 192, + "line": 203, "column": 12 } } @@ -61577,15 +64142,15 @@ "binop": null }, "value": "metaModelDataStr", - "start": 8713, - "end": 8729, + "start": 8954, + "end": 8970, "loc": { "start": { - "line": 192, + "line": 203, "column": 12 }, "end": { - "line": 192, + "line": 203, "column": 28 } } @@ -61602,15 +64167,15 @@ "postfix": false, "binop": null }, - "start": 8729, - "end": 8730, + "start": 8970, + "end": 8971, "loc": { "start": { - "line": 192, + "line": 203, "column": 28 }, "end": { - "line": 192, + "line": 203, "column": 29 } } @@ -61627,15 +64192,15 @@ "postfix": false, "binop": null }, - "start": 8731, - "end": 8732, + "start": 8972, + "end": 8973, "loc": { "start": { - "line": 192, + "line": 203, "column": 30 }, "end": { - "line": 192, + "line": 203, "column": 31 } } @@ -61655,15 +64220,15 @@ "updateContext": null }, "value": "try", - "start": 8745, - "end": 8748, + "start": 8986, + "end": 8989, "loc": { "start": { - "line": 193, + "line": 204, "column": 12 }, "end": { - "line": 193, + "line": 204, "column": 15 } } @@ -61680,15 +64245,15 @@ "postfix": false, "binop": null }, - "start": 8749, - "end": 8750, + "start": 8990, + "end": 8991, "loc": { "start": { - "line": 193, + "line": 204, "column": 16 }, "end": { - "line": 193, + "line": 204, "column": 17 } } @@ -61706,15 +64271,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 8767, - "end": 8780, + "start": 9008, + "end": 9021, "loc": { "start": { - "line": 194, + "line": 205, "column": 16 }, "end": { - "line": 194, + "line": 205, "column": 29 } } @@ -61733,15 +64298,15 @@ "updateContext": null }, "value": "=", - "start": 8781, - "end": 8782, + "start": 9022, + "end": 9023, "loc": { "start": { - "line": 194, + "line": 205, "column": 30 }, "end": { - "line": 194, + "line": 205, "column": 31 } } @@ -61759,15 +64324,15 @@ "binop": null }, "value": "JSON", - "start": 8783, - "end": 8787, + "start": 9024, + "end": 9028, "loc": { "start": { - "line": 194, + "line": 205, "column": 32 }, "end": { - "line": 194, + "line": 205, "column": 36 } } @@ -61785,15 +64350,15 @@ "binop": null, "updateContext": null }, - "start": 8787, - "end": 8788, + "start": 9028, + "end": 9029, "loc": { "start": { - "line": 194, + "line": 205, "column": 36 }, "end": { - "line": 194, + "line": 205, "column": 37 } } @@ -61811,15 +64376,15 @@ "binop": null }, "value": "parse", - "start": 8788, - "end": 8793, + "start": 9029, + "end": 9034, "loc": { "start": { - "line": 194, + "line": 205, "column": 37 }, "end": { - "line": 194, + "line": 205, "column": 42 } } @@ -61836,15 +64401,15 @@ "postfix": false, "binop": null }, - "start": 8793, - "end": 8794, + "start": 9034, + "end": 9035, "loc": { "start": { - "line": 194, + "line": 205, "column": 42 }, "end": { - "line": 194, + "line": 205, "column": 43 } } @@ -61862,15 +64427,15 @@ "binop": null }, "value": "metaModelDataStr", - "start": 8794, - "end": 8810, + "start": 9035, + "end": 9051, "loc": { "start": { - "line": 194, + "line": 205, "column": 43 }, "end": { - "line": 194, + "line": 205, "column": 59 } } @@ -61887,15 +64452,15 @@ "postfix": false, "binop": null }, - "start": 8810, - "end": 8811, + "start": 9051, + "end": 9052, "loc": { "start": { - "line": 194, + "line": 205, "column": 59 }, "end": { - "line": 194, + "line": 205, "column": 60 } } @@ -61913,15 +64478,15 @@ "binop": null, "updateContext": null }, - "start": 8811, - "end": 8812, + "start": 9052, + "end": 9053, "loc": { "start": { - "line": 194, + "line": 205, "column": 60 }, "end": { - "line": 194, + "line": 205, "column": 61 } } @@ -61938,15 +64503,15 @@ "postfix": false, "binop": null }, - "start": 8825, - "end": 8826, + "start": 9066, + "end": 9067, "loc": { "start": { - "line": 195, + "line": 206, "column": 12 }, "end": { - "line": 195, + "line": 206, "column": 13 } } @@ -61966,15 +64531,15 @@ "updateContext": null }, "value": "catch", - "start": 8827, - "end": 8832, + "start": 9068, + "end": 9073, "loc": { "start": { - "line": 195, + "line": 206, "column": 14 }, "end": { - "line": 195, + "line": 206, "column": 19 } } @@ -61991,15 +64556,15 @@ "postfix": false, "binop": null }, - "start": 8833, - "end": 8834, + "start": 9074, + "end": 9075, "loc": { "start": { - "line": 195, + "line": 206, "column": 20 }, "end": { - "line": 195, + "line": 206, "column": 21 } } @@ -62017,15 +64582,15 @@ "binop": null }, "value": "e", - "start": 8834, - "end": 8835, + "start": 9075, + "end": 9076, "loc": { "start": { - "line": 195, + "line": 206, "column": 21 }, "end": { - "line": 195, + "line": 206, "column": 22 } } @@ -62042,15 +64607,15 @@ "postfix": false, "binop": null }, - "start": 8835, - "end": 8836, + "start": 9076, + "end": 9077, "loc": { "start": { - "line": 195, + "line": 206, "column": 22 }, "end": { - "line": 195, + "line": 206, "column": 23 } } @@ -62067,15 +64632,15 @@ "postfix": false, "binop": null }, - "start": 8837, - "end": 8838, + "start": 9078, + "end": 9079, "loc": { "start": { - "line": 195, + "line": 206, "column": 24 }, "end": { - "line": 195, + "line": 206, "column": 25 } } @@ -62093,15 +64658,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 8855, - "end": 8868, + "start": 9096, + "end": 9109, "loc": { "start": { - "line": 196, + "line": 207, "column": 16 }, "end": { - "line": 196, + "line": 207, "column": 29 } } @@ -62120,15 +64685,15 @@ "updateContext": null }, "value": "=", - "start": 8869, - "end": 8870, + "start": 9110, + "end": 9111, "loc": { "start": { - "line": 196, + "line": 207, "column": 30 }, "end": { - "line": 196, + "line": 207, "column": 31 } } @@ -62145,15 +64710,15 @@ "postfix": false, "binop": null }, - "start": 8871, - "end": 8872, + "start": 9112, + "end": 9113, "loc": { "start": { - "line": 196, + "line": 207, "column": 32 }, "end": { - "line": 196, + "line": 207, "column": 33 } } @@ -62170,15 +64735,15 @@ "postfix": false, "binop": null }, - "start": 8872, - "end": 8873, + "start": 9113, + "end": 9114, "loc": { "start": { - "line": 196, + "line": 207, "column": 33 }, "end": { - "line": 196, + "line": 207, "column": 34 } } @@ -62196,15 +64761,15 @@ "binop": null, "updateContext": null }, - "start": 8873, - "end": 8874, + "start": 9114, + "end": 9115, "loc": { "start": { - "line": 196, + "line": 207, "column": 34 }, "end": { - "line": 196, + "line": 207, "column": 35 } } @@ -62222,15 +64787,15 @@ "binop": null }, "value": "log", - "start": 8891, - "end": 8894, + "start": 9132, + "end": 9135, "loc": { "start": { - "line": 197, + "line": 208, "column": 16 }, "end": { - "line": 197, + "line": 208, "column": 19 } } @@ -62247,15 +64812,15 @@ "postfix": false, "binop": null }, - "start": 8894, - "end": 8895, + "start": 9135, + "end": 9136, "loc": { "start": { - "line": 197, + "line": 208, "column": 19 }, "end": { - "line": 197, + "line": 208, "column": 20 } } @@ -62272,15 +64837,15 @@ "postfix": false, "binop": null }, - "start": 8895, - "end": 8896, + "start": 9136, + "end": 9137, "loc": { "start": { - "line": 197, + "line": 208, "column": 20 }, "end": { - "line": 197, + "line": 208, "column": 21 } } @@ -62299,15 +64864,15 @@ "updateContext": null }, "value": "Error parsing metadata JSON: ", - "start": 8896, - "end": 8925, + "start": 9137, + "end": 9166, "loc": { "start": { - "line": 197, + "line": 208, "column": 21 }, "end": { - "line": 197, + "line": 208, "column": 50 } } @@ -62324,15 +64889,15 @@ "postfix": false, "binop": null }, - "start": 8925, - "end": 8927, + "start": 9166, + "end": 9168, "loc": { "start": { - "line": 197, + "line": 208, "column": 50 }, "end": { - "line": 197, + "line": 208, "column": 52 } } @@ -62350,15 +64915,15 @@ "binop": null }, "value": "e", - "start": 8927, - "end": 8928, + "start": 9168, + "end": 9169, "loc": { "start": { - "line": 197, + "line": 208, "column": 52 }, "end": { - "line": 197, + "line": 208, "column": 53 } } @@ -62375,15 +64940,15 @@ "postfix": false, "binop": null }, - "start": 8928, - "end": 8929, + "start": 9169, + "end": 9170, "loc": { "start": { - "line": 197, + "line": 208, "column": 53 }, "end": { - "line": 197, + "line": 208, "column": 54 } } @@ -62402,15 +64967,15 @@ "updateContext": null }, "value": "", - "start": 8929, - "end": 8929, + "start": 9170, + "end": 9170, "loc": { "start": { - "line": 197, + "line": 208, "column": 54 }, "end": { - "line": 197, + "line": 208, "column": 54 } } @@ -62427,15 +64992,15 @@ "postfix": false, "binop": null }, - "start": 8929, - "end": 8930, + "start": 9170, + "end": 9171, "loc": { "start": { - "line": 197, + "line": 208, "column": 54 }, "end": { - "line": 197, + "line": 208, "column": 55 } } @@ -62452,15 +65017,15 @@ "postfix": false, "binop": null }, - "start": 8930, - "end": 8931, + "start": 9171, + "end": 9172, "loc": { "start": { - "line": 197, + "line": 208, "column": 55 }, "end": { - "line": 197, + "line": 208, "column": 56 } } @@ -62478,15 +65043,15 @@ "binop": null, "updateContext": null }, - "start": 8931, - "end": 8932, + "start": 9172, + "end": 9173, "loc": { "start": { - "line": 197, + "line": 208, "column": 56 }, "end": { - "line": 197, + "line": 208, "column": 57 } } @@ -62503,15 +65068,15 @@ "postfix": false, "binop": null }, - "start": 8945, - "end": 8946, + "start": 9186, + "end": 9187, "loc": { "start": { - "line": 198, + "line": 209, "column": 12 }, "end": { - "line": 198, + "line": 209, "column": 13 } } @@ -62528,15 +65093,15 @@ "postfix": false, "binop": null }, - "start": 8955, - "end": 8956, + "start": 9196, + "end": 9197, "loc": { "start": { - "line": 199, + "line": 210, "column": 8 }, "end": { - "line": 199, + "line": 210, "column": 9 } } @@ -62554,15 +65119,15 @@ "binop": null }, "value": "minTileSize", - "start": 8966, - "end": 8977, + "start": 9207, + "end": 9218, "loc": { "start": { - "line": 201, + "line": 212, "column": 8 }, "end": { - "line": 201, + "line": 212, "column": 19 } } @@ -62581,15 +65146,15 @@ "updateContext": null }, "value": "=", - "start": 8978, - "end": 8979, + "start": 9219, + "end": 9220, "loc": { "start": { - "line": 201, + "line": 212, "column": 20 }, "end": { - "line": 201, + "line": 212, "column": 21 } } @@ -62607,15 +65172,15 @@ "binop": null }, "value": "overrideOption", - "start": 8980, - "end": 8994, + "start": 9221, + "end": 9235, "loc": { "start": { - "line": 201, + "line": 212, "column": 22 }, "end": { - "line": 201, + "line": 212, "column": 36 } } @@ -62632,15 +65197,15 @@ "postfix": false, "binop": null }, - "start": 8994, - "end": 8995, + "start": 9235, + "end": 9236, "loc": { "start": { - "line": 201, + "line": 212, "column": 36 }, "end": { - "line": 201, + "line": 212, "column": 37 } } @@ -62658,15 +65223,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 8995, - "end": 9010, + "start": 9236, + "end": 9251, "loc": { "start": { - "line": 201, + "line": 212, "column": 37 }, "end": { - "line": 201, + "line": 212, "column": 52 } } @@ -62684,15 +65249,15 @@ "binop": null, "updateContext": null }, - "start": 9010, - "end": 9011, + "start": 9251, + "end": 9252, "loc": { "start": { - "line": 201, + "line": 212, "column": 52 }, "end": { - "line": 201, + "line": 212, "column": 53 } } @@ -62710,15 +65275,15 @@ "binop": null }, "value": "minTileSize", - "start": 9011, - "end": 9022, + "start": 9252, + "end": 9263, "loc": { "start": { - "line": 201, + "line": 212, "column": 53 }, "end": { - "line": 201, + "line": 212, "column": 64 } } @@ -62736,15 +65301,15 @@ "binop": null, "updateContext": null }, - "start": 9022, - "end": 9023, + "start": 9263, + "end": 9264, "loc": { "start": { - "line": 201, + "line": 212, "column": 64 }, "end": { - "line": 201, + "line": 212, "column": 65 } } @@ -62762,15 +65327,15 @@ "binop": null }, "value": "minTileSize", - "start": 9024, - "end": 9035, + "start": 9265, + "end": 9276, "loc": { "start": { - "line": 201, + "line": 212, "column": 66 }, "end": { - "line": 201, + "line": 212, "column": 77 } } @@ -62787,15 +65352,15 @@ "postfix": false, "binop": null }, - "start": 9035, - "end": 9036, + "start": 9276, + "end": 9277, "loc": { "start": { - "line": 201, + "line": 212, "column": 77 }, "end": { - "line": 201, + "line": 212, "column": 78 } } @@ -62813,15 +65378,15 @@ "binop": null, "updateContext": null }, - "start": 9036, - "end": 9037, + "start": 9277, + "end": 9278, "loc": { "start": { - "line": 201, + "line": 212, "column": 78 }, "end": { - "line": 201, + "line": 212, "column": 79 } } @@ -62839,15 +65404,15 @@ "binop": null }, "value": "rotateX", - "start": 9046, - "end": 9053, + "start": 9287, + "end": 9294, "loc": { "start": { - "line": 202, + "line": 213, "column": 8 }, "end": { - "line": 202, + "line": 213, "column": 15 } } @@ -62866,15 +65431,15 @@ "updateContext": null }, "value": "=", - "start": 9054, - "end": 9055, + "start": 9295, + "end": 9296, "loc": { "start": { - "line": 202, + "line": 213, "column": 16 }, "end": { - "line": 202, + "line": 213, "column": 17 } } @@ -62892,15 +65457,15 @@ "binop": null }, "value": "overrideOption", - "start": 9056, - "end": 9070, + "start": 9297, + "end": 9311, "loc": { "start": { - "line": 202, + "line": 213, "column": 18 }, "end": { - "line": 202, + "line": 213, "column": 32 } } @@ -62917,15 +65482,15 @@ "postfix": false, "binop": null }, - "start": 9070, - "end": 9071, + "start": 9311, + "end": 9312, "loc": { "start": { - "line": 202, + "line": 213, "column": 32 }, "end": { - "line": 202, + "line": 213, "column": 33 } } @@ -62943,15 +65508,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9071, - "end": 9086, + "start": 9312, + "end": 9327, "loc": { "start": { - "line": 202, + "line": 213, "column": 33 }, "end": { - "line": 202, + "line": 213, "column": 48 } } @@ -62969,15 +65534,15 @@ "binop": null, "updateContext": null }, - "start": 9086, - "end": 9087, + "start": 9327, + "end": 9328, "loc": { "start": { - "line": 202, + "line": 213, "column": 48 }, "end": { - "line": 202, + "line": 213, "column": 49 } } @@ -62995,15 +65560,15 @@ "binop": null }, "value": "rotateX", - "start": 9087, - "end": 9094, + "start": 9328, + "end": 9335, "loc": { "start": { - "line": 202, + "line": 213, "column": 49 }, "end": { - "line": 202, + "line": 213, "column": 56 } } @@ -63021,15 +65586,15 @@ "binop": null, "updateContext": null }, - "start": 9094, - "end": 9095, + "start": 9335, + "end": 9336, "loc": { "start": { - "line": 202, + "line": 213, "column": 56 }, "end": { - "line": 202, + "line": 213, "column": 57 } } @@ -63047,15 +65612,15 @@ "binop": null }, "value": "rotateX", - "start": 9096, - "end": 9103, + "start": 9337, + "end": 9344, "loc": { "start": { - "line": 202, + "line": 213, "column": 58 }, "end": { - "line": 202, + "line": 213, "column": 65 } } @@ -63072,15 +65637,15 @@ "postfix": false, "binop": null }, - "start": 9103, - "end": 9104, + "start": 9344, + "end": 9345, "loc": { "start": { - "line": 202, + "line": 213, "column": 65 }, "end": { - "line": 202, + "line": 213, "column": 66 } } @@ -63098,15 +65663,15 @@ "binop": null, "updateContext": null }, - "start": 9104, - "end": 9105, + "start": 9345, + "end": 9346, "loc": { "start": { - "line": 202, + "line": 213, "column": 66 }, "end": { - "line": 202, + "line": 213, "column": 67 } } @@ -63124,15 +65689,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 9114, - "end": 9129, + "start": 9355, + "end": 9370, "loc": { "start": { - "line": 203, + "line": 214, "column": 8 }, "end": { - "line": 203, + "line": 214, "column": 23 } } @@ -63151,15 +65716,15 @@ "updateContext": null }, "value": "=", - "start": 9130, - "end": 9131, + "start": 9371, + "end": 9372, "loc": { "start": { - "line": 203, + "line": 214, "column": 24 }, "end": { - "line": 203, + "line": 214, "column": 25 } } @@ -63177,15 +65742,15 @@ "binop": null }, "value": "overrideOption", - "start": 9132, - "end": 9146, + "start": 9373, + "end": 9387, "loc": { "start": { - "line": 203, + "line": 214, "column": 26 }, "end": { - "line": 203, + "line": 214, "column": 40 } } @@ -63202,15 +65767,15 @@ "postfix": false, "binop": null }, - "start": 9146, - "end": 9147, + "start": 9387, + "end": 9388, "loc": { "start": { - "line": 203, + "line": 214, "column": 40 }, "end": { - "line": 203, + "line": 214, "column": 41 } } @@ -63228,15 +65793,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9147, - "end": 9162, + "start": 9388, + "end": 9403, "loc": { "start": { - "line": 203, + "line": 214, "column": 41 }, "end": { - "line": 203, + "line": 214, "column": 56 } } @@ -63254,15 +65819,15 @@ "binop": null, "updateContext": null }, - "start": 9162, - "end": 9163, + "start": 9403, + "end": 9404, "loc": { "start": { - "line": 203, + "line": 214, "column": 56 }, "end": { - "line": 203, + "line": 214, "column": 57 } } @@ -63280,15 +65845,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 9163, - "end": 9178, + "start": 9404, + "end": 9419, "loc": { "start": { - "line": 203, + "line": 214, "column": 57 }, "end": { - "line": 203, + "line": 214, "column": 72 } } @@ -63306,15 +65871,15 @@ "binop": null, "updateContext": null }, - "start": 9178, - "end": 9179, + "start": 9419, + "end": 9420, "loc": { "start": { - "line": 203, + "line": 214, "column": 72 }, "end": { - "line": 203, + "line": 214, "column": 73 } } @@ -63332,15 +65897,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 9180, - "end": 9195, + "start": 9421, + "end": 9436, "loc": { "start": { - "line": 203, + "line": 214, "column": 74 }, "end": { - "line": 203, + "line": 214, "column": 89 } } @@ -63357,15 +65922,15 @@ "postfix": false, "binop": null }, - "start": 9195, - "end": 9196, + "start": 9436, + "end": 9437, "loc": { "start": { - "line": 203, + "line": 214, "column": 89 }, "end": { - "line": 203, + "line": 214, "column": 90 } } @@ -63383,15 +65948,15 @@ "binop": null, "updateContext": null }, - "start": 9196, - "end": 9197, + "start": 9437, + "end": 9438, "loc": { "start": { - "line": 203, + "line": 214, "column": 90 }, "end": { - "line": 203, + "line": 214, "column": 91 } } @@ -63409,15 +65974,15 @@ "binop": null }, "value": "includeTextures", - "start": 9206, - "end": 9221, + "start": 9447, + "end": 9462, "loc": { "start": { - "line": 204, + "line": 215, "column": 8 }, "end": { - "line": 204, + "line": 215, "column": 23 } } @@ -63436,15 +66001,15 @@ "updateContext": null }, "value": "=", - "start": 9222, - "end": 9223, + "start": 9463, + "end": 9464, "loc": { "start": { - "line": 204, + "line": 215, "column": 24 }, "end": { - "line": 204, + "line": 215, "column": 25 } } @@ -63462,15 +66027,15 @@ "binop": null }, "value": "overrideOption", - "start": 9224, - "end": 9238, + "start": 9465, + "end": 9479, "loc": { "start": { - "line": 204, + "line": 215, "column": 26 }, "end": { - "line": 204, + "line": 215, "column": 40 } } @@ -63487,15 +66052,15 @@ "postfix": false, "binop": null }, - "start": 9238, - "end": 9239, + "start": 9479, + "end": 9480, "loc": { "start": { - "line": 204, + "line": 215, "column": 40 }, "end": { - "line": 204, + "line": 215, "column": 41 } } @@ -63513,15 +66078,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9239, - "end": 9254, + "start": 9480, + "end": 9495, "loc": { "start": { - "line": 204, + "line": 215, "column": 41 }, "end": { - "line": 204, + "line": 215, "column": 56 } } @@ -63539,15 +66104,15 @@ "binop": null, "updateContext": null }, - "start": 9254, - "end": 9255, + "start": 9495, + "end": 9496, "loc": { "start": { - "line": 204, + "line": 215, "column": 56 }, "end": { - "line": 204, + "line": 215, "column": 57 } } @@ -63565,15 +66130,15 @@ "binop": null }, "value": "includeTextures", - "start": 9255, - "end": 9270, + "start": 9496, + "end": 9511, "loc": { "start": { - "line": 204, + "line": 215, "column": 57 }, "end": { - "line": 204, + "line": 215, "column": 72 } } @@ -63591,15 +66156,15 @@ "binop": null, "updateContext": null }, - "start": 9270, - "end": 9271, + "start": 9511, + "end": 9512, "loc": { "start": { - "line": 204, + "line": 215, "column": 72 }, "end": { - "line": 204, + "line": 215, "column": 73 } } @@ -63617,15 +66182,15 @@ "binop": null }, "value": "includeTextures", - "start": 9272, - "end": 9287, + "start": 9513, + "end": 9528, "loc": { "start": { - "line": 204, + "line": 215, "column": 74 }, "end": { - "line": 204, + "line": 215, "column": 89 } } @@ -63642,15 +66207,15 @@ "postfix": false, "binop": null }, - "start": 9287, - "end": 9288, + "start": 9528, + "end": 9529, "loc": { "start": { - "line": 204, + "line": 215, "column": 89 }, "end": { - "line": 204, + "line": 215, "column": 90 } } @@ -63668,15 +66233,15 @@ "binop": null, "updateContext": null }, - "start": 9288, - "end": 9289, + "start": 9529, + "end": 9530, "loc": { "start": { - "line": 204, + "line": 215, "column": 90 }, "end": { - "line": 204, + "line": 215, "column": 91 } } @@ -63694,15 +66259,15 @@ "binop": null }, "value": "includeNormals", - "start": 9298, - "end": 9312, + "start": 9539, + "end": 9553, "loc": { "start": { - "line": 205, + "line": 216, "column": 8 }, "end": { - "line": 205, + "line": 216, "column": 22 } } @@ -63721,15 +66286,15 @@ "updateContext": null }, "value": "=", - "start": 9313, - "end": 9314, + "start": 9554, + "end": 9555, "loc": { "start": { - "line": 205, + "line": 216, "column": 23 }, "end": { - "line": 205, + "line": 216, "column": 24 } } @@ -63747,15 +66312,15 @@ "binop": null }, "value": "overrideOption", - "start": 9315, - "end": 9329, + "start": 9556, + "end": 9570, "loc": { "start": { - "line": 205, + "line": 216, "column": 25 }, "end": { - "line": 205, + "line": 216, "column": 39 } } @@ -63772,15 +66337,15 @@ "postfix": false, "binop": null }, - "start": 9329, - "end": 9330, + "start": 9570, + "end": 9571, "loc": { "start": { - "line": 205, + "line": 216, "column": 39 }, "end": { - "line": 205, + "line": 216, "column": 40 } } @@ -63798,15 +66363,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9330, - "end": 9345, + "start": 9571, + "end": 9586, "loc": { "start": { - "line": 205, + "line": 216, "column": 40 }, "end": { - "line": 205, + "line": 216, "column": 55 } } @@ -63824,15 +66389,15 @@ "binop": null, "updateContext": null }, - "start": 9345, - "end": 9346, + "start": 9586, + "end": 9587, "loc": { "start": { - "line": 205, + "line": 216, "column": 55 }, "end": { - "line": 205, + "line": 216, "column": 56 } } @@ -63850,15 +66415,15 @@ "binop": null }, "value": "includeNormals", - "start": 9346, - "end": 9360, + "start": 9587, + "end": 9601, "loc": { "start": { - "line": 205, + "line": 216, "column": 56 }, "end": { - "line": 205, + "line": 216, "column": 70 } } @@ -63876,15 +66441,15 @@ "binop": null, "updateContext": null }, - "start": 9360, - "end": 9361, + "start": 9601, + "end": 9602, "loc": { "start": { - "line": 205, + "line": 216, "column": 70 }, "end": { - "line": 205, + "line": 216, "column": 71 } } @@ -63902,15 +66467,15 @@ "binop": null }, "value": "includeNormals", - "start": 9362, - "end": 9376, + "start": 9603, + "end": 9617, "loc": { "start": { - "line": 205, + "line": 216, "column": 72 }, "end": { - "line": 205, + "line": 216, "column": 86 } } @@ -63927,15 +66492,15 @@ "postfix": false, "binop": null }, - "start": 9376, - "end": 9377, + "start": 9617, + "end": 9618, "loc": { "start": { - "line": 205, + "line": 216, "column": 86 }, "end": { - "line": 205, + "line": 216, "column": 87 } } @@ -63953,15 +66518,15 @@ "binop": null, "updateContext": null }, - "start": 9377, - "end": 9378, + "start": 9618, + "end": 9619, "loc": { "start": { - "line": 205, + "line": 216, "column": 87 }, "end": { - "line": 205, + "line": 216, "column": 88 } } @@ -63979,15 +66544,15 @@ "binop": null }, "value": "includeTypes", - "start": 9387, - "end": 9399, + "start": 9628, + "end": 9640, "loc": { "start": { - "line": 206, + "line": 217, "column": 8 }, "end": { - "line": 206, + "line": 217, "column": 20 } } @@ -64006,15 +66571,15 @@ "updateContext": null }, "value": "=", - "start": 9400, - "end": 9401, + "start": 9641, + "end": 9642, "loc": { "start": { - "line": 206, + "line": 217, "column": 21 }, "end": { - "line": 206, + "line": 217, "column": 22 } } @@ -64032,15 +66597,15 @@ "binop": null }, "value": "overrideOption", - "start": 9402, - "end": 9416, + "start": 9643, + "end": 9657, "loc": { "start": { - "line": 206, + "line": 217, "column": 23 }, "end": { - "line": 206, + "line": 217, "column": 37 } } @@ -64057,15 +66622,15 @@ "postfix": false, "binop": null }, - "start": 9416, - "end": 9417, + "start": 9657, + "end": 9658, "loc": { "start": { - "line": 206, + "line": 217, "column": 37 }, "end": { - "line": 206, + "line": 217, "column": 38 } } @@ -64083,15 +66648,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9417, - "end": 9432, + "start": 9658, + "end": 9673, "loc": { "start": { - "line": 206, + "line": 217, "column": 38 }, "end": { - "line": 206, + "line": 217, "column": 53 } } @@ -64109,15 +66674,15 @@ "binop": null, "updateContext": null }, - "start": 9432, - "end": 9433, + "start": 9673, + "end": 9674, "loc": { "start": { - "line": 206, + "line": 217, "column": 53 }, "end": { - "line": 206, + "line": 217, "column": 54 } } @@ -64135,15 +66700,15 @@ "binop": null }, "value": "includeTypes", - "start": 9433, - "end": 9445, + "start": 9674, + "end": 9686, "loc": { "start": { - "line": 206, + "line": 217, "column": 54 }, "end": { - "line": 206, + "line": 217, "column": 66 } } @@ -64161,15 +66726,15 @@ "binop": null, "updateContext": null }, - "start": 9445, - "end": 9446, + "start": 9686, + "end": 9687, "loc": { "start": { - "line": 206, + "line": 217, "column": 66 }, "end": { - "line": 206, + "line": 217, "column": 67 } } @@ -64187,15 +66752,15 @@ "binop": null }, "value": "includeTypes", - "start": 9447, - "end": 9459, + "start": 9688, + "end": 9700, "loc": { "start": { - "line": 206, + "line": 217, "column": 68 }, "end": { - "line": 206, + "line": 217, "column": 80 } } @@ -64212,15 +66777,15 @@ "postfix": false, "binop": null }, - "start": 9459, - "end": 9460, + "start": 9700, + "end": 9701, "loc": { "start": { - "line": 206, + "line": 217, "column": 80 }, "end": { - "line": 206, + "line": 217, "column": 81 } } @@ -64238,15 +66803,15 @@ "binop": null, "updateContext": null }, - "start": 9460, - "end": 9461, + "start": 9701, + "end": 9702, "loc": { "start": { - "line": 206, + "line": 217, "column": 81 }, "end": { - "line": 206, + "line": 217, "column": 82 } } @@ -64264,15 +66829,15 @@ "binop": null }, "value": "excludeTypes", - "start": 9470, - "end": 9482, + "start": 9711, + "end": 9723, "loc": { "start": { - "line": 207, + "line": 218, "column": 8 }, "end": { - "line": 207, + "line": 218, "column": 20 } } @@ -64291,15 +66856,15 @@ "updateContext": null }, "value": "=", - "start": 9483, - "end": 9484, + "start": 9724, + "end": 9725, "loc": { "start": { - "line": 207, + "line": 218, "column": 21 }, "end": { - "line": 207, + "line": 218, "column": 22 } } @@ -64317,15 +66882,15 @@ "binop": null }, "value": "overrideOption", - "start": 9485, - "end": 9499, + "start": 9726, + "end": 9740, "loc": { "start": { - "line": 207, + "line": 218, "column": 23 }, "end": { - "line": 207, + "line": 218, "column": 37 } } @@ -64342,15 +66907,15 @@ "postfix": false, "binop": null }, - "start": 9499, - "end": 9500, + "start": 9740, + "end": 9741, "loc": { "start": { - "line": 207, + "line": 218, "column": 37 }, "end": { - "line": 207, + "line": 218, "column": 38 } } @@ -64368,15 +66933,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 9500, - "end": 9515, + "start": 9741, + "end": 9756, "loc": { "start": { - "line": 207, + "line": 218, "column": 38 }, "end": { - "line": 207, + "line": 218, "column": 53 } } @@ -64394,15 +66959,15 @@ "binop": null, "updateContext": null }, - "start": 9515, - "end": 9516, + "start": 9756, + "end": 9757, "loc": { "start": { - "line": 207, + "line": 218, "column": 53 }, "end": { - "line": 207, + "line": 218, "column": 54 } } @@ -64420,15 +66985,15 @@ "binop": null }, "value": "excludeTypes", - "start": 9516, - "end": 9528, + "start": 9757, + "end": 9769, "loc": { "start": { - "line": 207, + "line": 218, "column": 54 }, "end": { - "line": 207, + "line": 218, "column": 66 } } @@ -64446,15 +67011,15 @@ "binop": null, "updateContext": null }, - "start": 9528, - "end": 9529, + "start": 9769, + "end": 9770, "loc": { "start": { - "line": 207, + "line": 218, "column": 66 }, "end": { - "line": 207, + "line": 218, "column": 67 } } @@ -64472,15 +67037,15 @@ "binop": null }, "value": "excludeTypes", - "start": 9530, - "end": 9542, + "start": 9771, + "end": 9783, "loc": { "start": { - "line": 207, + "line": 218, "column": 68 }, "end": { - "line": 207, + "line": 218, "column": 80 } } @@ -64497,15 +67062,15 @@ "postfix": false, "binop": null }, - "start": 9542, - "end": 9543, + "start": 9783, + "end": 9784, "loc": { "start": { - "line": 207, + "line": 218, "column": 80 }, "end": { - "line": 207, + "line": 218, "column": 81 } } @@ -64523,15 +67088,15 @@ "binop": null, "updateContext": null }, - "start": 9543, - "end": 9544, + "start": 9784, + "end": 9785, "loc": { "start": { - "line": 207, + "line": 218, "column": 81 }, "end": { - "line": 207, + "line": 218, "column": 82 } } @@ -64551,15 +67116,15 @@ "updateContext": null }, "value": "if", - "start": 9554, - "end": 9556, + "start": 9795, + "end": 9797, "loc": { "start": { - "line": 209, + "line": 220, "column": 8 }, "end": { - "line": 209, + "line": 220, "column": 10 } } @@ -64576,15 +67141,15 @@ "postfix": false, "binop": null }, - "start": 9557, - "end": 9558, + "start": 9798, + "end": 9799, "loc": { "start": { - "line": 209, + "line": 220, "column": 11 }, "end": { - "line": 209, + "line": 220, "column": 12 } } @@ -64602,15 +67167,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 9558, - "end": 9573, + "start": 9799, + "end": 9814, "loc": { "start": { - "line": 209, + "line": 220, "column": 12 }, "end": { - "line": 209, + "line": 220, "column": 27 } } @@ -64629,15 +67194,15 @@ "updateContext": null }, "value": "===", - "start": 9574, - "end": 9577, + "start": 9815, + "end": 9818, "loc": { "start": { - "line": 209, + "line": 220, "column": 28 }, "end": { - "line": 209, + "line": 220, "column": 31 } } @@ -64657,15 +67222,15 @@ "updateContext": null }, "value": "false", - "start": 9578, - "end": 9583, + "start": 9819, + "end": 9824, "loc": { "start": { - "line": 209, + "line": 220, "column": 32 }, "end": { - "line": 209, + "line": 220, "column": 37 } } @@ -64682,15 +67247,15 @@ "postfix": false, "binop": null }, - "start": 9583, - "end": 9584, + "start": 9824, + "end": 9825, "loc": { "start": { - "line": 209, + "line": 220, "column": 37 }, "end": { - "line": 209, + "line": 220, "column": 38 } } @@ -64707,15 +67272,15 @@ "postfix": false, "binop": null }, - "start": 9585, - "end": 9586, + "start": 9826, + "end": 9827, "loc": { "start": { - "line": 209, + "line": 220, "column": 39 }, "end": { - "line": 209, + "line": 220, "column": 40 } } @@ -64733,15 +67298,15 @@ "binop": null }, "value": "log", - "start": 9599, - "end": 9602, + "start": 9840, + "end": 9843, "loc": { "start": { - "line": 210, + "line": 221, "column": 12 }, "end": { - "line": 210, + "line": 221, "column": 15 } } @@ -64758,15 +67323,15 @@ "postfix": false, "binop": null }, - "start": 9602, - "end": 9603, + "start": 9843, + "end": 9844, "loc": { "start": { - "line": 210, + "line": 221, "column": 15 }, "end": { - "line": 210, + "line": 221, "column": 16 } } @@ -64785,15 +67350,15 @@ "updateContext": null }, "value": "Geometry reuse is disabled", - "start": 9603, - "end": 9631, + "start": 9844, + "end": 9872, "loc": { "start": { - "line": 210, + "line": 221, "column": 16 }, "end": { - "line": 210, + "line": 221, "column": 44 } } @@ -64810,15 +67375,15 @@ "postfix": false, "binop": null }, - "start": 9631, - "end": 9632, + "start": 9872, + "end": 9873, "loc": { "start": { - "line": 210, + "line": 221, "column": 44 }, "end": { - "line": 210, + "line": 221, "column": 45 } } @@ -64836,15 +67401,15 @@ "binop": null, "updateContext": null }, - "start": 9632, - "end": 9633, + "start": 9873, + "end": 9874, "loc": { "start": { - "line": 210, + "line": 221, "column": 45 }, "end": { - "line": 210, + "line": 221, "column": 46 } } @@ -64861,15 +67426,15 @@ "postfix": false, "binop": null }, - "start": 9642, - "end": 9643, + "start": 9883, + "end": 9884, "loc": { "start": { - "line": 211, + "line": 222, "column": 8 }, "end": { - "line": 211, + "line": 222, "column": 9 } } @@ -64889,15 +67454,15 @@ "updateContext": null }, "value": "const", - "start": 9653, - "end": 9658, + "start": 9894, + "end": 9899, "loc": { "start": { - "line": 213, + "line": 224, "column": 8 }, "end": { - "line": 213, + "line": 224, "column": 13 } } @@ -64915,15 +67480,15 @@ "binop": null }, "value": "xktModel", - "start": 9659, - "end": 9667, + "start": 9900, + "end": 9908, "loc": { "start": { - "line": 213, + "line": 224, "column": 14 }, "end": { - "line": 213, + "line": 224, "column": 22 } } @@ -64942,15 +67507,15 @@ "updateContext": null }, "value": "=", - "start": 9668, - "end": 9669, + "start": 9909, + "end": 9910, "loc": { "start": { - "line": 213, + "line": 224, "column": 23 }, "end": { - "line": 213, + "line": 224, "column": 24 } } @@ -64970,15 +67535,15 @@ "updateContext": null }, "value": "new", - "start": 9670, - "end": 9673, + "start": 9911, + "end": 9914, "loc": { "start": { - "line": 213, + "line": 224, "column": 25 }, "end": { - "line": 213, + "line": 224, "column": 28 } } @@ -64996,15 +67561,15 @@ "binop": null }, "value": "XKTModel", - "start": 9674, - "end": 9682, + "start": 9915, + "end": 9923, "loc": { "start": { - "line": 213, + "line": 224, "column": 29 }, "end": { - "line": 213, + "line": 224, "column": 37 } } @@ -65021,15 +67586,15 @@ "postfix": false, "binop": null }, - "start": 9682, - "end": 9683, + "start": 9923, + "end": 9924, "loc": { "start": { - "line": 213, + "line": 224, "column": 37 }, "end": { - "line": 213, + "line": 224, "column": 38 } } @@ -65046,15 +67611,15 @@ "postfix": false, "binop": null }, - "start": 9683, - "end": 9684, + "start": 9924, + "end": 9925, "loc": { "start": { - "line": 213, + "line": 224, "column": 38 }, "end": { - "line": 213, + "line": 224, "column": 39 } } @@ -65072,15 +67637,15 @@ "binop": null }, "value": "minTileSize", - "start": 9697, - "end": 9708, + "start": 9938, + "end": 9949, "loc": { "start": { - "line": 214, + "line": 225, "column": 12 }, "end": { - "line": 214, + "line": 225, "column": 23 } } @@ -65098,15 +67663,15 @@ "binop": null, "updateContext": null }, - "start": 9708, - "end": 9709, + "start": 9949, + "end": 9950, "loc": { "start": { - "line": 214, + "line": 225, "column": 23 }, "end": { - "line": 214, + "line": 225, "column": 24 } } @@ -65124,15 +67689,15 @@ "binop": null }, "value": "modelAABB", - "start": 9722, - "end": 9731, + "start": 9963, + "end": 9972, "loc": { "start": { - "line": 215, + "line": 226, "column": 12 }, "end": { - "line": 215, + "line": 226, "column": 21 } } @@ -65149,15 +67714,15 @@ "postfix": false, "binop": null }, - "start": 9740, - "end": 9741, + "start": 9981, + "end": 9982, "loc": { "start": { - "line": 216, + "line": 227, "column": 8 }, "end": { - "line": 216, + "line": 227, "column": 9 } } @@ -65174,15 +67739,15 @@ "postfix": false, "binop": null }, - "start": 9741, - "end": 9742, + "start": 9982, + "end": 9983, "loc": { "start": { - "line": 216, + "line": 227, "column": 9 }, "end": { - "line": 216, + "line": 227, "column": 10 } } @@ -65200,15 +67765,15 @@ "binop": null, "updateContext": null }, - "start": 9742, - "end": 9743, + "start": 9983, + "end": 9984, "loc": { "start": { - "line": 216, + "line": 227, "column": 10 }, "end": { - "line": 216, + "line": 227, "column": 11 } } @@ -65228,15 +67793,15 @@ "updateContext": null }, "value": "switch", - "start": 9753, - "end": 9759, + "start": 9994, + "end": 10000, "loc": { "start": { - "line": 218, + "line": 229, "column": 8 }, "end": { - "line": 218, + "line": 229, "column": 14 } } @@ -65253,15 +67818,15 @@ "postfix": false, "binop": null }, - "start": 9760, - "end": 9761, + "start": 10001, + "end": 10002, "loc": { "start": { - "line": 218, + "line": 229, "column": 15 }, "end": { - "line": 218, + "line": 229, "column": 16 } } @@ -65279,15 +67844,15 @@ "binop": null }, "value": "ext", - "start": 9761, - "end": 9764, + "start": 10002, + "end": 10005, "loc": { "start": { - "line": 218, + "line": 229, "column": 16 }, "end": { - "line": 218, + "line": 229, "column": 19 } } @@ -65304,15 +67869,15 @@ "postfix": false, "binop": null }, - "start": 9764, - "end": 9765, + "start": 10005, + "end": 10006, "loc": { "start": { - "line": 218, + "line": 229, "column": 19 }, "end": { - "line": 218, + "line": 229, "column": 20 } } @@ -65329,15 +67894,15 @@ "postfix": false, "binop": null }, - "start": 9766, - "end": 9767, + "start": 10007, + "end": 10008, "loc": { "start": { - "line": 218, + "line": 229, "column": 21 }, "end": { - "line": 218, + "line": 229, "column": 22 } } @@ -65357,15 +67922,15 @@ "updateContext": null }, "value": "case", - "start": 9780, - "end": 9784, + "start": 10021, + "end": 10025, "loc": { "start": { - "line": 219, + "line": 230, "column": 12 }, "end": { - "line": 219, + "line": 230, "column": 16 } } @@ -65384,15 +67949,15 @@ "updateContext": null }, "value": "json", - "start": 9785, - "end": 9791, + "start": 10026, + "end": 10032, "loc": { "start": { - "line": 219, + "line": 230, "column": 17 }, "end": { - "line": 219, + "line": 230, "column": 23 } } @@ -65410,15 +67975,15 @@ "binop": null, "updateContext": null }, - "start": 9791, - "end": 9792, + "start": 10032, + "end": 10033, "loc": { "start": { - "line": 219, + "line": 230, "column": 23 }, "end": { - "line": 219, + "line": 230, "column": 24 } } @@ -65436,15 +68001,15 @@ "binop": null }, "value": "convert", - "start": 9809, - "end": 9816, + "start": 10050, + "end": 10057, "loc": { "start": { - "line": 220, + "line": 231, "column": 16 }, "end": { - "line": 220, + "line": 231, "column": 23 } } @@ -65461,15 +68026,15 @@ "postfix": false, "binop": null }, - "start": 9816, - "end": 9817, + "start": 10057, + "end": 10058, "loc": { "start": { - "line": 220, + "line": 231, "column": 23 }, "end": { - "line": 220, + "line": 231, "column": 24 } } @@ -65487,15 +68052,15 @@ "binop": null }, "value": "parseCityJSONIntoXKTModel", - "start": 9817, - "end": 9842, + "start": 10058, + "end": 10083, "loc": { "start": { - "line": 220, + "line": 231, "column": 24 }, "end": { - "line": 220, + "line": 231, "column": 49 } } @@ -65513,15 +68078,15 @@ "binop": null, "updateContext": null }, - "start": 9842, - "end": 9843, + "start": 10083, + "end": 10084, "loc": { "start": { - "line": 220, + "line": 231, "column": 49 }, "end": { - "line": 220, + "line": 231, "column": 50 } } @@ -65538,15 +68103,15 @@ "postfix": false, "binop": null }, - "start": 9844, - "end": 9845, + "start": 10085, + "end": 10086, "loc": { "start": { - "line": 220, + "line": 231, "column": 51 }, "end": { - "line": 220, + "line": 231, "column": 52 } } @@ -65564,15 +68129,15 @@ "binop": null }, "value": "data", - "start": 9866, - "end": 9870, + "start": 10107, + "end": 10111, "loc": { "start": { - "line": 221, + "line": 232, "column": 20 }, "end": { - "line": 221, + "line": 232, "column": 24 } } @@ -65590,15 +68155,15 @@ "binop": null, "updateContext": null }, - "start": 9870, - "end": 9871, + "start": 10111, + "end": 10112, "loc": { "start": { - "line": 221, + "line": 232, "column": 24 }, "end": { - "line": 221, + "line": 232, "column": 25 } } @@ -65616,15 +68181,15 @@ "binop": null }, "value": "JSON", - "start": 9872, - "end": 9876, + "start": 10113, + "end": 10117, "loc": { "start": { - "line": 221, + "line": 232, "column": 26 }, "end": { - "line": 221, + "line": 232, "column": 30 } } @@ -65642,15 +68207,15 @@ "binop": null, "updateContext": null }, - "start": 9876, - "end": 9877, + "start": 10117, + "end": 10118, "loc": { "start": { - "line": 221, + "line": 232, "column": 30 }, "end": { - "line": 221, + "line": 232, "column": 31 } } @@ -65668,15 +68233,15 @@ "binop": null }, "value": "parse", - "start": 9877, - "end": 9882, + "start": 10118, + "end": 10123, "loc": { "start": { - "line": 221, + "line": 232, "column": 31 }, "end": { - "line": 221, + "line": 232, "column": 36 } } @@ -65693,15 +68258,15 @@ "postfix": false, "binop": null }, - "start": 9882, - "end": 9883, + "start": 10123, + "end": 10124, "loc": { "start": { - "line": 221, + "line": 232, "column": 36 }, "end": { - "line": 221, + "line": 232, "column": 37 } } @@ -65719,15 +68284,15 @@ "binop": null }, "value": "sourceData", - "start": 9883, - "end": 9893, + "start": 10124, + "end": 10134, "loc": { "start": { - "line": 221, + "line": 232, "column": 37 }, "end": { - "line": 221, + "line": 232, "column": 47 } } @@ -65744,15 +68309,15 @@ "postfix": false, "binop": null }, - "start": 9893, - "end": 9894, + "start": 10134, + "end": 10135, "loc": { "start": { - "line": 221, + "line": 232, "column": 47 }, "end": { - "line": 221, + "line": 232, "column": 48 } } @@ -65770,15 +68335,15 @@ "binop": null, "updateContext": null }, - "start": 9894, - "end": 9895, + "start": 10135, + "end": 10136, "loc": { "start": { - "line": 221, + "line": 232, "column": 48 }, "end": { - "line": 221, + "line": 232, "column": 49 } } @@ -65796,15 +68361,15 @@ "binop": null }, "value": "xktModel", - "start": 9916, - "end": 9924, + "start": 10157, + "end": 10165, "loc": { "start": { - "line": 222, + "line": 233, "column": 20 }, "end": { - "line": 222, + "line": 233, "column": 28 } } @@ -65822,15 +68387,15 @@ "binop": null, "updateContext": null }, - "start": 9924, - "end": 9925, + "start": 10165, + "end": 10166, "loc": { "start": { - "line": 222, + "line": 233, "column": 28 }, "end": { - "line": 222, + "line": 233, "column": 29 } } @@ -65848,15 +68413,15 @@ "binop": null }, "value": "stats", - "start": 9946, - "end": 9951, + "start": 10187, + "end": 10192, "loc": { "start": { - "line": 223, + "line": 234, "column": 20 }, "end": { - "line": 223, + "line": 234, "column": 25 } } @@ -65874,15 +68439,15 @@ "binop": null, "updateContext": null }, - "start": 9951, - "end": 9952, + "start": 10192, + "end": 10193, "loc": { "start": { - "line": 223, + "line": 234, "column": 25 }, "end": { - "line": 223, + "line": 234, "column": 26 } } @@ -65900,15 +68465,15 @@ "binop": null }, "value": "rotateX", - "start": 9973, - "end": 9980, + "start": 10214, + "end": 10221, "loc": { "start": { - "line": 224, + "line": 235, "column": 20 }, "end": { - "line": 224, + "line": 235, "column": 27 } } @@ -65926,15 +68491,15 @@ "binop": null, "updateContext": null }, - "start": 9980, - "end": 9981, + "start": 10221, + "end": 10222, "loc": { "start": { - "line": 224, + "line": 235, "column": 27 }, "end": { - "line": 224, + "line": 235, "column": 28 } } @@ -65952,15 +68517,15 @@ "binop": null }, "value": "center", - "start": 10002, - "end": 10008, + "start": 10243, + "end": 10249, "loc": { "start": { - "line": 225, + "line": 236, "column": 20 }, "end": { - "line": 225, + "line": 236, "column": 26 } } @@ -65978,15 +68543,15 @@ "binop": null, "updateContext": null }, - "start": 10008, - "end": 10009, + "start": 10249, + "end": 10250, "loc": { "start": { - "line": 225, + "line": 236, "column": 26 }, "end": { - "line": 225, + "line": 236, "column": 27 } } @@ -66004,15 +68569,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 10010, - "end": 10025, + "start": 10251, + "end": 10266, "loc": { "start": { - "line": 225, + "line": 236, "column": 28 }, "end": { - "line": 225, + "line": 236, "column": 43 } } @@ -66030,15 +68595,15 @@ "binop": null, "updateContext": null }, - "start": 10025, - "end": 10026, + "start": 10266, + "end": 10267, "loc": { "start": { - "line": 225, + "line": 236, "column": 43 }, "end": { - "line": 225, + "line": 236, "column": 44 } } @@ -66056,15 +68621,15 @@ "binop": null }, "value": "center", - "start": 10026, - "end": 10032, + "start": 10267, + "end": 10273, "loc": { "start": { - "line": 225, + "line": 236, "column": 44 }, "end": { - "line": 225, + "line": 236, "column": 50 } } @@ -66082,15 +68647,15 @@ "binop": null, "updateContext": null }, - "start": 10032, - "end": 10033, + "start": 10273, + "end": 10274, "loc": { "start": { - "line": 225, + "line": 236, "column": 50 }, "end": { - "line": 225, + "line": 236, "column": 51 } } @@ -66108,15 +68673,15 @@ "binop": null }, "value": "transform", - "start": 10054, - "end": 10063, + "start": 10295, + "end": 10304, "loc": { "start": { - "line": 226, + "line": 237, "column": 20 }, "end": { - "line": 226, + "line": 237, "column": 29 } } @@ -66134,15 +68699,15 @@ "binop": null, "updateContext": null }, - "start": 10063, - "end": 10064, + "start": 10304, + "end": 10305, "loc": { "start": { - "line": 226, + "line": 237, "column": 29 }, "end": { - "line": 226, + "line": 237, "column": 30 } } @@ -66160,15 +68725,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 10065, - "end": 10080, + "start": 10306, + "end": 10321, "loc": { "start": { - "line": 226, + "line": 237, "column": 31 }, "end": { - "line": 226, + "line": 237, "column": 46 } } @@ -66186,15 +68751,15 @@ "binop": null, "updateContext": null }, - "start": 10080, - "end": 10081, + "start": 10321, + "end": 10322, "loc": { "start": { - "line": 226, + "line": 237, "column": 46 }, "end": { - "line": 226, + "line": 237, "column": 47 } } @@ -66212,15 +68777,15 @@ "binop": null }, "value": "transform", - "start": 10081, - "end": 10090, + "start": 10322, + "end": 10331, "loc": { "start": { - "line": 226, + "line": 237, "column": 47 }, "end": { - "line": 226, + "line": 237, "column": 56 } } @@ -66238,15 +68803,15 @@ "binop": null, "updateContext": null }, - "start": 10090, - "end": 10091, + "start": 10331, + "end": 10332, "loc": { "start": { - "line": 226, + "line": 237, "column": 56 }, "end": { - "line": 226, + "line": 237, "column": 57 } } @@ -66264,15 +68829,15 @@ "binop": null }, "value": "log", - "start": 10112, - "end": 10115, + "start": 10353, + "end": 10356, "loc": { "start": { - "line": 227, + "line": 238, "column": 20 }, "end": { - "line": 227, + "line": 238, "column": 23 } } @@ -66289,15 +68854,15 @@ "postfix": false, "binop": null }, - "start": 10132, - "end": 10133, + "start": 10373, + "end": 10374, "loc": { "start": { - "line": 228, + "line": 239, "column": 16 }, "end": { - "line": 228, + "line": 239, "column": 17 } } @@ -66314,15 +68879,15 @@ "postfix": false, "binop": null }, - "start": 10133, - "end": 10134, + "start": 10374, + "end": 10375, "loc": { "start": { - "line": 228, + "line": 239, "column": 17 }, "end": { - "line": 228, + "line": 239, "column": 18 } } @@ -66340,15 +68905,15 @@ "binop": null, "updateContext": null }, - "start": 10134, - "end": 10135, + "start": 10375, + "end": 10376, "loc": { "start": { - "line": 228, + "line": 239, "column": 18 }, "end": { - "line": 228, + "line": 239, "column": 19 } } @@ -66368,15 +68933,15 @@ "updateContext": null }, "value": "break", - "start": 10152, - "end": 10157, + "start": 10393, + "end": 10398, "loc": { "start": { - "line": 229, + "line": 240, "column": 16 }, "end": { - "line": 229, + "line": 240, "column": 21 } } @@ -66394,15 +68959,15 @@ "binop": null, "updateContext": null }, - "start": 10157, - "end": 10158, + "start": 10398, + "end": 10399, "loc": { "start": { - "line": 229, + "line": 240, "column": 21 }, "end": { - "line": 229, + "line": 240, "column": 22 } } @@ -66422,15 +68987,15 @@ "updateContext": null }, "value": "case", - "start": 10172, - "end": 10176, + "start": 10413, + "end": 10417, "loc": { "start": { - "line": 231, + "line": 242, "column": 12 }, "end": { - "line": 231, + "line": 242, "column": 16 } } @@ -66449,15 +69014,15 @@ "updateContext": null }, "value": "glb", - "start": 10177, - "end": 10182, + "start": 10418, + "end": 10423, "loc": { "start": { - "line": 231, + "line": 242, "column": 17 }, "end": { - "line": 231, + "line": 242, "column": 22 } } @@ -66475,15 +69040,15 @@ "binop": null, "updateContext": null }, - "start": 10182, - "end": 10183, + "start": 10423, + "end": 10424, "loc": { "start": { - "line": 231, + "line": 242, "column": 22 }, "end": { - "line": 231, + "line": 242, "column": 23 } } @@ -66501,15 +69066,15 @@ "binop": null }, "value": "sourceData", - "start": 10200, - "end": 10210, + "start": 10441, + "end": 10451, "loc": { "start": { - "line": 232, + "line": 243, "column": 16 }, "end": { - "line": 232, + "line": 243, "column": 26 } } @@ -66528,15 +69093,15 @@ "updateContext": null }, "value": "=", - "start": 10211, - "end": 10212, + "start": 10452, + "end": 10453, "loc": { "start": { - "line": 232, + "line": 243, "column": 27 }, "end": { - "line": 232, + "line": 243, "column": 28 } } @@ -66554,15 +69119,15 @@ "binop": null }, "value": "toArrayBuffer", - "start": 10213, - "end": 10226, + "start": 10454, + "end": 10467, "loc": { "start": { - "line": 232, + "line": 243, "column": 29 }, "end": { - "line": 232, + "line": 243, "column": 42 } } @@ -66579,15 +69144,15 @@ "postfix": false, "binop": null }, - "start": 10226, - "end": 10227, + "start": 10467, + "end": 10468, "loc": { "start": { - "line": 232, + "line": 243, "column": 42 }, "end": { - "line": 232, + "line": 243, "column": 43 } } @@ -66605,15 +69170,15 @@ "binop": null }, "value": "sourceData", - "start": 10227, - "end": 10237, + "start": 10468, + "end": 10478, "loc": { "start": { - "line": 232, + "line": 243, "column": 43 }, "end": { - "line": 232, + "line": 243, "column": 53 } } @@ -66630,15 +69195,15 @@ "postfix": false, "binop": null }, - "start": 10237, - "end": 10238, + "start": 10478, + "end": 10479, "loc": { "start": { - "line": 232, + "line": 243, "column": 53 }, "end": { - "line": 232, + "line": 243, "column": 54 } } @@ -66656,15 +69221,15 @@ "binop": null, "updateContext": null }, - "start": 10238, - "end": 10239, + "start": 10479, + "end": 10480, "loc": { "start": { - "line": 232, + "line": 243, "column": 54 }, "end": { - "line": 232, + "line": 243, "column": 55 } } @@ -66682,15 +69247,15 @@ "binop": null }, "value": "convert", - "start": 10256, - "end": 10263, + "start": 10497, + "end": 10504, "loc": { "start": { - "line": 233, + "line": 244, "column": 16 }, "end": { - "line": 233, + "line": 244, "column": 23 } } @@ -66707,15 +69272,15 @@ "postfix": false, "binop": null }, - "start": 10263, - "end": 10264, + "start": 10504, + "end": 10505, "loc": { "start": { - "line": 233, + "line": 244, "column": 23 }, "end": { - "line": 233, + "line": 244, "column": 24 } } @@ -66733,15 +69298,15 @@ "binop": null }, "value": "parseGLTFIntoXKTModel", - "start": 10264, - "end": 10285, + "start": 10505, + "end": 10526, "loc": { "start": { - "line": 233, + "line": 244, "column": 24 }, "end": { - "line": 233, + "line": 244, "column": 45 } } @@ -66759,15 +69324,15 @@ "binop": null, "updateContext": null }, - "start": 10285, - "end": 10286, + "start": 10526, + "end": 10527, "loc": { "start": { - "line": 233, + "line": 244, "column": 45 }, "end": { - "line": 233, + "line": 244, "column": 46 } } @@ -66784,15 +69349,15 @@ "postfix": false, "binop": null }, - "start": 10287, - "end": 10288, + "start": 10528, + "end": 10529, "loc": { "start": { - "line": 233, + "line": 244, "column": 47 }, "end": { - "line": 233, + "line": 244, "column": 48 } } @@ -66810,15 +69375,15 @@ "binop": null }, "value": "data", - "start": 10309, - "end": 10313, + "start": 10550, + "end": 10554, "loc": { "start": { - "line": 234, + "line": 245, "column": 20 }, "end": { - "line": 234, + "line": 245, "column": 24 } } @@ -66836,15 +69401,15 @@ "binop": null, "updateContext": null }, - "start": 10313, - "end": 10314, + "start": 10554, + "end": 10555, "loc": { "start": { - "line": 234, + "line": 245, "column": 24 }, "end": { - "line": 234, + "line": 245, "column": 25 } } @@ -66862,15 +69427,15 @@ "binop": null }, "value": "sourceData", - "start": 10315, - "end": 10325, + "start": 10556, + "end": 10566, "loc": { "start": { - "line": 234, + "line": 245, "column": 26 }, "end": { - "line": 234, + "line": 245, "column": 36 } } @@ -66888,15 +69453,15 @@ "binop": null, "updateContext": null }, - "start": 10325, - "end": 10326, + "start": 10566, + "end": 10567, "loc": { "start": { - "line": 234, + "line": 245, "column": 36 }, "end": { - "line": 234, + "line": 245, "column": 37 } } @@ -66914,15 +69479,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 10347, - "end": 10362, + "start": 10588, + "end": 10603, "loc": { "start": { - "line": 235, + "line": 246, "column": 20 }, "end": { - "line": 235, + "line": 246, "column": 35 } } @@ -66940,15 +69505,15 @@ "binop": null, "updateContext": null }, - "start": 10362, - "end": 10363, + "start": 10603, + "end": 10604, "loc": { "start": { - "line": 235, + "line": 246, "column": 35 }, "end": { - "line": 235, + "line": 246, "column": 36 } } @@ -66966,15 +69531,15 @@ "binop": null }, "value": "includeTextures", - "start": 10384, - "end": 10399, + "start": 10625, + "end": 10640, "loc": { "start": { - "line": 236, + "line": 247, "column": 20 }, "end": { - "line": 236, + "line": 247, "column": 35 } } @@ -66992,15 +69557,15 @@ "binop": null, "updateContext": null }, - "start": 10399, - "end": 10400, + "start": 10640, + "end": 10641, "loc": { "start": { - "line": 236, + "line": 247, "column": 35 }, "end": { - "line": 236, + "line": 247, "column": 36 } } @@ -67020,15 +69585,15 @@ "updateContext": null }, "value": "true", - "start": 10401, - "end": 10405, + "start": 10642, + "end": 10646, "loc": { "start": { - "line": 236, + "line": 247, "column": 37 }, "end": { - "line": 236, + "line": 247, "column": 41 } } @@ -67046,15 +69611,15 @@ "binop": null, "updateContext": null }, - "start": 10405, - "end": 10406, + "start": 10646, + "end": 10647, "loc": { "start": { - "line": 236, + "line": 247, "column": 41 }, "end": { - "line": 236, + "line": 247, "column": 42 } } @@ -67072,15 +69637,15 @@ "binop": null }, "value": "includeNormals", - "start": 10427, - "end": 10441, + "start": 10668, + "end": 10682, "loc": { "start": { - "line": 237, + "line": 248, "column": 20 }, "end": { - "line": 237, + "line": 248, "column": 34 } } @@ -67098,15 +69663,15 @@ "binop": null, "updateContext": null }, - "start": 10441, - "end": 10442, + "start": 10682, + "end": 10683, "loc": { "start": { - "line": 237, + "line": 248, "column": 34 }, "end": { - "line": 237, + "line": 248, "column": 35 } } @@ -67124,15 +69689,15 @@ "binop": null }, "value": "metaModelData", - "start": 10463, - "end": 10476, + "start": 10704, + "end": 10717, "loc": { "start": { - "line": 238, + "line": 249, "column": 20 }, "end": { - "line": 238, + "line": 249, "column": 33 } } @@ -67150,15 +69715,15 @@ "binop": null, "updateContext": null }, - "start": 10476, - "end": 10477, + "start": 10717, + "end": 10718, "loc": { "start": { - "line": 238, + "line": 249, "column": 33 }, "end": { - "line": 238, + "line": 249, "column": 34 } } @@ -67176,15 +69741,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 10478, - "end": 10491, + "start": 10719, + "end": 10732, "loc": { "start": { - "line": 238, + "line": 249, "column": 35 }, "end": { - "line": 238, + "line": 249, "column": 48 } } @@ -67202,15 +69767,15 @@ "binop": null, "updateContext": null }, - "start": 10491, - "end": 10492, + "start": 10732, + "end": 10733, "loc": { "start": { - "line": 238, + "line": 249, "column": 48 }, "end": { - "line": 238, + "line": 249, "column": 49 } } @@ -67228,15 +69793,15 @@ "binop": null }, "value": "xktModel", - "start": 10513, - "end": 10521, + "start": 10754, + "end": 10762, "loc": { "start": { - "line": 239, + "line": 250, "column": 20 }, "end": { - "line": 239, + "line": 250, "column": 28 } } @@ -67254,15 +69819,15 @@ "binop": null, "updateContext": null }, - "start": 10521, - "end": 10522, + "start": 10762, + "end": 10763, "loc": { "start": { - "line": 239, + "line": 250, "column": 28 }, "end": { - "line": 239, + "line": 250, "column": 29 } } @@ -67280,15 +69845,15 @@ "binop": null }, "value": "stats", - "start": 10543, - "end": 10548, + "start": 10784, + "end": 10789, "loc": { "start": { - "line": 240, + "line": 251, "column": 20 }, "end": { - "line": 240, + "line": 251, "column": 25 } } @@ -67306,15 +69871,15 @@ "binop": null, "updateContext": null }, - "start": 10548, - "end": 10549, + "start": 10789, + "end": 10790, "loc": { "start": { - "line": 240, + "line": 251, "column": 25 }, "end": { - "line": 240, + "line": 251, "column": 26 } } @@ -67332,15 +69897,15 @@ "binop": null }, "value": "log", - "start": 10570, - "end": 10573, + "start": 10811, + "end": 10814, "loc": { "start": { - "line": 241, + "line": 252, "column": 20 }, "end": { - "line": 241, + "line": 252, "column": 23 } } @@ -67357,15 +69922,15 @@ "postfix": false, "binop": null }, - "start": 10590, - "end": 10591, + "start": 10831, + "end": 10832, "loc": { "start": { - "line": 242, + "line": 253, "column": 16 }, "end": { - "line": 242, + "line": 253, "column": 17 } } @@ -67382,15 +69947,15 @@ "postfix": false, "binop": null }, - "start": 10591, - "end": 10592, + "start": 10832, + "end": 10833, "loc": { "start": { - "line": 242, + "line": 253, "column": 17 }, "end": { - "line": 242, + "line": 253, "column": 18 } } @@ -67408,15 +69973,15 @@ "binop": null, "updateContext": null }, - "start": 10592, - "end": 10593, + "start": 10833, + "end": 10834, "loc": { "start": { - "line": 242, + "line": 253, "column": 18 }, "end": { - "line": 242, + "line": 253, "column": 19 } } @@ -67436,15 +70001,15 @@ "updateContext": null }, "value": "break", - "start": 10610, - "end": 10615, + "start": 10851, + "end": 10856, "loc": { "start": { - "line": 243, + "line": 254, "column": 16 }, "end": { - "line": 243, + "line": 254, "column": 21 } } @@ -67462,15 +70027,15 @@ "binop": null, "updateContext": null }, - "start": 10615, - "end": 10616, + "start": 10856, + "end": 10857, "loc": { "start": { - "line": 243, + "line": 254, "column": 21 }, "end": { - "line": 243, + "line": 254, "column": 22 } } @@ -67490,15 +70055,15 @@ "updateContext": null }, "value": "case", - "start": 10630, - "end": 10634, + "start": 10871, + "end": 10875, "loc": { "start": { - "line": 245, + "line": 256, "column": 12 }, "end": { - "line": 245, + "line": 256, "column": 16 } } @@ -67517,15 +70082,15 @@ "updateContext": null }, "value": "gltf", - "start": 10635, - "end": 10641, + "start": 10876, + "end": 10882, "loc": { "start": { - "line": 245, + "line": 256, "column": 17 }, "end": { - "line": 245, + "line": 256, "column": 23 } } @@ -67543,15 +70108,15 @@ "binop": null, "updateContext": null }, - "start": 10641, - "end": 10642, + "start": 10882, + "end": 10883, "loc": { "start": { - "line": 245, + "line": 256, "column": 23 }, "end": { - "line": 245, + "line": 256, "column": 24 } } @@ -67569,15 +70134,15 @@ "binop": null }, "value": "sourceData", - "start": 10659, - "end": 10669, + "start": 10900, + "end": 10910, "loc": { "start": { - "line": 246, + "line": 257, "column": 16 }, "end": { - "line": 246, + "line": 257, "column": 26 } } @@ -67596,15 +70161,15 @@ "updateContext": null }, "value": "=", - "start": 10670, - "end": 10671, + "start": 10911, + "end": 10912, "loc": { "start": { - "line": 246, + "line": 257, "column": 27 }, "end": { - "line": 246, + "line": 257, "column": 28 } } @@ -67622,15 +70187,15 @@ "binop": null }, "value": "toArrayBuffer", - "start": 10672, - "end": 10685, + "start": 10913, + "end": 10926, "loc": { "start": { - "line": 246, + "line": 257, "column": 29 }, "end": { - "line": 246, + "line": 257, "column": 42 } } @@ -67647,15 +70212,15 @@ "postfix": false, "binop": null }, - "start": 10685, - "end": 10686, + "start": 10926, + "end": 10927, "loc": { "start": { - "line": 246, + "line": 257, "column": 42 }, "end": { - "line": 246, + "line": 257, "column": 43 } } @@ -67673,15 +70238,15 @@ "binop": null }, "value": "sourceData", - "start": 10686, - "end": 10696, + "start": 10927, + "end": 10937, "loc": { "start": { - "line": 246, + "line": 257, "column": 43 }, "end": { - "line": 246, + "line": 257, "column": 53 } } @@ -67698,15 +70263,15 @@ "postfix": false, "binop": null }, - "start": 10696, - "end": 10697, + "start": 10937, + "end": 10938, "loc": { "start": { - "line": 246, + "line": 257, "column": 53 }, "end": { - "line": 246, + "line": 257, "column": 54 } } @@ -67724,15 +70289,15 @@ "binop": null, "updateContext": null }, - "start": 10697, - "end": 10698, + "start": 10938, + "end": 10939, "loc": { "start": { - "line": 246, + "line": 257, "column": 54 }, "end": { - "line": 246, + "line": 257, "column": 55 } } @@ -67752,15 +70317,15 @@ "updateContext": null }, "value": "const", - "start": 10715, - "end": 10720, + "start": 10956, + "end": 10961, "loc": { "start": { - "line": 247, + "line": 258, "column": 16 }, "end": { - "line": 247, + "line": 258, "column": 21 } } @@ -67778,15 +70343,15 @@ "binop": null }, "value": "gltfBasePath", - "start": 10721, - "end": 10733, + "start": 10962, + "end": 10974, "loc": { "start": { - "line": 247, + "line": 258, "column": 22 }, "end": { - "line": 247, + "line": 258, "column": 34 } } @@ -67805,15 +70370,15 @@ "updateContext": null }, "value": "=", - "start": 10734, - "end": 10735, + "start": 10975, + "end": 10976, "loc": { "start": { - "line": 247, + "line": 258, "column": 35 }, "end": { - "line": 247, + "line": 258, "column": 36 } } @@ -67831,15 +70396,15 @@ "binop": null }, "value": "source", - "start": 10736, - "end": 10742, + "start": 10977, + "end": 10983, "loc": { "start": { - "line": 247, + "line": 258, "column": 37 }, "end": { - "line": 247, + "line": 258, "column": 43 } } @@ -67857,15 +70422,15 @@ "binop": null, "updateContext": null }, - "start": 10743, - "end": 10744, + "start": 10984, + "end": 10985, "loc": { "start": { - "line": 247, + "line": 258, "column": 44 }, "end": { - "line": 247, + "line": 258, "column": 45 } } @@ -67883,15 +70448,15 @@ "binop": null }, "value": "path", - "start": 10745, - "end": 10749, + "start": 10986, + "end": 10990, "loc": { "start": { - "line": 247, + "line": 258, "column": 46 }, "end": { - "line": 247, + "line": 258, "column": 50 } } @@ -67909,15 +70474,15 @@ "binop": null, "updateContext": null }, - "start": 10749, - "end": 10750, + "start": 10990, + "end": 10991, "loc": { "start": { - "line": 247, + "line": 258, "column": 50 }, "end": { - "line": 247, + "line": 258, "column": 51 } } @@ -67935,15 +70500,15 @@ "binop": null }, "value": "dirname", - "start": 10750, - "end": 10757, + "start": 10991, + "end": 10998, "loc": { "start": { - "line": 247, + "line": 258, "column": 51 }, "end": { - "line": 247, + "line": 258, "column": 58 } } @@ -67960,15 +70525,15 @@ "postfix": false, "binop": null }, - "start": 10757, - "end": 10758, + "start": 10998, + "end": 10999, "loc": { "start": { - "line": 247, + "line": 258, "column": 58 }, "end": { - "line": 247, + "line": 258, "column": 59 } } @@ -67986,15 +70551,15 @@ "binop": null }, "value": "source", - "start": 10758, - "end": 10764, + "start": 10999, + "end": 11005, "loc": { "start": { - "line": 247, + "line": 258, "column": 59 }, "end": { - "line": 247, + "line": 258, "column": 65 } } @@ -68011,15 +70576,15 @@ "postfix": false, "binop": null }, - "start": 10764, - "end": 10765, + "start": 11005, + "end": 11006, "loc": { "start": { - "line": 247, + "line": 258, "column": 65 }, "end": { - "line": 247, + "line": 258, "column": 66 } } @@ -68037,15 +70602,15 @@ "binop": null, "updateContext": null }, - "start": 10766, - "end": 10767, + "start": 11007, + "end": 11008, "loc": { "start": { - "line": 247, + "line": 258, "column": 67 }, "end": { - "line": 247, + "line": 258, "column": 68 } } @@ -68064,15 +70629,15 @@ "updateContext": null }, "value": "", - "start": 10768, - "end": 10770, + "start": 11009, + "end": 11011, "loc": { "start": { - "line": 247, + "line": 258, "column": 69 }, "end": { - "line": 247, + "line": 258, "column": 71 } } @@ -68090,15 +70655,15 @@ "binop": null, "updateContext": null }, - "start": 10770, - "end": 10771, + "start": 11011, + "end": 11012, "loc": { "start": { - "line": 247, + "line": 258, "column": 71 }, "end": { - "line": 247, + "line": 258, "column": 72 } } @@ -68116,15 +70681,15 @@ "binop": null }, "value": "convert", - "start": 10788, - "end": 10795, + "start": 11029, + "end": 11036, "loc": { "start": { - "line": 248, + "line": 259, "column": 16 }, "end": { - "line": 248, + "line": 259, "column": 23 } } @@ -68141,15 +70706,15 @@ "postfix": false, "binop": null }, - "start": 10795, - "end": 10796, + "start": 11036, + "end": 11037, "loc": { "start": { - "line": 248, + "line": 259, "column": 23 }, "end": { - "line": 248, + "line": 259, "column": 24 } } @@ -68167,15 +70732,15 @@ "binop": null }, "value": "parseGLTFIntoXKTModel", - "start": 10796, - "end": 10817, + "start": 11037, + "end": 11058, "loc": { "start": { - "line": 248, + "line": 259, "column": 24 }, "end": { - "line": 248, + "line": 259, "column": 45 } } @@ -68193,15 +70758,15 @@ "binop": null, "updateContext": null }, - "start": 10817, - "end": 10818, + "start": 11058, + "end": 11059, "loc": { "start": { - "line": 248, + "line": 259, "column": 45 }, "end": { - "line": 248, + "line": 259, "column": 46 } } @@ -68218,15 +70783,15 @@ "postfix": false, "binop": null }, - "start": 10819, - "end": 10820, + "start": 11060, + "end": 11061, "loc": { "start": { - "line": 248, + "line": 259, "column": 47 }, "end": { - "line": 248, + "line": 259, "column": 48 } } @@ -68244,15 +70809,15 @@ "binop": null }, "value": "baseUri", - "start": 10841, - "end": 10848, + "start": 11082, + "end": 11089, "loc": { "start": { - "line": 249, + "line": 260, "column": 20 }, "end": { - "line": 249, + "line": 260, "column": 27 } } @@ -68270,15 +70835,15 @@ "binop": null, "updateContext": null }, - "start": 10848, - "end": 10849, + "start": 11089, + "end": 11090, "loc": { "start": { - "line": 249, + "line": 260, "column": 27 }, "end": { - "line": 249, + "line": 260, "column": 28 } } @@ -68296,15 +70861,15 @@ "binop": null }, "value": "gltfBasePath", - "start": 10850, - "end": 10862, + "start": 11091, + "end": 11103, "loc": { "start": { - "line": 249, + "line": 260, "column": 29 }, "end": { - "line": 249, + "line": 260, "column": 41 } } @@ -68322,15 +70887,15 @@ "binop": null, "updateContext": null }, - "start": 10862, - "end": 10863, + "start": 11103, + "end": 11104, "loc": { "start": { - "line": 249, + "line": 260, "column": 41 }, "end": { - "line": 249, + "line": 260, "column": 42 } } @@ -68348,15 +70913,15 @@ "binop": null }, "value": "data", - "start": 10884, - "end": 10888, + "start": 11125, + "end": 11129, "loc": { "start": { - "line": 250, + "line": 261, "column": 20 }, "end": { - "line": 250, + "line": 261, "column": 24 } } @@ -68374,15 +70939,15 @@ "binop": null, "updateContext": null }, - "start": 10888, - "end": 10889, + "start": 11129, + "end": 11130, "loc": { "start": { - "line": 250, + "line": 261, "column": 24 }, "end": { - "line": 250, + "line": 261, "column": 25 } } @@ -68400,15 +70965,15 @@ "binop": null }, "value": "sourceData", - "start": 10890, - "end": 10900, + "start": 11131, + "end": 11141, "loc": { "start": { - "line": 250, + "line": 261, "column": 26 }, "end": { - "line": 250, + "line": 261, "column": 36 } } @@ -68426,15 +70991,15 @@ "binop": null, "updateContext": null }, - "start": 10900, - "end": 10901, + "start": 11141, + "end": 11142, "loc": { "start": { - "line": 250, + "line": 261, "column": 36 }, "end": { - "line": 250, + "line": 261, "column": 37 } } @@ -68452,15 +71017,15 @@ "binop": null }, "value": "reuseGeometries", - "start": 10922, - "end": 10937, + "start": 11163, + "end": 11178, "loc": { "start": { - "line": 251, + "line": 262, "column": 20 }, "end": { - "line": 251, + "line": 262, "column": 35 } } @@ -68478,15 +71043,15 @@ "binop": null, "updateContext": null }, - "start": 10937, - "end": 10938, + "start": 11178, + "end": 11179, "loc": { "start": { - "line": 251, + "line": 262, "column": 35 }, "end": { - "line": 251, + "line": 262, "column": 36 } } @@ -68504,15 +71069,15 @@ "binop": null }, "value": "includeTextures", - "start": 10959, - "end": 10974, + "start": 11200, + "end": 11215, "loc": { "start": { - "line": 252, + "line": 263, "column": 20 }, "end": { - "line": 252, + "line": 263, "column": 35 } } @@ -68530,15 +71095,15 @@ "binop": null, "updateContext": null }, - "start": 10974, - "end": 10975, + "start": 11215, + "end": 11216, "loc": { "start": { - "line": 252, + "line": 263, "column": 35 }, "end": { - "line": 252, + "line": 263, "column": 36 } } @@ -68558,15 +71123,15 @@ "updateContext": null }, "value": "true", - "start": 10976, - "end": 10980, + "start": 11217, + "end": 11221, "loc": { "start": { - "line": 252, + "line": 263, "column": 37 }, "end": { - "line": 252, + "line": 263, "column": 41 } } @@ -68584,15 +71149,15 @@ "binop": null, "updateContext": null }, - "start": 10980, - "end": 10981, + "start": 11221, + "end": 11222, "loc": { "start": { - "line": 252, + "line": 263, "column": 41 }, "end": { - "line": 252, + "line": 263, "column": 42 } } @@ -68610,15 +71175,15 @@ "binop": null }, "value": "includeNormals", - "start": 11002, - "end": 11016, + "start": 11243, + "end": 11257, "loc": { "start": { - "line": 253, + "line": 264, "column": 20 }, "end": { - "line": 253, + "line": 264, "column": 34 } } @@ -68636,15 +71201,15 @@ "binop": null, "updateContext": null }, - "start": 11016, - "end": 11017, + "start": 11257, + "end": 11258, "loc": { "start": { - "line": 253, + "line": 264, "column": 34 }, "end": { - "line": 253, + "line": 264, "column": 35 } } @@ -68662,15 +71227,15 @@ "binop": null }, "value": "metaModelData", - "start": 11038, - "end": 11051, + "start": 11279, + "end": 11292, "loc": { "start": { - "line": 254, + "line": 265, "column": 20 }, "end": { - "line": 254, + "line": 265, "column": 33 } } @@ -68688,15 +71253,15 @@ "binop": null, "updateContext": null }, - "start": 11051, - "end": 11052, + "start": 11292, + "end": 11293, "loc": { "start": { - "line": 254, + "line": 265, "column": 33 }, "end": { - "line": 254, + "line": 265, "column": 34 } } @@ -68714,15 +71279,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 11053, - "end": 11066, + "start": 11294, + "end": 11307, "loc": { "start": { - "line": 254, + "line": 265, "column": 35 }, "end": { - "line": 254, + "line": 265, "column": 48 } } @@ -68740,15 +71305,15 @@ "binop": null, "updateContext": null }, - "start": 11066, - "end": 11067, + "start": 11307, + "end": 11308, "loc": { "start": { - "line": 254, + "line": 265, "column": 48 }, "end": { - "line": 254, + "line": 265, "column": 49 } } @@ -68766,15 +71331,15 @@ "binop": null }, "value": "xktModel", - "start": 11088, - "end": 11096, + "start": 11329, + "end": 11337, "loc": { "start": { - "line": 255, + "line": 266, "column": 20 }, "end": { - "line": 255, + "line": 266, "column": 28 } } @@ -68792,15 +71357,15 @@ "binop": null, "updateContext": null }, - "start": 11096, - "end": 11097, + "start": 11337, + "end": 11338, "loc": { "start": { - "line": 255, + "line": 266, "column": 28 }, "end": { - "line": 255, + "line": 266, "column": 29 } } @@ -68818,15 +71383,15 @@ "binop": null }, "value": "stats", - "start": 11118, - "end": 11123, + "start": 11359, + "end": 11364, "loc": { "start": { - "line": 256, + "line": 267, "column": 20 }, "end": { - "line": 256, + "line": 267, "column": 25 } } @@ -68844,15 +71409,15 @@ "binop": null, "updateContext": null }, - "start": 11123, - "end": 11124, + "start": 11364, + "end": 11365, "loc": { "start": { - "line": 256, + "line": 267, "column": 25 }, "end": { - "line": 256, + "line": 267, "column": 26 } } @@ -68870,15 +71435,15 @@ "binop": null }, "value": "log", - "start": 11145, - "end": 11148, + "start": 11386, + "end": 11389, "loc": { "start": { - "line": 257, + "line": 268, "column": 20 }, "end": { - "line": 257, + "line": 268, "column": 23 } } @@ -68895,15 +71460,15 @@ "postfix": false, "binop": null }, - "start": 11165, - "end": 11166, + "start": 11406, + "end": 11407, "loc": { "start": { - "line": 258, + "line": 269, "column": 16 }, "end": { - "line": 258, + "line": 269, "column": 17 } } @@ -68920,15 +71485,15 @@ "postfix": false, "binop": null }, - "start": 11166, - "end": 11167, + "start": 11407, + "end": 11408, "loc": { "start": { - "line": 258, + "line": 269, "column": 17 }, "end": { - "line": 258, + "line": 269, "column": 18 } } @@ -68946,15 +71511,15 @@ "binop": null, "updateContext": null }, - "start": 11167, - "end": 11168, + "start": 11408, + "end": 11409, "loc": { "start": { - "line": 258, + "line": 269, "column": 18 }, "end": { - "line": 258, + "line": 269, "column": 19 } } @@ -68974,15 +71539,15 @@ "updateContext": null }, "value": "break", - "start": 11185, - "end": 11190, + "start": 11426, + "end": 11431, "loc": { "start": { - "line": 259, + "line": 270, "column": 16 }, "end": { - "line": 259, + "line": 270, "column": 21 } } @@ -69000,15 +71565,15 @@ "binop": null, "updateContext": null }, - "start": 11190, - "end": 11191, + "start": 11431, + "end": 11432, "loc": { "start": { - "line": 259, + "line": 270, "column": 21 }, "end": { - "line": 259, + "line": 270, "column": 22 } } @@ -69016,15 +71581,15 @@ { "type": "CommentLine", "value": " case \"gltf\":", - "start": 11205, - "end": 11220, + "start": 11446, + "end": 11461, "loc": { "start": { - "line": 261, + "line": 272, "column": 12 }, "end": { - "line": 261, + "line": 272, "column": 27 } } @@ -69032,15 +71597,15 @@ { "type": "CommentLine", "value": " const gltfJSON = JSON.parse(sourceData);", - "start": 11233, - "end": 11280, + "start": 11474, + "end": 11521, "loc": { "start": { - "line": 262, + "line": 273, "column": 12 }, "end": { - "line": 262, + "line": 273, "column": 59 } } @@ -69048,15 +71613,15 @@ { "type": "CommentLine", "value": " const gltfBasePath = source ? getBasePath(source) : \"\";", - "start": 11293, - "end": 11355, + "start": 11534, + "end": 11596, "loc": { "start": { - "line": 263, + "line": 274, "column": 12 }, "end": { - "line": 263, + "line": 274, "column": 74 } } @@ -69064,15 +71629,15 @@ { "type": "CommentLine", "value": " convert(parseGLTFIntoXKTModel, {", - "start": 11368, - "end": 11407, + "start": 11609, + "end": 11648, "loc": { "start": { - "line": 264, + "line": 275, "column": 12 }, "end": { - "line": 264, + "line": 275, "column": 51 } } @@ -69080,15 +71645,15 @@ { "type": "CommentLine", "value": " baseUri: gltfBasePath,", - "start": 11420, - "end": 11453, + "start": 11661, + "end": 11694, "loc": { "start": { - "line": 265, + "line": 276, "column": 12 }, "end": { - "line": 265, + "line": 276, "column": 45 } } @@ -69096,15 +71661,15 @@ { "type": "CommentLine", "value": " data: gltfJSON,", - "start": 11466, - "end": 11492, + "start": 11707, + "end": 11733, "loc": { "start": { - "line": 266, + "line": 277, "column": 12 }, "end": { - "line": 266, + "line": 277, "column": 38 } } @@ -69112,15 +71677,15 @@ { "type": "CommentLine", "value": " reuseGeometries,", - "start": 11505, - "end": 11532, + "start": 11746, + "end": 11773, "loc": { "start": { - "line": 267, + "line": 278, "column": 12 }, "end": { - "line": 267, + "line": 278, "column": 39 } } @@ -69128,15 +71693,15 @@ { "type": "CommentLine", "value": " includeTextures,", - "start": 11545, - "end": 11572, + "start": 11786, + "end": 11813, "loc": { "start": { - "line": 268, + "line": 279, "column": 12 }, "end": { - "line": 268, + "line": 279, "column": 39 } } @@ -69144,15 +71709,15 @@ { "type": "CommentLine", "value": " includeNormals,", - "start": 11585, - "end": 11611, + "start": 11826, + "end": 11852, "loc": { "start": { - "line": 269, + "line": 280, "column": 12 }, "end": { - "line": 269, + "line": 280, "column": 38 } } @@ -69160,15 +71725,15 @@ { "type": "CommentLine", "value": " metaModelData: metaModelJSON,", - "start": 11624, - "end": 11664, + "start": 11865, + "end": 11905, "loc": { "start": { - "line": 270, + "line": 281, "column": 12 }, "end": { - "line": 270, + "line": 281, "column": 52 } } @@ -69176,15 +71741,15 @@ { "type": "CommentLine", "value": " xktModel,", - "start": 11677, - "end": 11697, + "start": 11918, + "end": 11938, "loc": { "start": { - "line": 271, + "line": 282, "column": 12 }, "end": { - "line": 271, + "line": 282, "column": 32 } } @@ -69192,15 +71757,15 @@ { "type": "CommentLine", "value": " getAttachment: async (name) => {", - "start": 11710, - "end": 11753, + "start": 11951, + "end": 11994, "loc": { "start": { - "line": 272, + "line": 283, "column": 12 }, "end": { - "line": 272, + "line": 283, "column": 55 } } @@ -69208,15 +71773,15 @@ { "type": "CommentLine", "value": " const filePath = gltfBasePath + name;", - "start": 11766, - "end": 11818, + "start": 12007, + "end": 12059, "loc": { "start": { - "line": 273, + "line": 284, "column": 12 }, "end": { - "line": 273, + "line": 284, "column": 64 } } @@ -69224,15 +71789,15 @@ { "type": "CommentLine", "value": " log(`Reading attachment file: ${filePath}`);", - "start": 11831, - "end": 11890, + "start": 12072, + "end": 12131, "loc": { "start": { - "line": 274, + "line": 285, "column": 12 }, "end": { - "line": 274, + "line": 285, "column": 71 } } @@ -69240,15 +71805,15 @@ { "type": "CommentLine", "value": " const buffer = fs.readFileSync(filePath);", - "start": 11903, - "end": 11959, + "start": 12144, + "end": 12200, "loc": { "start": { - "line": 275, + "line": 286, "column": 12 }, "end": { - "line": 275, + "line": 286, "column": 68 } } @@ -69256,15 +71821,15 @@ { "type": "CommentLine", "value": " const arrayBuf = toArrayBuffer(buffer);", - "start": 11972, - "end": 12026, + "start": 12213, + "end": 12267, "loc": { "start": { - "line": 276, + "line": 287, "column": 12 }, "end": { - "line": 276, + "line": 287, "column": 66 } } @@ -69272,15 +71837,15 @@ { "type": "CommentLine", "value": " return arrayBuf;", - "start": 12039, - "end": 12070, + "start": 12280, + "end": 12311, "loc": { "start": { - "line": 277, + "line": 288, "column": 12 }, "end": { - "line": 277, + "line": 288, "column": 43 } } @@ -69288,15 +71853,15 @@ { "type": "CommentLine", "value": " },", - "start": 12083, - "end": 12096, + "start": 12324, + "end": 12337, "loc": { "start": { - "line": 278, + "line": 289, "column": 12 }, "end": { - "line": 278, + "line": 289, "column": 25 } } @@ -69304,15 +71869,15 @@ { "type": "CommentLine", "value": " stats,", - "start": 12109, - "end": 12126, + "start": 12350, + "end": 12367, "loc": { "start": { - "line": 279, + "line": 290, "column": 12 }, "end": { - "line": 279, + "line": 290, "column": 29 } } @@ -69320,15 +71885,15 @@ { "type": "CommentLine", "value": " log", - "start": 12139, - "end": 12153, + "start": 12380, + "end": 12394, "loc": { "start": { - "line": 280, + "line": 291, "column": 12 }, "end": { - "line": 280, + "line": 291, "column": 26 } } @@ -69336,15 +71901,15 @@ { "type": "CommentLine", "value": " });", - "start": 12166, - "end": 12176, + "start": 12407, + "end": 12417, "loc": { "start": { - "line": 281, + "line": 292, "column": 12 }, "end": { - "line": 281, + "line": 292, "column": 22 } } @@ -69352,15 +71917,15 @@ { "type": "CommentLine", "value": " break;", - "start": 12189, - "end": 12202, + "start": 12430, + "end": 12443, "loc": { "start": { - "line": 282, + "line": 293, "column": 12 }, "end": { - "line": 282, + "line": 293, "column": 25 } } @@ -69380,15 +71945,15 @@ "updateContext": null }, "value": "case", - "start": 12216, - "end": 12220, + "start": 12457, + "end": 12461, "loc": { "start": { - "line": 284, + "line": 295, "column": 12 }, "end": { - "line": 284, + "line": 295, "column": 16 } } @@ -69407,15 +71972,15 @@ "updateContext": null }, "value": "ifc", - "start": 12221, - "end": 12226, + "start": 12462, + "end": 12467, "loc": { "start": { - "line": 284, + "line": 295, "column": 17 }, "end": { - "line": 284, + "line": 295, "column": 22 } } @@ -69433,15 +71998,15 @@ "binop": null, "updateContext": null }, - "start": 12226, - "end": 12227, + "start": 12467, + "end": 12468, "loc": { "start": { - "line": 284, + "line": 295, "column": 22 }, "end": { - "line": 284, + "line": 295, "column": 23 } } @@ -69459,15 +72024,15 @@ "binop": null }, "value": "convert", - "start": 12244, - "end": 12251, + "start": 12485, + "end": 12492, "loc": { "start": { - "line": 285, + "line": 296, "column": 16 }, "end": { - "line": 285, + "line": 296, "column": 23 } } @@ -69484,15 +72049,15 @@ "postfix": false, "binop": null }, - "start": 12251, - "end": 12252, + "start": 12492, + "end": 12493, "loc": { "start": { - "line": 285, + "line": 296, "column": 23 }, "end": { - "line": 285, + "line": 296, "column": 24 } } @@ -69510,15 +72075,15 @@ "binop": null }, "value": "parseIFCIntoXKTModel", - "start": 12252, - "end": 12272, + "start": 12493, + "end": 12513, "loc": { "start": { - "line": 285, + "line": 296, "column": 24 }, "end": { - "line": 285, + "line": 296, "column": 44 } } @@ -69536,15 +72101,15 @@ "binop": null, "updateContext": null }, - "start": 12272, - "end": 12273, + "start": 12513, + "end": 12514, "loc": { "start": { - "line": 285, + "line": 296, "column": 44 }, "end": { - "line": 285, + "line": 296, "column": 45 } } @@ -69561,15 +72126,15 @@ "postfix": false, "binop": null }, - "start": 12274, - "end": 12275, + "start": 12515, + "end": 12516, "loc": { "start": { - "line": 285, + "line": 296, "column": 46 }, "end": { - "line": 285, + "line": 296, "column": 47 } } @@ -69587,15 +72152,15 @@ "binop": null }, "value": "WebIFC", - "start": 12296, - "end": 12302, + "start": 12537, + "end": 12543, "loc": { "start": { - "line": 286, + "line": 297, "column": 20 }, "end": { - "line": 286, + "line": 297, "column": 26 } } @@ -69613,15 +72178,15 @@ "binop": null, "updateContext": null }, - "start": 12302, - "end": 12303, + "start": 12543, + "end": 12544, "loc": { "start": { - "line": 286, + "line": 297, "column": 26 }, "end": { - "line": 286, + "line": 297, "column": 27 } } @@ -69639,15 +72204,15 @@ "binop": null }, "value": "data", - "start": 12324, - "end": 12328, + "start": 12565, + "end": 12569, "loc": { "start": { - "line": 287, + "line": 298, "column": 20 }, "end": { - "line": 287, + "line": 298, "column": 24 } } @@ -69665,15 +72230,15 @@ "binop": null, "updateContext": null }, - "start": 12328, - "end": 12329, + "start": 12569, + "end": 12570, "loc": { "start": { - "line": 287, + "line": 298, "column": 24 }, "end": { - "line": 287, + "line": 298, "column": 25 } } @@ -69691,15 +72256,15 @@ "binop": null }, "value": "sourceData", - "start": 12330, - "end": 12340, + "start": 12571, + "end": 12581, "loc": { "start": { - "line": 287, + "line": 298, "column": 26 }, "end": { - "line": 287, + "line": 298, "column": 36 } } @@ -69717,15 +72282,15 @@ "binop": null, "updateContext": null }, - "start": 12340, - "end": 12341, + "start": 12581, + "end": 12582, "loc": { "start": { - "line": 287, + "line": 298, "column": 36 }, "end": { - "line": 287, + "line": 298, "column": 37 } } @@ -69743,15 +72308,15 @@ "binop": null }, "value": "xktModel", - "start": 12362, - "end": 12370, + "start": 12603, + "end": 12611, "loc": { "start": { - "line": 288, + "line": 299, "column": 20 }, "end": { - "line": 288, + "line": 299, "column": 28 } } @@ -69769,15 +72334,15 @@ "binop": null, "updateContext": null }, - "start": 12370, - "end": 12371, + "start": 12611, + "end": 12612, "loc": { "start": { - "line": 288, + "line": 299, "column": 28 }, "end": { - "line": 288, + "line": 299, "column": 29 } } @@ -69795,15 +72360,15 @@ "binop": null }, "value": "wasmPath", - "start": 12392, - "end": 12400, + "start": 12633, + "end": 12641, "loc": { "start": { - "line": 289, + "line": 300, "column": 20 }, "end": { - "line": 289, + "line": 300, "column": 28 } } @@ -69821,15 +72386,15 @@ "binop": null, "updateContext": null }, - "start": 12400, - "end": 12401, + "start": 12641, + "end": 12642, "loc": { "start": { - "line": 289, + "line": 300, "column": 28 }, "end": { - "line": 289, + "line": 300, "column": 29 } } @@ -69848,15 +72413,15 @@ "updateContext": null }, "value": "./", - "start": 12402, - "end": 12406, + "start": 12643, + "end": 12647, "loc": { "start": { - "line": 289, + "line": 300, "column": 30 }, "end": { - "line": 289, + "line": 300, "column": 34 } } @@ -69874,15 +72439,15 @@ "binop": null, "updateContext": null }, - "start": 12406, - "end": 12407, + "start": 12647, + "end": 12648, "loc": { "start": { - "line": 289, + "line": 300, "column": 34 }, "end": { - "line": 289, + "line": 300, "column": 35 } } @@ -69900,15 +72465,15 @@ "binop": null }, "value": "includeTypes", - "start": 12428, - "end": 12440, + "start": 12669, + "end": 12681, "loc": { "start": { - "line": 290, + "line": 301, "column": 20 }, "end": { - "line": 290, + "line": 301, "column": 32 } } @@ -69926,15 +72491,15 @@ "binop": null, "updateContext": null }, - "start": 12440, - "end": 12441, + "start": 12681, + "end": 12682, "loc": { "start": { - "line": 290, + "line": 301, "column": 32 }, "end": { - "line": 290, + "line": 301, "column": 33 } } @@ -69952,15 +72517,15 @@ "binop": null }, "value": "excludeTypes", - "start": 12462, - "end": 12474, + "start": 12703, + "end": 12715, "loc": { "start": { - "line": 291, + "line": 302, "column": 20 }, "end": { - "line": 291, + "line": 302, "column": 32 } } @@ -69978,15 +72543,15 @@ "binop": null, "updateContext": null }, - "start": 12474, - "end": 12475, + "start": 12715, + "end": 12716, "loc": { "start": { - "line": 291, + "line": 302, "column": 32 }, "end": { - "line": 291, + "line": 302, "column": 33 } } @@ -70004,15 +72569,15 @@ "binop": null }, "value": "stats", - "start": 12496, - "end": 12501, + "start": 12737, + "end": 12742, "loc": { "start": { - "line": 292, + "line": 303, "column": 20 }, "end": { - "line": 292, + "line": 303, "column": 25 } } @@ -70030,15 +72595,15 @@ "binop": null, "updateContext": null }, - "start": 12501, - "end": 12502, + "start": 12742, + "end": 12743, "loc": { "start": { - "line": 292, + "line": 303, "column": 25 }, "end": { - "line": 292, + "line": 303, "column": 26 } } @@ -70056,15 +72621,15 @@ "binop": null }, "value": "log", - "start": 12523, - "end": 12526, + "start": 12764, + "end": 12767, "loc": { "start": { - "line": 293, + "line": 304, "column": 20 }, "end": { - "line": 293, + "line": 304, "column": 23 } } @@ -70081,15 +72646,15 @@ "postfix": false, "binop": null }, - "start": 12543, - "end": 12544, + "start": 12784, + "end": 12785, "loc": { "start": { - "line": 294, + "line": 305, "column": 16 }, "end": { - "line": 294, + "line": 305, "column": 17 } } @@ -70106,15 +72671,15 @@ "postfix": false, "binop": null }, - "start": 12544, - "end": 12545, + "start": 12785, + "end": 12786, "loc": { "start": { - "line": 294, + "line": 305, "column": 17 }, "end": { - "line": 294, + "line": 305, "column": 18 } } @@ -70132,15 +72697,15 @@ "binop": null, "updateContext": null }, - "start": 12545, - "end": 12546, + "start": 12786, + "end": 12787, "loc": { "start": { - "line": 294, + "line": 305, "column": 18 }, "end": { - "line": 294, + "line": 305, "column": 19 } } @@ -70160,15 +72725,15 @@ "updateContext": null }, "value": "break", - "start": 12563, - "end": 12568, + "start": 12804, + "end": 12809, "loc": { "start": { - "line": 295, + "line": 306, "column": 16 }, "end": { - "line": 295, + "line": 306, "column": 21 } } @@ -70186,15 +72751,15 @@ "binop": null, "updateContext": null }, - "start": 12568, - "end": 12569, + "start": 12809, + "end": 12810, "loc": { "start": { - "line": 295, + "line": 306, "column": 21 }, "end": { - "line": 295, + "line": 306, "column": 22 } } @@ -70214,15 +72779,15 @@ "updateContext": null }, "value": "case", - "start": 12583, - "end": 12587, + "start": 12824, + "end": 12828, "loc": { "start": { - "line": 297, + "line": 308, "column": 12 }, "end": { - "line": 297, + "line": 308, "column": 16 } } @@ -70241,15 +72806,15 @@ "updateContext": null }, "value": "laz", - "start": 12588, - "end": 12593, + "start": 12829, + "end": 12834, "loc": { "start": { - "line": 297, + "line": 308, "column": 17 }, "end": { - "line": 297, + "line": 308, "column": 22 } } @@ -70267,15 +72832,15 @@ "binop": null, "updateContext": null }, - "start": 12593, - "end": 12594, + "start": 12834, + "end": 12835, "loc": { "start": { - "line": 297, + "line": 308, "column": 22 }, "end": { - "line": 297, + "line": 308, "column": 23 } } @@ -70293,15 +72858,15 @@ "binop": null }, "value": "convert", - "start": 12611, - "end": 12618, + "start": 12852, + "end": 12859, "loc": { "start": { - "line": 298, + "line": 309, "column": 16 }, "end": { - "line": 298, + "line": 309, "column": 23 } } @@ -70318,15 +72883,15 @@ "postfix": false, "binop": null }, - "start": 12618, - "end": 12619, + "start": 12859, + "end": 12860, "loc": { "start": { - "line": 298, + "line": 309, "column": 23 }, "end": { - "line": 298, + "line": 309, "column": 24 } } @@ -70344,15 +72909,15 @@ "binop": null }, "value": "parseLASIntoXKTModel", - "start": 12619, - "end": 12639, + "start": 12860, + "end": 12880, "loc": { "start": { - "line": 298, + "line": 309, "column": 24 }, "end": { - "line": 298, + "line": 309, "column": 44 } } @@ -70370,15 +72935,15 @@ "binop": null, "updateContext": null }, - "start": 12639, - "end": 12640, + "start": 12880, + "end": 12881, "loc": { "start": { - "line": 298, + "line": 309, "column": 44 }, "end": { - "line": 298, + "line": 309, "column": 45 } } @@ -70395,15 +72960,15 @@ "postfix": false, "binop": null }, - "start": 12641, - "end": 12642, + "start": 12882, + "end": 12883, "loc": { "start": { - "line": 298, + "line": 309, "column": 46 }, "end": { - "line": 298, + "line": 309, "column": 47 } } @@ -70421,15 +72986,15 @@ "binop": null }, "value": "data", - "start": 12663, - "end": 12667, + "start": 12904, + "end": 12908, "loc": { "start": { - "line": 299, + "line": 310, "column": 20 }, "end": { - "line": 299, + "line": 310, "column": 24 } } @@ -70447,15 +73012,15 @@ "binop": null, "updateContext": null }, - "start": 12667, - "end": 12668, + "start": 12908, + "end": 12909, "loc": { "start": { - "line": 299, + "line": 310, "column": 24 }, "end": { - "line": 299, + "line": 310, "column": 25 } } @@ -70473,15 +73038,15 @@ "binop": null }, "value": "sourceData", - "start": 12669, - "end": 12679, + "start": 12910, + "end": 12920, "loc": { "start": { - "line": 299, + "line": 310, "column": 26 }, "end": { - "line": 299, + "line": 310, "column": 36 } } @@ -70499,15 +73064,15 @@ "binop": null, "updateContext": null }, - "start": 12679, - "end": 12680, + "start": 12920, + "end": 12921, "loc": { "start": { - "line": 299, + "line": 310, "column": 36 }, "end": { - "line": 299, + "line": 310, "column": 37 } } @@ -70525,15 +73090,15 @@ "binop": null }, "value": "xktModel", - "start": 12701, - "end": 12709, + "start": 12942, + "end": 12950, "loc": { "start": { - "line": 300, + "line": 311, "column": 20 }, "end": { - "line": 300, + "line": 311, "column": 28 } } @@ -70551,15 +73116,15 @@ "binop": null, "updateContext": null }, - "start": 12709, - "end": 12710, + "start": 12950, + "end": 12951, "loc": { "start": { - "line": 300, + "line": 311, "column": 28 }, "end": { - "line": 300, + "line": 311, "column": 29 } } @@ -70577,15 +73142,15 @@ "binop": null }, "value": "stats", - "start": 12731, - "end": 12736, + "start": 12972, + "end": 12977, "loc": { "start": { - "line": 301, + "line": 312, "column": 20 }, "end": { - "line": 301, + "line": 312, "column": 25 } } @@ -70603,15 +73168,15 @@ "binop": null, "updateContext": null }, - "start": 12736, - "end": 12737, + "start": 12977, + "end": 12978, "loc": { "start": { - "line": 301, + "line": 312, "column": 25 }, "end": { - "line": 301, + "line": 312, "column": 26 } } @@ -70629,15 +73194,15 @@ "binop": null }, "value": "fp64", - "start": 12758, - "end": 12762, + "start": 12999, + "end": 13003, "loc": { "start": { - "line": 302, + "line": 313, "column": 20 }, "end": { - "line": 302, + "line": 313, "column": 24 } } @@ -70655,15 +73220,15 @@ "binop": null, "updateContext": null }, - "start": 12762, - "end": 12763, + "start": 13003, + "end": 13004, "loc": { "start": { - "line": 302, + "line": 313, "column": 24 }, "end": { - "line": 302, + "line": 313, "column": 25 } } @@ -70681,15 +73246,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 12764, - "end": 12779, + "start": 13005, + "end": 13020, "loc": { "start": { - "line": 302, + "line": 313, "column": 26 }, "end": { - "line": 302, + "line": 313, "column": 41 } } @@ -70707,15 +73272,15 @@ "binop": null, "updateContext": null }, - "start": 12779, - "end": 12780, + "start": 13020, + "end": 13021, "loc": { "start": { - "line": 302, + "line": 313, "column": 41 }, "end": { - "line": 302, + "line": 313, "column": 42 } } @@ -70733,15 +73298,15 @@ "binop": null }, "value": "fp64", - "start": 12780, - "end": 12784, + "start": 13021, + "end": 13025, "loc": { "start": { - "line": 302, + "line": 313, "column": 42 }, "end": { - "line": 302, + "line": 313, "column": 46 } } @@ -70759,15 +73324,15 @@ "binop": null, "updateContext": null }, - "start": 12784, - "end": 12785, + "start": 13025, + "end": 13026, "loc": { "start": { - "line": 302, + "line": 313, "column": 46 }, "end": { - "line": 302, + "line": 313, "column": 47 } } @@ -70785,15 +73350,15 @@ "binop": null }, "value": "colorDepth", - "start": 12806, - "end": 12816, + "start": 13047, + "end": 13057, "loc": { "start": { - "line": 303, + "line": 314, "column": 20 }, "end": { - "line": 303, + "line": 314, "column": 30 } } @@ -70811,15 +73376,15 @@ "binop": null, "updateContext": null }, - "start": 12816, - "end": 12817, + "start": 13057, + "end": 13058, "loc": { "start": { - "line": 303, + "line": 314, "column": 30 }, "end": { - "line": 303, + "line": 314, "column": 31 } } @@ -70837,15 +73402,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 12818, - "end": 12833, + "start": 13059, + "end": 13074, "loc": { "start": { - "line": 303, + "line": 314, "column": 32 }, "end": { - "line": 303, + "line": 314, "column": 47 } } @@ -70863,15 +73428,15 @@ "binop": null, "updateContext": null }, - "start": 12833, - "end": 12834, + "start": 13074, + "end": 13075, "loc": { "start": { - "line": 303, + "line": 314, "column": 47 }, "end": { - "line": 303, + "line": 314, "column": 48 } } @@ -70889,15 +73454,15 @@ "binop": null }, "value": "colorDepth", - "start": 12834, - "end": 12844, + "start": 13075, + "end": 13085, "loc": { "start": { - "line": 303, + "line": 314, "column": 48 }, "end": { - "line": 303, + "line": 314, "column": 58 } } @@ -70915,15 +73480,15 @@ "binop": null, "updateContext": null }, - "start": 12844, - "end": 12845, + "start": 13085, + "end": 13086, "loc": { "start": { - "line": 303, + "line": 314, "column": 58 }, "end": { - "line": 303, + "line": 314, "column": 59 } } @@ -70941,15 +73506,15 @@ "binop": null }, "value": "center", - "start": 12866, - "end": 12872, + "start": 13107, + "end": 13113, "loc": { "start": { - "line": 304, + "line": 315, "column": 20 }, "end": { - "line": 304, + "line": 315, "column": 26 } } @@ -70967,15 +73532,15 @@ "binop": null, "updateContext": null }, - "start": 12872, - "end": 12873, + "start": 13113, + "end": 13114, "loc": { "start": { - "line": 304, + "line": 315, "column": 26 }, "end": { - "line": 304, + "line": 315, "column": 27 } } @@ -70993,15 +73558,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 12874, - "end": 12889, + "start": 13115, + "end": 13130, "loc": { "start": { - "line": 304, + "line": 315, "column": 28 }, "end": { - "line": 304, + "line": 315, "column": 43 } } @@ -71019,15 +73584,15 @@ "binop": null, "updateContext": null }, - "start": 12889, - "end": 12890, + "start": 13130, + "end": 13131, "loc": { "start": { - "line": 304, + "line": 315, "column": 43 }, "end": { - "line": 304, + "line": 315, "column": 44 } } @@ -71045,15 +73610,15 @@ "binop": null }, "value": "center", - "start": 12890, - "end": 12896, + "start": 13131, + "end": 13137, "loc": { "start": { - "line": 304, + "line": 315, "column": 44 }, "end": { - "line": 304, + "line": 315, "column": 50 } } @@ -71071,15 +73636,15 @@ "binop": null, "updateContext": null }, - "start": 12896, - "end": 12897, + "start": 13137, + "end": 13138, "loc": { "start": { - "line": 304, + "line": 315, "column": 50 }, "end": { - "line": 304, + "line": 315, "column": 51 } } @@ -71097,15 +73662,15 @@ "binop": null }, "value": "transform", - "start": 12918, - "end": 12927, + "start": 13159, + "end": 13168, "loc": { "start": { - "line": 305, + "line": 316, "column": 20 }, "end": { - "line": 305, + "line": 316, "column": 29 } } @@ -71123,15 +73688,15 @@ "binop": null, "updateContext": null }, - "start": 12927, - "end": 12928, + "start": 13168, + "end": 13169, "loc": { "start": { - "line": 305, + "line": 316, "column": 29 }, "end": { - "line": 305, + "line": 316, "column": 30 } } @@ -71149,15 +73714,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 12929, - "end": 12944, + "start": 13170, + "end": 13185, "loc": { "start": { - "line": 305, + "line": 316, "column": 31 }, "end": { - "line": 305, + "line": 316, "column": 46 } } @@ -71175,15 +73740,15 @@ "binop": null, "updateContext": null }, - "start": 12944, - "end": 12945, + "start": 13185, + "end": 13186, "loc": { "start": { - "line": 305, + "line": 316, "column": 46 }, "end": { - "line": 305, + "line": 316, "column": 47 } } @@ -71201,15 +73766,15 @@ "binop": null }, "value": "transform", - "start": 12945, - "end": 12954, + "start": 13186, + "end": 13195, "loc": { "start": { - "line": 305, + "line": 316, "column": 47 }, "end": { - "line": 305, + "line": 316, "column": 56 } } @@ -71227,15 +73792,15 @@ "binop": null, "updateContext": null }, - "start": 12954, - "end": 12955, + "start": 13195, + "end": 13196, "loc": { "start": { - "line": 305, + "line": 316, "column": 56 }, "end": { - "line": 305, + "line": 316, "column": 57 } } @@ -71253,15 +73818,15 @@ "binop": null }, "value": "skip", - "start": 12976, - "end": 12980, + "start": 13217, + "end": 13221, "loc": { "start": { - "line": 306, + "line": 317, "column": 20 }, "end": { - "line": 306, + "line": 317, "column": 24 } } @@ -71279,15 +73844,15 @@ "binop": null, "updateContext": null }, - "start": 12980, - "end": 12981, + "start": 13221, + "end": 13222, "loc": { "start": { - "line": 306, + "line": 317, "column": 24 }, "end": { - "line": 306, + "line": 317, "column": 25 } } @@ -71305,15 +73870,15 @@ "binop": null }, "value": "overrideOption", - "start": 12982, - "end": 12996, + "start": 13223, + "end": 13237, "loc": { "start": { - "line": 306, + "line": 317, "column": 26 }, "end": { - "line": 306, + "line": 317, "column": 40 } } @@ -71330,15 +73895,15 @@ "postfix": false, "binop": null }, - "start": 12996, - "end": 12997, + "start": 13237, + "end": 13238, "loc": { "start": { - "line": 306, + "line": 317, "column": 40 }, "end": { - "line": 306, + "line": 317, "column": 41 } } @@ -71356,15 +73921,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 12997, - "end": 13012, + "start": 13238, + "end": 13253, "loc": { "start": { - "line": 306, + "line": 317, "column": 41 }, "end": { - "line": 306, + "line": 317, "column": 56 } } @@ -71382,15 +73947,15 @@ "binop": null, "updateContext": null }, - "start": 13012, - "end": 13013, + "start": 13253, + "end": 13254, "loc": { "start": { - "line": 306, + "line": 317, "column": 56 }, "end": { - "line": 306, + "line": 317, "column": 57 } } @@ -71408,15 +73973,15 @@ "binop": null }, "value": "skip", - "start": 13013, - "end": 13017, + "start": 13254, + "end": 13258, "loc": { "start": { - "line": 306, + "line": 317, "column": 57 }, "end": { - "line": 306, + "line": 317, "column": 61 } } @@ -71434,15 +73999,15 @@ "binop": null, "updateContext": null }, - "start": 13017, - "end": 13018, + "start": 13258, + "end": 13259, "loc": { "start": { - "line": 306, + "line": 317, "column": 61 }, "end": { - "line": 306, + "line": 317, "column": 62 } } @@ -71461,15 +74026,15 @@ "updateContext": null }, "value": 1, - "start": 13019, - "end": 13020, + "start": 13260, + "end": 13261, "loc": { "start": { - "line": 306, + "line": 317, "column": 63 }, "end": { - "line": 306, + "line": 317, "column": 64 } } @@ -71486,15 +74051,15 @@ "postfix": false, "binop": null }, - "start": 13020, - "end": 13021, + "start": 13261, + "end": 13262, "loc": { "start": { - "line": 306, + "line": 317, "column": 64 }, "end": { - "line": 306, + "line": 317, "column": 65 } } @@ -71512,15 +74077,15 @@ "binop": null, "updateContext": null }, - "start": 13021, - "end": 13022, + "start": 13262, + "end": 13263, "loc": { "start": { - "line": 306, + "line": 317, "column": 65 }, "end": { - "line": 306, + "line": 317, "column": 66 } } @@ -71538,15 +74103,15 @@ "binop": null }, "value": "log", - "start": 13043, - "end": 13046, + "start": 13284, + "end": 13287, "loc": { "start": { - "line": 307, + "line": 318, "column": 20 }, "end": { - "line": 307, + "line": 318, "column": 23 } } @@ -71563,15 +74128,15 @@ "postfix": false, "binop": null }, - "start": 13063, - "end": 13064, + "start": 13304, + "end": 13305, "loc": { "start": { - "line": 308, + "line": 319, "column": 16 }, "end": { - "line": 308, + "line": 319, "column": 17 } } @@ -71588,15 +74153,15 @@ "postfix": false, "binop": null }, - "start": 13064, - "end": 13065, + "start": 13305, + "end": 13306, "loc": { "start": { - "line": 308, + "line": 319, "column": 17 }, "end": { - "line": 308, + "line": 319, "column": 18 } } @@ -71614,15 +74179,15 @@ "binop": null, "updateContext": null }, - "start": 13065, - "end": 13066, + "start": 13306, + "end": 13307, "loc": { "start": { - "line": 308, + "line": 319, "column": 18 }, "end": { - "line": 308, + "line": 319, "column": 19 } } @@ -71642,15 +74207,15 @@ "updateContext": null }, "value": "break", - "start": 13083, - "end": 13088, + "start": 13324, + "end": 13329, "loc": { "start": { - "line": 309, + "line": 320, "column": 16 }, "end": { - "line": 309, + "line": 320, "column": 21 } } @@ -71668,15 +74233,15 @@ "binop": null, "updateContext": null }, - "start": 13088, - "end": 13089, + "start": 13329, + "end": 13330, "loc": { "start": { - "line": 309, + "line": 320, "column": 21 }, "end": { - "line": 309, + "line": 320, "column": 22 } } @@ -71696,15 +74261,15 @@ "updateContext": null }, "value": "case", - "start": 13103, - "end": 13107, + "start": 13344, + "end": 13348, "loc": { "start": { - "line": 311, + "line": 322, "column": 12 }, "end": { - "line": 311, + "line": 322, "column": 16 } } @@ -71723,15 +74288,15 @@ "updateContext": null }, "value": "las", - "start": 13108, - "end": 13113, + "start": 13349, + "end": 13354, "loc": { "start": { - "line": 311, + "line": 322, "column": 17 }, "end": { - "line": 311, + "line": 322, "column": 22 } } @@ -71749,15 +74314,15 @@ "binop": null, "updateContext": null }, - "start": 13113, - "end": 13114, + "start": 13354, + "end": 13355, "loc": { "start": { - "line": 311, + "line": 322, "column": 22 }, "end": { - "line": 311, + "line": 322, "column": 23 } } @@ -71775,15 +74340,15 @@ "binop": null }, "value": "convert", - "start": 13131, - "end": 13138, + "start": 13372, + "end": 13379, "loc": { "start": { - "line": 312, + "line": 323, "column": 16 }, "end": { - "line": 312, + "line": 323, "column": 23 } } @@ -71800,15 +74365,15 @@ "postfix": false, "binop": null }, - "start": 13138, - "end": 13139, + "start": 13379, + "end": 13380, "loc": { "start": { - "line": 312, + "line": 323, "column": 23 }, "end": { - "line": 312, + "line": 323, "column": 24 } } @@ -71826,15 +74391,15 @@ "binop": null }, "value": "parseLASIntoXKTModel", - "start": 13139, - "end": 13159, + "start": 13380, + "end": 13400, "loc": { "start": { - "line": 312, + "line": 323, "column": 24 }, "end": { - "line": 312, + "line": 323, "column": 44 } } @@ -71852,15 +74417,15 @@ "binop": null, "updateContext": null }, - "start": 13159, - "end": 13160, + "start": 13400, + "end": 13401, "loc": { "start": { - "line": 312, + "line": 323, "column": 44 }, "end": { - "line": 312, + "line": 323, "column": 45 } } @@ -71877,15 +74442,15 @@ "postfix": false, "binop": null }, - "start": 13161, - "end": 13162, + "start": 13402, + "end": 13403, "loc": { "start": { - "line": 312, + "line": 323, "column": 46 }, "end": { - "line": 312, + "line": 323, "column": 47 } } @@ -71903,15 +74468,15 @@ "binop": null }, "value": "data", - "start": 13183, - "end": 13187, + "start": 13424, + "end": 13428, "loc": { "start": { - "line": 313, + "line": 324, "column": 20 }, "end": { - "line": 313, + "line": 324, "column": 24 } } @@ -71929,15 +74494,15 @@ "binop": null, "updateContext": null }, - "start": 13187, - "end": 13188, + "start": 13428, + "end": 13429, "loc": { "start": { - "line": 313, + "line": 324, "column": 24 }, "end": { - "line": 313, + "line": 324, "column": 25 } } @@ -71955,15 +74520,15 @@ "binop": null }, "value": "sourceData", - "start": 13189, - "end": 13199, + "start": 13430, + "end": 13440, "loc": { "start": { - "line": 313, + "line": 324, "column": 26 }, "end": { - "line": 313, + "line": 324, "column": 36 } } @@ -71981,15 +74546,15 @@ "binop": null, "updateContext": null }, - "start": 13199, - "end": 13200, + "start": 13440, + "end": 13441, "loc": { "start": { - "line": 313, + "line": 324, "column": 36 }, "end": { - "line": 313, + "line": 324, "column": 37 } } @@ -72007,15 +74572,15 @@ "binop": null }, "value": "xktModel", - "start": 13221, - "end": 13229, + "start": 13462, + "end": 13470, "loc": { "start": { - "line": 314, + "line": 325, "column": 20 }, "end": { - "line": 314, + "line": 325, "column": 28 } } @@ -72033,15 +74598,15 @@ "binop": null, "updateContext": null }, - "start": 13229, - "end": 13230, + "start": 13470, + "end": 13471, "loc": { "start": { - "line": 314, + "line": 325, "column": 28 }, "end": { - "line": 314, + "line": 325, "column": 29 } } @@ -72059,15 +74624,15 @@ "binop": null }, "value": "stats", - "start": 13251, - "end": 13256, + "start": 13492, + "end": 13497, "loc": { "start": { - "line": 315, + "line": 326, "column": 20 }, "end": { - "line": 315, + "line": 326, "column": 25 } } @@ -72085,15 +74650,15 @@ "binop": null, "updateContext": null }, - "start": 13256, - "end": 13257, + "start": 13497, + "end": 13498, "loc": { "start": { - "line": 315, + "line": 326, "column": 25 }, "end": { - "line": 315, + "line": 326, "column": 26 } } @@ -72111,15 +74676,15 @@ "binop": null }, "value": "fp64", - "start": 13278, - "end": 13282, + "start": 13519, + "end": 13523, "loc": { "start": { - "line": 316, + "line": 327, "column": 20 }, "end": { - "line": 316, + "line": 327, "column": 24 } } @@ -72137,15 +74702,15 @@ "binop": null, "updateContext": null }, - "start": 13282, - "end": 13283, + "start": 13523, + "end": 13524, "loc": { "start": { - "line": 316, + "line": 327, "column": 24 }, "end": { - "line": 316, + "line": 327, "column": 25 } } @@ -72163,15 +74728,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 13284, - "end": 13299, + "start": 13525, + "end": 13540, "loc": { "start": { - "line": 316, + "line": 327, "column": 26 }, "end": { - "line": 316, + "line": 327, "column": 41 } } @@ -72189,15 +74754,15 @@ "binop": null, "updateContext": null }, - "start": 13299, - "end": 13300, + "start": 13540, + "end": 13541, "loc": { "start": { - "line": 316, + "line": 327, "column": 41 }, "end": { - "line": 316, + "line": 327, "column": 42 } } @@ -72215,15 +74780,15 @@ "binop": null }, "value": "fp64", - "start": 13300, - "end": 13304, + "start": 13541, + "end": 13545, "loc": { "start": { - "line": 316, + "line": 327, "column": 42 }, "end": { - "line": 316, + "line": 327, "column": 46 } } @@ -72241,15 +74806,15 @@ "binop": null, "updateContext": null }, - "start": 13304, - "end": 13305, + "start": 13545, + "end": 13546, "loc": { "start": { - "line": 316, + "line": 327, "column": 46 }, "end": { - "line": 316, + "line": 327, "column": 47 } } @@ -72267,15 +74832,15 @@ "binop": null }, "value": "colorDepth", - "start": 13326, - "end": 13336, + "start": 13567, + "end": 13577, "loc": { "start": { - "line": 317, + "line": 328, "column": 20 }, "end": { - "line": 317, + "line": 328, "column": 30 } } @@ -72293,15 +74858,15 @@ "binop": null, "updateContext": null }, - "start": 13336, - "end": 13337, + "start": 13577, + "end": 13578, "loc": { "start": { - "line": 317, + "line": 328, "column": 30 }, "end": { - "line": 317, + "line": 328, "column": 31 } } @@ -72319,15 +74884,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 13338, - "end": 13353, + "start": 13579, + "end": 13594, "loc": { "start": { - "line": 317, + "line": 328, "column": 32 }, "end": { - "line": 317, + "line": 328, "column": 47 } } @@ -72345,15 +74910,15 @@ "binop": null, "updateContext": null }, - "start": 13353, - "end": 13354, + "start": 13594, + "end": 13595, "loc": { "start": { - "line": 317, + "line": 328, "column": 47 }, "end": { - "line": 317, + "line": 328, "column": 48 } } @@ -72371,15 +74936,15 @@ "binop": null }, "value": "colorDepth", - "start": 13354, - "end": 13364, + "start": 13595, + "end": 13605, "loc": { "start": { - "line": 317, + "line": 328, "column": 48 }, "end": { - "line": 317, + "line": 328, "column": 58 } } @@ -72397,15 +74962,15 @@ "binop": null, "updateContext": null }, - "start": 13364, - "end": 13365, + "start": 13605, + "end": 13606, "loc": { "start": { - "line": 317, + "line": 328, "column": 58 }, "end": { - "line": 317, + "line": 328, "column": 59 } } @@ -72423,15 +74988,15 @@ "binop": null }, "value": "center", - "start": 13386, - "end": 13392, + "start": 13627, + "end": 13633, "loc": { "start": { - "line": 318, + "line": 329, "column": 20 }, "end": { - "line": 318, + "line": 329, "column": 26 } } @@ -72449,15 +75014,15 @@ "binop": null, "updateContext": null }, - "start": 13392, - "end": 13393, + "start": 13633, + "end": 13634, "loc": { "start": { - "line": 318, + "line": 329, "column": 26 }, "end": { - "line": 318, + "line": 329, "column": 27 } } @@ -72475,15 +75040,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 13394, - "end": 13409, + "start": 13635, + "end": 13650, "loc": { "start": { - "line": 318, + "line": 329, "column": 28 }, "end": { - "line": 318, + "line": 329, "column": 43 } } @@ -72501,15 +75066,15 @@ "binop": null, "updateContext": null }, - "start": 13409, - "end": 13410, + "start": 13650, + "end": 13651, "loc": { "start": { - "line": 318, + "line": 329, "column": 43 }, "end": { - "line": 318, + "line": 329, "column": 44 } } @@ -72527,15 +75092,15 @@ "binop": null }, "value": "center", - "start": 13410, - "end": 13416, + "start": 13651, + "end": 13657, "loc": { "start": { - "line": 318, + "line": 329, "column": 44 }, "end": { - "line": 318, + "line": 329, "column": 50 } } @@ -72553,15 +75118,15 @@ "binop": null, "updateContext": null }, - "start": 13416, - "end": 13417, + "start": 13657, + "end": 13658, "loc": { "start": { - "line": 318, + "line": 329, "column": 50 }, "end": { - "line": 318, + "line": 329, "column": 51 } } @@ -72579,15 +75144,15 @@ "binop": null }, "value": "transform", - "start": 13438, - "end": 13447, + "start": 13679, + "end": 13688, "loc": { "start": { - "line": 319, + "line": 330, "column": 20 }, "end": { - "line": 319, + "line": 330, "column": 29 } } @@ -72605,15 +75170,15 @@ "binop": null, "updateContext": null }, - "start": 13447, - "end": 13448, + "start": 13688, + "end": 13689, "loc": { "start": { - "line": 319, + "line": 330, "column": 29 }, "end": { - "line": 319, + "line": 330, "column": 30 } } @@ -72631,15 +75196,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 13449, - "end": 13464, + "start": 13690, + "end": 13705, "loc": { "start": { - "line": 319, + "line": 330, "column": 31 }, "end": { - "line": 319, + "line": 330, "column": 46 } } @@ -72657,15 +75222,15 @@ "binop": null, "updateContext": null }, - "start": 13464, - "end": 13465, + "start": 13705, + "end": 13706, "loc": { "start": { - "line": 319, + "line": 330, "column": 46 }, "end": { - "line": 319, + "line": 330, "column": 47 } } @@ -72683,15 +75248,15 @@ "binop": null }, "value": "transform", - "start": 13465, - "end": 13474, + "start": 13706, + "end": 13715, "loc": { "start": { - "line": 319, + "line": 330, "column": 47 }, "end": { - "line": 319, + "line": 330, "column": 56 } } @@ -72709,15 +75274,15 @@ "binop": null, "updateContext": null }, - "start": 13474, - "end": 13475, + "start": 13715, + "end": 13716, "loc": { "start": { - "line": 319, + "line": 330, "column": 56 }, "end": { - "line": 319, + "line": 330, "column": 57 } } @@ -72735,15 +75300,15 @@ "binop": null }, "value": "skip", - "start": 13496, - "end": 13500, + "start": 13737, + "end": 13741, "loc": { "start": { - "line": 320, + "line": 331, "column": 20 }, "end": { - "line": 320, + "line": 331, "column": 24 } } @@ -72761,15 +75326,15 @@ "binop": null, "updateContext": null }, - "start": 13500, - "end": 13501, + "start": 13741, + "end": 13742, "loc": { "start": { - "line": 320, + "line": 331, "column": 24 }, "end": { - "line": 320, + "line": 331, "column": 25 } } @@ -72787,15 +75352,15 @@ "binop": null }, "value": "overrideOption", - "start": 13502, - "end": 13516, + "start": 13743, + "end": 13757, "loc": { "start": { - "line": 320, + "line": 331, "column": 26 }, "end": { - "line": 320, + "line": 331, "column": 40 } } @@ -72812,15 +75377,15 @@ "postfix": false, "binop": null }, - "start": 13516, - "end": 13517, + "start": 13757, + "end": 13758, "loc": { "start": { - "line": 320, + "line": 331, "column": 40 }, "end": { - "line": 320, + "line": 331, "column": 41 } } @@ -72838,15 +75403,15 @@ "binop": null }, "value": "fileTypeConfigs", - "start": 13517, - "end": 13532, + "start": 13758, + "end": 13773, "loc": { "start": { - "line": 320, + "line": 331, "column": 41 }, "end": { - "line": 320, + "line": 331, "column": 56 } } @@ -72864,15 +75429,15 @@ "binop": null, "updateContext": null }, - "start": 13532, - "end": 13533, + "start": 13773, + "end": 13774, "loc": { "start": { - "line": 320, + "line": 331, "column": 56 }, "end": { - "line": 320, + "line": 331, "column": 57 } } @@ -72890,15 +75455,15 @@ "binop": null }, "value": "skip", - "start": 13533, - "end": 13537, + "start": 13774, + "end": 13778, "loc": { "start": { - "line": 320, + "line": 331, "column": 57 }, "end": { - "line": 320, + "line": 331, "column": 61 } } @@ -72916,15 +75481,15 @@ "binop": null, "updateContext": null }, - "start": 13537, - "end": 13538, + "start": 13778, + "end": 13779, "loc": { "start": { - "line": 320, + "line": 331, "column": 61 }, "end": { - "line": 320, + "line": 331, "column": 62 } } @@ -72943,15 +75508,15 @@ "updateContext": null }, "value": 1, - "start": 13539, - "end": 13540, + "start": 13780, + "end": 13781, "loc": { "start": { - "line": 320, + "line": 331, "column": 63 }, "end": { - "line": 320, + "line": 331, "column": 64 } } @@ -72968,15 +75533,15 @@ "postfix": false, "binop": null }, - "start": 13540, - "end": 13541, + "start": 13781, + "end": 13782, "loc": { "start": { - "line": 320, + "line": 331, "column": 64 }, "end": { - "line": 320, + "line": 331, "column": 65 } } @@ -72994,15 +75559,15 @@ "binop": null, "updateContext": null }, - "start": 13541, - "end": 13542, + "start": 13782, + "end": 13783, "loc": { "start": { - "line": 320, + "line": 331, "column": 65 }, "end": { - "line": 320, + "line": 331, "column": 66 } } @@ -73020,15 +75585,15 @@ "binop": null }, "value": "log", - "start": 13563, - "end": 13566, + "start": 13804, + "end": 13807, "loc": { "start": { - "line": 321, + "line": 332, "column": 20 }, "end": { - "line": 321, + "line": 332, "column": 23 } } @@ -73045,15 +75610,15 @@ "postfix": false, "binop": null }, - "start": 13583, - "end": 13584, + "start": 13824, + "end": 13825, "loc": { "start": { - "line": 322, + "line": 333, "column": 16 }, "end": { - "line": 322, + "line": 333, "column": 17 } } @@ -73070,15 +75635,15 @@ "postfix": false, "binop": null }, - "start": 13584, - "end": 13585, + "start": 13825, + "end": 13826, "loc": { "start": { - "line": 322, + "line": 333, "column": 17 }, "end": { - "line": 322, + "line": 333, "column": 18 } } @@ -73096,15 +75661,15 @@ "binop": null, "updateContext": null }, - "start": 13585, - "end": 13586, + "start": 13826, + "end": 13827, "loc": { "start": { - "line": 322, + "line": 333, "column": 18 }, "end": { - "line": 322, + "line": 333, "column": 19 } } @@ -73124,15 +75689,15 @@ "updateContext": null }, "value": "break", - "start": 13603, - "end": 13608, + "start": 13844, + "end": 13849, "loc": { "start": { - "line": 323, + "line": 334, "column": 16 }, "end": { - "line": 323, + "line": 334, "column": 21 } } @@ -73150,15 +75715,15 @@ "binop": null, "updateContext": null }, - "start": 13608, - "end": 13609, + "start": 13849, + "end": 13850, "loc": { "start": { - "line": 323, + "line": 334, "column": 21 }, "end": { - "line": 323, + "line": 334, "column": 22 } } @@ -73178,15 +75743,15 @@ "updateContext": null }, "value": "case", - "start": 13623, - "end": 13627, + "start": 13864, + "end": 13868, "loc": { "start": { - "line": 325, + "line": 336, "column": 12 }, "end": { - "line": 325, + "line": 336, "column": 16 } } @@ -73205,15 +75770,15 @@ "updateContext": null }, "value": "pcd", - "start": 13628, - "end": 13633, + "start": 13869, + "end": 13874, "loc": { "start": { - "line": 325, + "line": 336, "column": 17 }, "end": { - "line": 325, + "line": 336, "column": 22 } } @@ -73231,15 +75796,15 @@ "binop": null, "updateContext": null }, - "start": 13633, - "end": 13634, + "start": 13874, + "end": 13875, "loc": { "start": { - "line": 325, + "line": 336, "column": 22 }, "end": { - "line": 325, + "line": 336, "column": 23 } } @@ -73257,15 +75822,15 @@ "binop": null }, "value": "convert", - "start": 13651, - "end": 13658, + "start": 13892, + "end": 13899, "loc": { "start": { - "line": 326, + "line": 337, "column": 16 }, "end": { - "line": 326, + "line": 337, "column": 23 } } @@ -73282,15 +75847,15 @@ "postfix": false, "binop": null }, - "start": 13658, - "end": 13659, + "start": 13899, + "end": 13900, "loc": { "start": { - "line": 326, + "line": 337, "column": 23 }, "end": { - "line": 326, + "line": 337, "column": 24 } } @@ -73308,15 +75873,15 @@ "binop": null }, "value": "parsePCDIntoXKTModel", - "start": 13659, - "end": 13679, + "start": 13900, + "end": 13920, "loc": { "start": { - "line": 326, + "line": 337, "column": 24 }, "end": { - "line": 326, + "line": 337, "column": 44 } } @@ -73334,15 +75899,15 @@ "binop": null, "updateContext": null }, - "start": 13679, - "end": 13680, + "start": 13920, + "end": 13921, "loc": { "start": { - "line": 326, + "line": 337, "column": 44 }, "end": { - "line": 326, + "line": 337, "column": 45 } } @@ -73359,15 +75924,15 @@ "postfix": false, "binop": null }, - "start": 13681, - "end": 13682, + "start": 13922, + "end": 13923, "loc": { "start": { - "line": 326, + "line": 337, "column": 46 }, "end": { - "line": 326, + "line": 337, "column": 47 } } @@ -73385,15 +75950,15 @@ "binop": null }, "value": "data", - "start": 13703, - "end": 13707, + "start": 13944, + "end": 13948, "loc": { "start": { - "line": 327, + "line": 338, "column": 20 }, "end": { - "line": 327, + "line": 338, "column": 24 } } @@ -73411,15 +75976,15 @@ "binop": null, "updateContext": null }, - "start": 13707, - "end": 13708, + "start": 13948, + "end": 13949, "loc": { "start": { - "line": 327, + "line": 338, "column": 24 }, "end": { - "line": 327, + "line": 338, "column": 25 } } @@ -73437,15 +76002,15 @@ "binop": null }, "value": "sourceData", - "start": 13709, - "end": 13719, + "start": 13950, + "end": 13960, "loc": { "start": { - "line": 327, + "line": 338, "column": 26 }, "end": { - "line": 327, + "line": 338, "column": 36 } } @@ -73463,15 +76028,15 @@ "binop": null, "updateContext": null }, - "start": 13719, - "end": 13720, + "start": 13960, + "end": 13961, "loc": { "start": { - "line": 327, + "line": 338, "column": 36 }, "end": { - "line": 327, + "line": 338, "column": 37 } } @@ -73489,15 +76054,15 @@ "binop": null }, "value": "xktModel", - "start": 13741, - "end": 13749, + "start": 13982, + "end": 13990, "loc": { "start": { - "line": 328, + "line": 339, "column": 20 }, "end": { - "line": 328, + "line": 339, "column": 28 } } @@ -73515,15 +76080,15 @@ "binop": null, "updateContext": null }, - "start": 13749, - "end": 13750, + "start": 13990, + "end": 13991, "loc": { "start": { - "line": 328, + "line": 339, "column": 28 }, "end": { - "line": 328, + "line": 339, "column": 29 } } @@ -73541,15 +76106,15 @@ "binop": null }, "value": "stats", - "start": 13771, - "end": 13776, + "start": 14012, + "end": 14017, "loc": { "start": { - "line": 329, + "line": 340, "column": 20 }, "end": { - "line": 329, + "line": 340, "column": 25 } } @@ -73567,15 +76132,15 @@ "binop": null, "updateContext": null }, - "start": 13776, - "end": 13777, + "start": 14017, + "end": 14018, "loc": { "start": { - "line": 329, + "line": 340, "column": 25 }, "end": { - "line": 329, + "line": 340, "column": 26 } } @@ -73593,15 +76158,15 @@ "binop": null }, "value": "log", - "start": 13798, - "end": 13801, + "start": 14039, + "end": 14042, "loc": { "start": { - "line": 330, + "line": 341, "column": 20 }, "end": { - "line": 330, + "line": 341, "column": 23 } } @@ -73618,15 +76183,15 @@ "postfix": false, "binop": null }, - "start": 13818, - "end": 13819, + "start": 14059, + "end": 14060, "loc": { "start": { - "line": 331, + "line": 342, "column": 16 }, "end": { - "line": 331, + "line": 342, "column": 17 } } @@ -73643,15 +76208,15 @@ "postfix": false, "binop": null }, - "start": 13819, - "end": 13820, + "start": 14060, + "end": 14061, "loc": { "start": { - "line": 331, + "line": 342, "column": 17 }, "end": { - "line": 331, + "line": 342, "column": 18 } } @@ -73669,15 +76234,15 @@ "binop": null, "updateContext": null }, - "start": 13820, - "end": 13821, + "start": 14061, + "end": 14062, "loc": { "start": { - "line": 331, + "line": 342, "column": 18 }, "end": { - "line": 331, + "line": 342, "column": 19 } } @@ -73697,15 +76262,15 @@ "updateContext": null }, "value": "break", - "start": 13838, - "end": 13843, + "start": 14079, + "end": 14084, "loc": { "start": { - "line": 332, + "line": 343, "column": 16 }, "end": { - "line": 332, + "line": 343, "column": 21 } } @@ -73723,15 +76288,15 @@ "binop": null, "updateContext": null }, - "start": 13843, - "end": 13844, + "start": 14084, + "end": 14085, "loc": { "start": { - "line": 332, + "line": 343, "column": 21 }, "end": { - "line": 332, + "line": 343, "column": 22 } } @@ -73751,15 +76316,15 @@ "updateContext": null }, "value": "case", - "start": 13858, - "end": 13862, + "start": 14099, + "end": 14103, "loc": { "start": { - "line": 334, + "line": 345, "column": 12 }, "end": { - "line": 334, + "line": 345, "column": 16 } } @@ -73778,15 +76343,15 @@ "updateContext": null }, "value": "ply", - "start": 13863, - "end": 13868, + "start": 14104, + "end": 14109, "loc": { "start": { - "line": 334, + "line": 345, "column": 17 }, "end": { - "line": 334, + "line": 345, "column": 22 } } @@ -73804,15 +76369,15 @@ "binop": null, "updateContext": null }, - "start": 13868, - "end": 13869, + "start": 14109, + "end": 14110, "loc": { "start": { - "line": 334, + "line": 345, "column": 22 }, "end": { - "line": 334, + "line": 345, "column": 23 } } @@ -73830,15 +76395,15 @@ "binop": null }, "value": "convert", - "start": 13886, - "end": 13893, + "start": 14127, + "end": 14134, "loc": { "start": { - "line": 335, + "line": 346, "column": 16 }, "end": { - "line": 335, + "line": 346, "column": 23 } } @@ -73855,15 +76420,15 @@ "postfix": false, "binop": null }, - "start": 13893, - "end": 13894, + "start": 14134, + "end": 14135, "loc": { "start": { - "line": 335, + "line": 346, "column": 23 }, "end": { - "line": 335, + "line": 346, "column": 24 } } @@ -73881,15 +76446,15 @@ "binop": null }, "value": "parsePLYIntoXKTModel", - "start": 13894, - "end": 13914, + "start": 14135, + "end": 14155, "loc": { "start": { - "line": 335, + "line": 346, "column": 24 }, "end": { - "line": 335, + "line": 346, "column": 44 } } @@ -73907,15 +76472,15 @@ "binop": null, "updateContext": null }, - "start": 13914, - "end": 13915, + "start": 14155, + "end": 14156, "loc": { "start": { - "line": 335, + "line": 346, "column": 44 }, "end": { - "line": 335, + "line": 346, "column": 45 } } @@ -73932,15 +76497,15 @@ "postfix": false, "binop": null }, - "start": 13916, - "end": 13917, + "start": 14157, + "end": 14158, "loc": { "start": { - "line": 335, + "line": 346, "column": 46 }, "end": { - "line": 335, + "line": 346, "column": 47 } } @@ -73958,15 +76523,15 @@ "binop": null }, "value": "data", - "start": 13938, - "end": 13942, + "start": 14179, + "end": 14183, "loc": { "start": { - "line": 336, + "line": 347, "column": 20 }, "end": { - "line": 336, + "line": 347, "column": 24 } } @@ -73984,15 +76549,15 @@ "binop": null, "updateContext": null }, - "start": 13942, - "end": 13943, + "start": 14183, + "end": 14184, "loc": { "start": { - "line": 336, + "line": 347, "column": 24 }, "end": { - "line": 336, + "line": 347, "column": 25 } } @@ -74010,15 +76575,15 @@ "binop": null }, "value": "sourceData", - "start": 13944, - "end": 13954, + "start": 14185, + "end": 14195, "loc": { "start": { - "line": 336, + "line": 347, "column": 26 }, "end": { - "line": 336, + "line": 347, "column": 36 } } @@ -74036,15 +76601,15 @@ "binop": null, "updateContext": null }, - "start": 13954, - "end": 13955, + "start": 14195, + "end": 14196, "loc": { "start": { - "line": 336, + "line": 347, "column": 36 }, "end": { - "line": 336, + "line": 347, "column": 37 } } @@ -74062,15 +76627,15 @@ "binop": null }, "value": "xktModel", - "start": 13976, - "end": 13984, + "start": 14217, + "end": 14225, "loc": { "start": { - "line": 337, + "line": 348, "column": 20 }, "end": { - "line": 337, + "line": 348, "column": 28 } } @@ -74088,15 +76653,15 @@ "binop": null, "updateContext": null }, - "start": 13984, - "end": 13985, + "start": 14225, + "end": 14226, "loc": { "start": { - "line": 337, + "line": 348, "column": 28 }, "end": { - "line": 337, + "line": 348, "column": 29 } } @@ -74114,15 +76679,15 @@ "binop": null }, "value": "stats", - "start": 14006, - "end": 14011, + "start": 14247, + "end": 14252, "loc": { "start": { - "line": 338, + "line": 349, "column": 20 }, "end": { - "line": 338, + "line": 349, "column": 25 } } @@ -74140,15 +76705,15 @@ "binop": null, "updateContext": null }, - "start": 14011, - "end": 14012, + "start": 14252, + "end": 14253, "loc": { "start": { - "line": 338, + "line": 349, "column": 25 }, "end": { - "line": 338, + "line": 349, "column": 26 } } @@ -74166,15 +76731,15 @@ "binop": null }, "value": "log", - "start": 14033, - "end": 14036, + "start": 14274, + "end": 14277, "loc": { "start": { - "line": 339, + "line": 350, "column": 20 }, "end": { - "line": 339, + "line": 350, "column": 23 } } @@ -74191,15 +76756,15 @@ "postfix": false, "binop": null }, - "start": 14053, - "end": 14054, + "start": 14294, + "end": 14295, "loc": { "start": { - "line": 340, + "line": 351, "column": 16 }, "end": { - "line": 340, + "line": 351, "column": 17 } } @@ -74216,15 +76781,15 @@ "postfix": false, "binop": null }, - "start": 14054, - "end": 14055, + "start": 14295, + "end": 14296, "loc": { "start": { - "line": 340, + "line": 351, "column": 17 }, "end": { - "line": 340, + "line": 351, "column": 18 } } @@ -74242,15 +76807,15 @@ "binop": null, "updateContext": null }, - "start": 14055, - "end": 14056, + "start": 14296, + "end": 14297, "loc": { "start": { - "line": 340, + "line": 351, "column": 18 }, "end": { - "line": 340, + "line": 351, "column": 19 } } @@ -74270,15 +76835,15 @@ "updateContext": null }, "value": "break", - "start": 14073, - "end": 14078, + "start": 14314, + "end": 14319, "loc": { "start": { - "line": 341, + "line": 352, "column": 16 }, "end": { - "line": 341, + "line": 352, "column": 21 } } @@ -74296,15 +76861,15 @@ "binop": null, "updateContext": null }, - "start": 14078, - "end": 14079, + "start": 14319, + "end": 14320, "loc": { "start": { - "line": 341, + "line": 352, "column": 21 }, "end": { - "line": 341, + "line": 352, "column": 22 } } @@ -74324,15 +76889,15 @@ "updateContext": null }, "value": "case", - "start": 14093, - "end": 14097, + "start": 14334, + "end": 14338, "loc": { "start": { - "line": 343, + "line": 354, "column": 12 }, "end": { - "line": 343, + "line": 354, "column": 16 } } @@ -74351,15 +76916,15 @@ "updateContext": null }, "value": "stl", - "start": 14098, - "end": 14103, + "start": 14339, + "end": 14344, "loc": { "start": { - "line": 343, + "line": 354, "column": 17 }, "end": { - "line": 343, + "line": 354, "column": 22 } } @@ -74377,15 +76942,15 @@ "binop": null, "updateContext": null }, - "start": 14103, - "end": 14104, + "start": 14344, + "end": 14345, "loc": { "start": { - "line": 343, + "line": 354, "column": 22 }, "end": { - "line": 343, + "line": 354, "column": 23 } } @@ -74403,15 +76968,15 @@ "binop": null }, "value": "convert", - "start": 14121, - "end": 14128, + "start": 14362, + "end": 14369, "loc": { "start": { - "line": 344, + "line": 355, "column": 16 }, "end": { - "line": 344, + "line": 355, "column": 23 } } @@ -74428,15 +76993,15 @@ "postfix": false, "binop": null }, - "start": 14128, - "end": 14129, + "start": 14369, + "end": 14370, "loc": { "start": { - "line": 344, + "line": 355, "column": 23 }, "end": { - "line": 344, + "line": 355, "column": 24 } } @@ -74454,15 +77019,15 @@ "binop": null }, "value": "parseSTLIntoXKTModel", - "start": 14129, - "end": 14149, + "start": 14370, + "end": 14390, "loc": { "start": { - "line": 344, + "line": 355, "column": 24 }, "end": { - "line": 344, + "line": 355, "column": 44 } } @@ -74480,15 +77045,15 @@ "binop": null, "updateContext": null }, - "start": 14149, - "end": 14150, + "start": 14390, + "end": 14391, "loc": { "start": { - "line": 344, + "line": 355, "column": 44 }, "end": { - "line": 344, + "line": 355, "column": 45 } } @@ -74505,15 +77070,15 @@ "postfix": false, "binop": null }, - "start": 14151, - "end": 14152, + "start": 14392, + "end": 14393, "loc": { "start": { - "line": 344, + "line": 355, "column": 46 }, "end": { - "line": 344, + "line": 355, "column": 47 } } @@ -74531,15 +77096,15 @@ "binop": null }, "value": "data", - "start": 14173, - "end": 14177, + "start": 14414, + "end": 14418, "loc": { "start": { - "line": 345, + "line": 356, "column": 20 }, "end": { - "line": 345, + "line": 356, "column": 24 } } @@ -74557,15 +77122,15 @@ "binop": null, "updateContext": null }, - "start": 14177, - "end": 14178, + "start": 14418, + "end": 14419, "loc": { "start": { - "line": 345, + "line": 356, "column": 24 }, "end": { - "line": 345, + "line": 356, "column": 25 } } @@ -74583,15 +77148,15 @@ "binop": null }, "value": "sourceData", - "start": 14179, - "end": 14189, + "start": 14420, + "end": 14430, "loc": { "start": { - "line": 345, + "line": 356, "column": 26 }, "end": { - "line": 345, + "line": 356, "column": 36 } } @@ -74609,15 +77174,15 @@ "binop": null, "updateContext": null }, - "start": 14189, - "end": 14190, + "start": 14430, + "end": 14431, "loc": { "start": { - "line": 345, + "line": 356, "column": 36 }, "end": { - "line": 345, + "line": 356, "column": 37 } } @@ -74635,15 +77200,15 @@ "binop": null }, "value": "xktModel", - "start": 14211, - "end": 14219, + "start": 14452, + "end": 14460, "loc": { "start": { - "line": 346, + "line": 357, "column": 20 }, "end": { - "line": 346, + "line": 357, "column": 28 } } @@ -74661,15 +77226,15 @@ "binop": null, "updateContext": null }, - "start": 14219, - "end": 14220, + "start": 14460, + "end": 14461, "loc": { "start": { - "line": 346, + "line": 357, "column": 28 }, "end": { - "line": 346, + "line": 357, "column": 29 } } @@ -74687,15 +77252,15 @@ "binop": null }, "value": "stats", - "start": 14241, - "end": 14246, + "start": 14482, + "end": 14487, "loc": { "start": { - "line": 347, + "line": 358, "column": 20 }, "end": { - "line": 347, + "line": 358, "column": 25 } } @@ -74713,15 +77278,15 @@ "binop": null, "updateContext": null }, - "start": 14246, - "end": 14247, + "start": 14487, + "end": 14488, "loc": { "start": { - "line": 347, + "line": 358, "column": 25 }, "end": { - "line": 347, + "line": 358, "column": 26 } } @@ -74739,15 +77304,15 @@ "binop": null }, "value": "log", - "start": 14268, - "end": 14271, + "start": 14509, + "end": 14512, "loc": { "start": { - "line": 348, + "line": 359, "column": 20 }, "end": { - "line": 348, + "line": 359, "column": 23 } } @@ -74764,15 +77329,15 @@ "postfix": false, "binop": null }, - "start": 14288, - "end": 14289, + "start": 14529, + "end": 14530, "loc": { "start": { - "line": 349, + "line": 360, "column": 16 }, "end": { - "line": 349, + "line": 360, "column": 17 } } @@ -74789,15 +77354,15 @@ "postfix": false, "binop": null }, - "start": 14289, - "end": 14290, + "start": 14530, + "end": 14531, "loc": { "start": { - "line": 349, + "line": 360, "column": 17 }, "end": { - "line": 349, + "line": 360, "column": 18 } } @@ -74815,15 +77380,15 @@ "binop": null, "updateContext": null }, - "start": 14290, - "end": 14291, + "start": 14531, + "end": 14532, "loc": { "start": { - "line": 349, + "line": 360, "column": 18 }, "end": { - "line": 349, + "line": 360, "column": 19 } } @@ -74843,15 +77408,15 @@ "updateContext": null }, "value": "break", - "start": 14308, - "end": 14313, + "start": 14549, + "end": 14554, "loc": { "start": { - "line": 350, + "line": 361, "column": 16 }, "end": { - "line": 350, + "line": 361, "column": 21 } } @@ -74869,15 +77434,15 @@ "binop": null, "updateContext": null }, - "start": 14313, - "end": 14314, + "start": 14554, + "end": 14555, "loc": { "start": { - "line": 350, + "line": 361, "column": 21 }, "end": { - "line": 350, + "line": 361, "column": 22 } } @@ -74897,15 +77462,15 @@ "updateContext": null }, "value": "default", - "start": 14328, - "end": 14335, + "start": 14569, + "end": 14576, "loc": { "start": { - "line": 352, + "line": 363, "column": 12 }, "end": { - "line": 352, + "line": 363, "column": 19 } } @@ -74923,15 +77488,15 @@ "binop": null, "updateContext": null }, - "start": 14335, - "end": 14336, + "start": 14576, + "end": 14577, "loc": { "start": { - "line": 352, + "line": 363, "column": 19 }, "end": { - "line": 352, + "line": 363, "column": 20 } } @@ -74949,15 +77514,15 @@ "binop": null }, "value": "reject", - "start": 14353, - "end": 14359, + "start": 14594, + "end": 14600, "loc": { "start": { - "line": 353, + "line": 364, "column": 16 }, "end": { - "line": 353, + "line": 364, "column": 22 } } @@ -74974,15 +77539,15 @@ "postfix": false, "binop": null }, - "start": 14359, - "end": 14360, + "start": 14600, + "end": 14601, "loc": { "start": { - "line": 353, + "line": 364, "column": 22 }, "end": { - "line": 353, + "line": 364, "column": 23 } } @@ -74999,15 +77564,15 @@ "postfix": false, "binop": null }, - "start": 14360, - "end": 14361, + "start": 14601, + "end": 14602, "loc": { "start": { - "line": 353, + "line": 364, "column": 23 }, "end": { - "line": 353, + "line": 364, "column": 24 } } @@ -75026,15 +77591,15 @@ "updateContext": null }, "value": "Error: unsupported source format: \"", - "start": 14361, - "end": 14396, + "start": 14602, + "end": 14637, "loc": { "start": { - "line": 353, + "line": 364, "column": 24 }, "end": { - "line": 353, + "line": 364, "column": 59 } } @@ -75051,15 +77616,15 @@ "postfix": false, "binop": null }, - "start": 14396, - "end": 14398, + "start": 14637, + "end": 14639, "loc": { "start": { - "line": 353, + "line": 364, "column": 59 }, "end": { - "line": 353, + "line": 364, "column": 61 } } @@ -75077,15 +77642,15 @@ "binop": null }, "value": "ext", - "start": 14398, - "end": 14401, + "start": 14639, + "end": 14642, "loc": { "start": { - "line": 353, + "line": 364, "column": 61 }, "end": { - "line": 353, + "line": 364, "column": 64 } } @@ -75102,15 +77667,15 @@ "postfix": false, "binop": null }, - "start": 14401, - "end": 14402, + "start": 14642, + "end": 14643, "loc": { "start": { - "line": 353, + "line": 364, "column": 64 }, "end": { - "line": 353, + "line": 364, "column": 65 } } @@ -75129,15 +77694,15 @@ "updateContext": null }, "value": "\".", - "start": 14402, - "end": 14404, + "start": 14643, + "end": 14645, "loc": { "start": { - "line": 353, + "line": 364, "column": 65 }, "end": { - "line": 353, + "line": 364, "column": 67 } } @@ -75154,15 +77719,15 @@ "postfix": false, "binop": null }, - "start": 14404, - "end": 14405, + "start": 14645, + "end": 14646, "loc": { "start": { - "line": 353, + "line": 364, "column": 67 }, "end": { - "line": 353, + "line": 364, "column": 68 } } @@ -75179,15 +77744,15 @@ "postfix": false, "binop": null }, - "start": 14405, - "end": 14406, + "start": 14646, + "end": 14647, "loc": { "start": { - "line": 353, + "line": 364, "column": 68 }, "end": { - "line": 353, + "line": 364, "column": 69 } } @@ -75205,15 +77770,15 @@ "binop": null, "updateContext": null }, - "start": 14406, - "end": 14407, + "start": 14647, + "end": 14648, "loc": { "start": { - "line": 353, + "line": 364, "column": 69 }, "end": { - "line": 353, + "line": 364, "column": 70 } } @@ -75233,15 +77798,15 @@ "updateContext": null }, "value": "return", - "start": 14424, - "end": 14430, + "start": 14665, + "end": 14671, "loc": { "start": { - "line": 354, + "line": 365, "column": 16 }, "end": { - "line": 354, + "line": 365, "column": 22 } } @@ -75259,15 +77824,15 @@ "binop": null, "updateContext": null }, - "start": 14430, - "end": 14431, + "start": 14671, + "end": 14672, "loc": { "start": { - "line": 354, + "line": 365, "column": 22 }, "end": { - "line": 354, + "line": 365, "column": 23 } } @@ -75284,15 +77849,15 @@ "postfix": false, "binop": null }, - "start": 14440, - "end": 14441, + "start": 14681, + "end": 14682, "loc": { "start": { - "line": 355, + "line": 366, "column": 8 }, "end": { - "line": 355, + "line": 366, "column": 9 } } @@ -75311,15 +77876,15 @@ "binop": null }, "value": "function", - "start": 14451, - "end": 14459, + "start": 14692, + "end": 14700, "loc": { "start": { - "line": 357, + "line": 368, "column": 8 }, "end": { - "line": 357, + "line": 368, "column": 16 } } @@ -75337,15 +77902,15 @@ "binop": null }, "value": "convert", - "start": 14460, - "end": 14467, + "start": 14701, + "end": 14708, "loc": { "start": { - "line": 357, + "line": 368, "column": 17 }, "end": { - "line": 357, + "line": 368, "column": 24 } } @@ -75362,15 +77927,15 @@ "postfix": false, "binop": null }, - "start": 14467, - "end": 14468, + "start": 14708, + "end": 14709, "loc": { "start": { - "line": 357, + "line": 368, "column": 24 }, "end": { - "line": 357, + "line": 368, "column": 25 } } @@ -75388,15 +77953,15 @@ "binop": null }, "value": "parser", - "start": 14468, - "end": 14474, + "start": 14709, + "end": 14715, "loc": { "start": { - "line": 357, + "line": 368, "column": 25 }, "end": { - "line": 357, + "line": 368, "column": 31 } } @@ -75414,15 +77979,15 @@ "binop": null, "updateContext": null }, - "start": 14474, - "end": 14475, + "start": 14715, + "end": 14716, "loc": { "start": { - "line": 357, + "line": 368, "column": 31 }, "end": { - "line": 357, + "line": 368, "column": 32 } } @@ -75440,15 +78005,15 @@ "binop": null }, "value": "converterParams", - "start": 14476, - "end": 14491, + "start": 14717, + "end": 14732, "loc": { "start": { - "line": 357, + "line": 368, "column": 33 }, "end": { - "line": 357, + "line": 368, "column": 48 } } @@ -75465,15 +78030,15 @@ "postfix": false, "binop": null }, - "start": 14491, - "end": 14492, + "start": 14732, + "end": 14733, "loc": { "start": { - "line": 357, + "line": 368, "column": 48 }, "end": { - "line": 357, + "line": 368, "column": 49 } } @@ -75490,15 +78055,15 @@ "postfix": false, "binop": null }, - "start": 14493, - "end": 14494, + "start": 14734, + "end": 14735, "loc": { "start": { - "line": 357, + "line": 368, "column": 50 }, "end": { - "line": 357, + "line": 368, "column": 51 } } @@ -75516,15 +78081,15 @@ "binop": null }, "value": "parser", - "start": 14508, - "end": 14514, + "start": 14749, + "end": 14755, "loc": { "start": { - "line": 359, + "line": 370, "column": 12 }, "end": { - "line": 359, + "line": 370, "column": 18 } } @@ -75541,15 +78106,15 @@ "postfix": false, "binop": null }, - "start": 14514, - "end": 14515, + "start": 14755, + "end": 14756, "loc": { "start": { - "line": 359, + "line": 370, "column": 18 }, "end": { - "line": 359, + "line": 370, "column": 19 } } @@ -75567,15 +78132,15 @@ "binop": null }, "value": "converterParams", - "start": 14515, - "end": 14530, + "start": 14756, + "end": 14771, "loc": { "start": { - "line": 359, + "line": 370, "column": 19 }, "end": { - "line": 359, + "line": 370, "column": 34 } } @@ -75592,15 +78157,15 @@ "postfix": false, "binop": null }, - "start": 14530, - "end": 14531, + "start": 14771, + "end": 14772, "loc": { "start": { - "line": 359, + "line": 370, "column": 34 }, "end": { - "line": 359, + "line": 370, "column": 35 } } @@ -75618,15 +78183,15 @@ "binop": null, "updateContext": null }, - "start": 14531, - "end": 14532, + "start": 14772, + "end": 14773, "loc": { "start": { - "line": 359, + "line": 370, "column": 35 }, "end": { - "line": 359, + "line": 370, "column": 36 } } @@ -75644,15 +78209,15 @@ "binop": null }, "value": "then", - "start": 14532, - "end": 14536, + "start": 14773, + "end": 14777, "loc": { "start": { - "line": 359, + "line": 370, "column": 36 }, "end": { - "line": 359, + "line": 370, "column": 40 } } @@ -75669,15 +78234,15 @@ "postfix": false, "binop": null }, - "start": 14536, - "end": 14537, + "start": 14777, + "end": 14778, "loc": { "start": { - "line": 359, + "line": 370, "column": 40 }, "end": { - "line": 359, + "line": 370, "column": 41 } } @@ -75694,15 +78259,15 @@ "postfix": false, "binop": null }, - "start": 14537, - "end": 14538, + "start": 14778, + "end": 14779, "loc": { "start": { - "line": 359, + "line": 370, "column": 41 }, "end": { - "line": 359, + "line": 370, "column": 42 } } @@ -75719,15 +78284,15 @@ "postfix": false, "binop": null }, - "start": 14538, - "end": 14539, + "start": 14779, + "end": 14780, "loc": { "start": { - "line": 359, + "line": 370, "column": 42 }, "end": { - "line": 359, + "line": 370, "column": 43 } } @@ -75745,15 +78310,15 @@ "binop": null, "updateContext": null }, - "start": 14540, - "end": 14542, + "start": 14781, + "end": 14783, "loc": { "start": { - "line": 359, + "line": 370, "column": 44 }, "end": { - "line": 359, + "line": 370, "column": 46 } } @@ -75770,15 +78335,15 @@ "postfix": false, "binop": null }, - "start": 14543, - "end": 14544, + "start": 14784, + "end": 14785, "loc": { "start": { - "line": 359, + "line": 370, "column": 47 }, "end": { - "line": 359, + "line": 370, "column": 48 } } @@ -75798,15 +78363,15 @@ "updateContext": null }, "value": "if", - "start": 14562, - "end": 14564, + "start": 14803, + "end": 14805, "loc": { "start": { - "line": 361, + "line": 372, "column": 16 }, "end": { - "line": 361, + "line": 372, "column": 18 } } @@ -75823,15 +78388,15 @@ "postfix": false, "binop": null }, - "start": 14565, - "end": 14566, + "start": 14806, + "end": 14807, "loc": { "start": { - "line": 361, + "line": 372, "column": 19 }, "end": { - "line": 361, + "line": 372, "column": 20 } } @@ -75850,15 +78415,15 @@ "updateContext": null }, "value": "!", - "start": 14566, - "end": 14567, + "start": 14807, + "end": 14808, "loc": { "start": { - "line": 361, + "line": 372, "column": 20 }, "end": { - "line": 361, + "line": 372, "column": 21 } } @@ -75876,15 +78441,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 14567, - "end": 14580, + "start": 14808, + "end": 14821, "loc": { "start": { - "line": 361, + "line": 372, "column": 21 }, "end": { - "line": 361, + "line": 372, "column": 34 } } @@ -75901,15 +78466,15 @@ "postfix": false, "binop": null }, - "start": 14580, - "end": 14581, + "start": 14821, + "end": 14822, "loc": { "start": { - "line": 361, + "line": 372, "column": 34 }, "end": { - "line": 361, + "line": 372, "column": 35 } } @@ -75926,15 +78491,15 @@ "postfix": false, "binop": null }, - "start": 14582, - "end": 14583, + "start": 14823, + "end": 14824, "loc": { "start": { - "line": 361, + "line": 372, "column": 36 }, "end": { - "line": 361, + "line": 372, "column": 37 } } @@ -75952,15 +78517,15 @@ "binop": null }, "value": "log", - "start": 14604, - "end": 14607, + "start": 14845, + "end": 14848, "loc": { "start": { - "line": 362, + "line": 373, "column": 20 }, "end": { - "line": 362, + "line": 373, "column": 23 } } @@ -75977,15 +78542,15 @@ "postfix": false, "binop": null }, - "start": 14607, - "end": 14608, + "start": 14848, + "end": 14849, "loc": { "start": { - "line": 362, + "line": 373, "column": 23 }, "end": { - "line": 362, + "line": 373, "column": 24 } } @@ -76004,15 +78569,15 @@ "updateContext": null }, "value": "Creating default metamodel in XKT", - "start": 14608, - "end": 14643, + "start": 14849, + "end": 14884, "loc": { "start": { - "line": 362, + "line": 373, "column": 24 }, "end": { - "line": 362, + "line": 373, "column": 59 } } @@ -76029,15 +78594,15 @@ "postfix": false, "binop": null }, - "start": 14643, - "end": 14644, + "start": 14884, + "end": 14885, "loc": { "start": { - "line": 362, + "line": 373, "column": 59 }, "end": { - "line": 362, + "line": 373, "column": 60 } } @@ -76055,15 +78620,15 @@ "binop": null, "updateContext": null }, - "start": 14644, - "end": 14645, + "start": 14885, + "end": 14886, "loc": { "start": { - "line": 362, + "line": 373, "column": 60 }, "end": { - "line": 362, + "line": 373, "column": 61 } } @@ -76081,15 +78646,15 @@ "binop": null }, "value": "xktModel", - "start": 14666, - "end": 14674, + "start": 14907, + "end": 14915, "loc": { "start": { - "line": 363, + "line": 374, "column": 20 }, "end": { - "line": 363, + "line": 374, "column": 28 } } @@ -76107,15 +78672,15 @@ "binop": null, "updateContext": null }, - "start": 14674, - "end": 14675, + "start": 14915, + "end": 14916, "loc": { "start": { - "line": 363, + "line": 374, "column": 28 }, "end": { - "line": 363, + "line": 374, "column": 29 } } @@ -76133,15 +78698,15 @@ "binop": null }, "value": "createDefaultMetaObjects", - "start": 14675, - "end": 14699, + "start": 14916, + "end": 14940, "loc": { "start": { - "line": 363, + "line": 374, "column": 29 }, "end": { - "line": 363, + "line": 374, "column": 53 } } @@ -76158,15 +78723,15 @@ "postfix": false, "binop": null }, - "start": 14699, - "end": 14700, + "start": 14940, + "end": 14941, "loc": { "start": { - "line": 363, + "line": 374, "column": 53 }, "end": { - "line": 363, + "line": 374, "column": 54 } } @@ -76183,15 +78748,15 @@ "postfix": false, "binop": null }, - "start": 14700, - "end": 14701, + "start": 14941, + "end": 14942, "loc": { "start": { - "line": 363, + "line": 374, "column": 54 }, "end": { - "line": 363, + "line": 374, "column": 55 } } @@ -76209,15 +78774,15 @@ "binop": null, "updateContext": null }, - "start": 14701, - "end": 14702, + "start": 14942, + "end": 14943, "loc": { "start": { - "line": 363, + "line": 374, "column": 55 }, "end": { - "line": 363, + "line": 374, "column": 56 } } @@ -76234,15 +78799,15 @@ "postfix": false, "binop": null }, - "start": 14719, - "end": 14720, + "start": 14960, + "end": 14961, "loc": { "start": { - "line": 364, + "line": 375, "column": 16 }, "end": { - "line": 364, + "line": 375, "column": 17 } } @@ -76260,15 +78825,15 @@ "binop": null }, "value": "log", - "start": 14738, - "end": 14741, + "start": 14979, + "end": 14982, "loc": { "start": { - "line": 366, + "line": 377, "column": 16 }, "end": { - "line": 366, + "line": 377, "column": 19 } } @@ -76285,15 +78850,15 @@ "postfix": false, "binop": null }, - "start": 14741, - "end": 14742, + "start": 14982, + "end": 14983, "loc": { "start": { - "line": 366, + "line": 377, "column": 19 }, "end": { - "line": 366, + "line": 377, "column": 20 } } @@ -76312,15 +78877,15 @@ "updateContext": null }, "value": "Input file parsed OK. Building XKT document...", - "start": 14742, - "end": 14790, + "start": 14983, + "end": 15031, "loc": { "start": { - "line": 366, + "line": 377, "column": 20 }, "end": { - "line": 366, + "line": 377, "column": 68 } } @@ -76337,15 +78902,15 @@ "postfix": false, "binop": null }, - "start": 14790, - "end": 14791, + "start": 15031, + "end": 15032, "loc": { "start": { - "line": 366, + "line": 377, "column": 68 }, "end": { - "line": 366, + "line": 377, "column": 69 } } @@ -76363,15 +78928,15 @@ "binop": null, "updateContext": null }, - "start": 14791, - "end": 14792, + "start": 15032, + "end": 15033, "loc": { "start": { - "line": 366, + "line": 377, "column": 69 }, "end": { - "line": 366, + "line": 377, "column": 70 } } @@ -76389,15 +78954,15 @@ "binop": null }, "value": "xktModel", - "start": 14810, - "end": 14818, + "start": 15051, + "end": 15059, "loc": { "start": { - "line": 368, + "line": 379, "column": 16 }, "end": { - "line": 368, + "line": 379, "column": 24 } } @@ -76415,15 +78980,15 @@ "binop": null, "updateContext": null }, - "start": 14818, - "end": 14819, + "start": 15059, + "end": 15060, "loc": { "start": { - "line": 368, + "line": 379, "column": 24 }, "end": { - "line": 368, + "line": 379, "column": 25 } } @@ -76441,15 +79006,15 @@ "binop": null }, "value": "finalize", - "start": 14819, - "end": 14827, + "start": 15060, + "end": 15068, "loc": { "start": { - "line": 368, + "line": 379, "column": 25 }, "end": { - "line": 368, + "line": 379, "column": 33 } } @@ -76466,15 +79031,15 @@ "postfix": false, "binop": null }, - "start": 14827, - "end": 14828, + "start": 15068, + "end": 15069, "loc": { "start": { - "line": 368, + "line": 379, "column": 33 }, "end": { - "line": 368, + "line": 379, "column": 34 } } @@ -76491,15 +79056,15 @@ "postfix": false, "binop": null }, - "start": 14828, - "end": 14829, + "start": 15069, + "end": 15070, "loc": { "start": { - "line": 368, + "line": 379, "column": 34 }, "end": { - "line": 368, + "line": 379, "column": 35 } } @@ -76517,15 +79082,15 @@ "binop": null, "updateContext": null }, - "start": 14829, - "end": 14830, + "start": 15070, + "end": 15071, "loc": { "start": { - "line": 368, + "line": 379, "column": 35 }, "end": { - "line": 368, + "line": 379, "column": 36 } } @@ -76543,15 +79108,15 @@ "binop": null }, "value": "then", - "start": 14830, - "end": 14834, + "start": 15071, + "end": 15075, "loc": { "start": { - "line": 368, + "line": 379, "column": 36 }, "end": { - "line": 368, + "line": 379, "column": 40 } } @@ -76568,15 +79133,15 @@ "postfix": false, "binop": null }, - "start": 14834, - "end": 14835, + "start": 15075, + "end": 15076, "loc": { "start": { - "line": 368, + "line": 379, "column": 40 }, "end": { - "line": 368, + "line": 379, "column": 41 } } @@ -76593,15 +79158,15 @@ "postfix": false, "binop": null }, - "start": 14835, - "end": 14836, + "start": 15076, + "end": 15077, "loc": { "start": { - "line": 368, + "line": 379, "column": 41 }, "end": { - "line": 368, + "line": 379, "column": 42 } } @@ -76618,15 +79183,15 @@ "postfix": false, "binop": null }, - "start": 14836, - "end": 14837, + "start": 15077, + "end": 15078, "loc": { "start": { - "line": 368, + "line": 379, "column": 42 }, "end": { - "line": 368, + "line": 379, "column": 43 } } @@ -76644,15 +79209,15 @@ "binop": null, "updateContext": null }, - "start": 14838, - "end": 14840, + "start": 15079, + "end": 15081, "loc": { "start": { - "line": 368, + "line": 379, "column": 44 }, "end": { - "line": 368, + "line": 379, "column": 46 } } @@ -76669,15 +79234,15 @@ "postfix": false, "binop": null }, - "start": 14841, - "end": 14842, + "start": 15082, + "end": 15083, "loc": { "start": { - "line": 368, + "line": 379, "column": 47 }, "end": { - "line": 368, + "line": 379, "column": 48 } } @@ -76695,15 +79260,15 @@ "binop": null }, "value": "log", - "start": 14864, - "end": 14867, + "start": 15105, + "end": 15108, "loc": { "start": { - "line": 370, + "line": 381, "column": 20 }, "end": { - "line": 370, + "line": 381, "column": 23 } } @@ -76720,15 +79285,15 @@ "postfix": false, "binop": null }, - "start": 14867, - "end": 14868, + "start": 15108, + "end": 15109, "loc": { "start": { - "line": 370, + "line": 381, "column": 23 }, "end": { - "line": 370, + "line": 381, "column": 24 } } @@ -76747,15 +79312,15 @@ "updateContext": null }, "value": "XKT document built OK. Writing to XKT file...", - "start": 14868, - "end": 14915, + "start": 15109, + "end": 15156, "loc": { "start": { - "line": 370, + "line": 381, "column": 24 }, "end": { - "line": 370, + "line": 381, "column": 71 } } @@ -76772,15 +79337,15 @@ "postfix": false, "binop": null }, - "start": 14915, - "end": 14916, + "start": 15156, + "end": 15157, "loc": { "start": { - "line": 370, + "line": 381, "column": 71 }, "end": { - "line": 370, + "line": 381, "column": 72 } } @@ -76798,15 +79363,15 @@ "binop": null, "updateContext": null }, - "start": 14916, - "end": 14917, + "start": 15157, + "end": 15158, "loc": { "start": { - "line": 370, + "line": 381, "column": 72 }, "end": { - "line": 370, + "line": 381, "column": 73 } } @@ -76826,15 +79391,15 @@ "updateContext": null }, "value": "const", - "start": 14939, - "end": 14944, + "start": 15180, + "end": 15185, "loc": { "start": { - "line": 372, + "line": 383, "column": 20 }, "end": { - "line": 372, + "line": 383, "column": 25 } } @@ -76852,15 +79417,15 @@ "binop": null }, "value": "xktArrayBuffer", - "start": 14945, - "end": 14959, + "start": 15186, + "end": 15200, "loc": { "start": { - "line": 372, + "line": 383, "column": 26 }, "end": { - "line": 372, + "line": 383, "column": 40 } } @@ -76879,15 +79444,15 @@ "updateContext": null }, "value": "=", - "start": 14960, - "end": 14961, + "start": 15201, + "end": 15202, "loc": { "start": { - "line": 372, + "line": 383, "column": 41 }, "end": { - "line": 372, + "line": 383, "column": 42 } } @@ -76905,15 +79470,15 @@ "binop": null }, "value": "writeXKTModelToArrayBuffer", - "start": 14962, - "end": 14988, + "start": 15203, + "end": 15229, "loc": { "start": { - "line": 372, + "line": 383, "column": 43 }, "end": { - "line": 372, + "line": 383, "column": 69 } } @@ -76930,15 +79495,15 @@ "postfix": false, "binop": null }, - "start": 14988, - "end": 14989, + "start": 15229, + "end": 15230, "loc": { "start": { - "line": 372, + "line": 383, "column": 69 }, "end": { - "line": 372, + "line": 383, "column": 70 } } @@ -76956,15 +79521,15 @@ "binop": null }, "value": "xktModel", - "start": 14989, - "end": 14997, + "start": 15230, + "end": 15238, "loc": { "start": { - "line": 372, + "line": 383, "column": 70 }, "end": { - "line": 372, + "line": 383, "column": 78 } } @@ -76982,15 +79547,15 @@ "binop": null, "updateContext": null }, - "start": 14997, - "end": 14998, + "start": 15238, + "end": 15239, "loc": { "start": { - "line": 372, + "line": 383, "column": 78 }, "end": { - "line": 372, + "line": 383, "column": 79 } } @@ -77008,15 +79573,15 @@ "binop": null }, "value": "metaModelJSON", - "start": 14999, - "end": 15012, + "start": 15240, + "end": 15253, "loc": { "start": { - "line": 372, + "line": 383, "column": 80 }, "end": { - "line": 372, + "line": 383, "column": 93 } } @@ -77034,15 +79599,15 @@ "binop": null, "updateContext": null }, - "start": 15012, - "end": 15013, + "start": 15253, + "end": 15254, "loc": { "start": { - "line": 372, + "line": 383, "column": 93 }, "end": { - "line": 372, + "line": 383, "column": 94 } } @@ -77060,15 +79625,15 @@ "binop": null }, "value": "stats", - "start": 15014, - "end": 15019, + "start": 15255, + "end": 15260, "loc": { "start": { - "line": 372, + "line": 383, "column": 95 }, "end": { - "line": 372, + "line": 383, "column": 100 } } @@ -77086,15 +79651,15 @@ "binop": null, "updateContext": null }, - "start": 15019, - "end": 15020, + "start": 15260, + "end": 15261, "loc": { "start": { - "line": 372, + "line": 383, "column": 100 }, "end": { - "line": 372, + "line": 383, "column": 101 } } @@ -77111,15 +79676,15 @@ "postfix": false, "binop": null }, - "start": 15021, - "end": 15022, + "start": 15262, + "end": 15263, "loc": { "start": { - "line": 372, + "line": 383, "column": 102 }, "end": { - "line": 372, + "line": 383, "column": 103 } } @@ -77137,15 +79702,15 @@ "binop": null }, "value": "zip", - "start": 15022, - "end": 15025, + "start": 15263, + "end": 15266, "loc": { "start": { - "line": 372, + "line": 383, "column": 103 }, "end": { - "line": 372, + "line": 383, "column": 106 } } @@ -77163,15 +79728,15 @@ "binop": null, "updateContext": null }, - "start": 15025, - "end": 15026, + "start": 15266, + "end": 15267, "loc": { "start": { - "line": 372, + "line": 383, "column": 106 }, "end": { - "line": 372, + "line": 383, "column": 107 } } @@ -77191,15 +79756,15 @@ "updateContext": null }, "value": "true", - "start": 15027, - "end": 15031, + "start": 15268, + "end": 15272, "loc": { "start": { - "line": 372, + "line": 383, "column": 108 }, "end": { - "line": 372, + "line": 383, "column": 112 } } @@ -77216,15 +79781,15 @@ "postfix": false, "binop": null }, - "start": 15031, - "end": 15032, + "start": 15272, + "end": 15273, "loc": { "start": { - "line": 372, + "line": 383, "column": 112 }, "end": { - "line": 372, + "line": 383, "column": 113 } } @@ -77241,15 +79806,15 @@ "postfix": false, "binop": null }, - "start": 15032, - "end": 15033, + "start": 15273, + "end": 15274, "loc": { "start": { - "line": 372, + "line": 383, "column": 113 }, "end": { - "line": 372, + "line": 383, "column": 114 } } @@ -77267,15 +79832,15 @@ "binop": null, "updateContext": null }, - "start": 15033, - "end": 15034, + "start": 15274, + "end": 15275, "loc": { "start": { - "line": 372, + "line": 383, "column": 114 }, "end": { - "line": 372, + "line": 383, "column": 115 } } @@ -77295,15 +79860,15 @@ "updateContext": null }, "value": "const", - "start": 15056, - "end": 15061, + "start": 15297, + "end": 15302, "loc": { "start": { - "line": 374, + "line": 385, "column": 20 }, "end": { - "line": 374, + "line": 385, "column": 25 } } @@ -77321,15 +79886,15 @@ "binop": null }, "value": "xktContent", - "start": 15062, - "end": 15072, + "start": 15303, + "end": 15313, "loc": { "start": { - "line": 374, + "line": 385, "column": 26 }, "end": { - "line": 374, + "line": 385, "column": 36 } } @@ -77348,15 +79913,15 @@ "updateContext": null }, "value": "=", - "start": 15073, - "end": 15074, + "start": 15314, + "end": 15315, "loc": { "start": { - "line": 374, + "line": 385, "column": 37 }, "end": { - "line": 374, + "line": 385, "column": 38 } } @@ -77374,15 +79939,15 @@ "binop": null }, "value": "Buffer", - "start": 15075, - "end": 15081, + "start": 15316, + "end": 15322, "loc": { "start": { - "line": 374, + "line": 385, "column": 39 }, "end": { - "line": 374, + "line": 385, "column": 45 } } @@ -77400,15 +79965,15 @@ "binop": null, "updateContext": null }, - "start": 15081, - "end": 15082, + "start": 15322, + "end": 15323, "loc": { "start": { - "line": 374, + "line": 385, "column": 45 }, "end": { - "line": 374, + "line": 385, "column": 46 } } @@ -77426,15 +79991,15 @@ "binop": null }, "value": "from", - "start": 15082, - "end": 15086, + "start": 15323, + "end": 15327, "loc": { "start": { - "line": 374, + "line": 385, "column": 46 }, "end": { - "line": 374, + "line": 385, "column": 50 } } @@ -77451,15 +80016,15 @@ "postfix": false, "binop": null }, - "start": 15086, - "end": 15087, + "start": 15327, + "end": 15328, "loc": { "start": { - "line": 374, + "line": 385, "column": 50 }, "end": { - "line": 374, + "line": 385, "column": 51 } } @@ -77477,15 +80042,15 @@ "binop": null }, "value": "xktArrayBuffer", - "start": 15087, - "end": 15101, + "start": 15328, + "end": 15342, "loc": { "start": { - "line": 374, + "line": 385, "column": 51 }, "end": { - "line": 374, + "line": 385, "column": 65 } } @@ -77502,15 +80067,15 @@ "postfix": false, "binop": null }, - "start": 15101, - "end": 15102, + "start": 15342, + "end": 15343, "loc": { "start": { - "line": 374, + "line": 385, "column": 65 }, "end": { - "line": 374, + "line": 385, "column": 66 } } @@ -77528,15 +80093,15 @@ "binop": null, "updateContext": null }, - "start": 15102, - "end": 15103, + "start": 15343, + "end": 15344, "loc": { "start": { - "line": 374, + "line": 385, "column": 66 }, "end": { - "line": 374, + "line": 385, "column": 67 } } @@ -77556,15 +80121,15 @@ "updateContext": null }, "value": "const", - "start": 15125, - "end": 15130, + "start": 15366, + "end": 15371, "loc": { "start": { - "line": 376, + "line": 387, "column": 20 }, "end": { - "line": 376, + "line": 387, "column": 25 } } @@ -77582,15 +80147,15 @@ "binop": null }, "value": "targetFileSizeBytes", - "start": 15131, - "end": 15150, + "start": 15372, + "end": 15391, "loc": { "start": { - "line": 376, + "line": 387, "column": 26 }, "end": { - "line": 376, + "line": 387, "column": 45 } } @@ -77609,15 +80174,15 @@ "updateContext": null }, "value": "=", - "start": 15151, - "end": 15152, + "start": 15392, + "end": 15393, "loc": { "start": { - "line": 376, + "line": 387, "column": 46 }, "end": { - "line": 376, + "line": 387, "column": 47 } } @@ -77635,15 +80200,15 @@ "binop": null }, "value": "xktArrayBuffer", - "start": 15153, - "end": 15167, + "start": 15394, + "end": 15408, "loc": { "start": { - "line": 376, + "line": 387, "column": 48 }, "end": { - "line": 376, + "line": 387, "column": 62 } } @@ -77661,15 +80226,15 @@ "binop": null, "updateContext": null }, - "start": 15167, - "end": 15168, + "start": 15408, + "end": 15409, "loc": { "start": { - "line": 376, + "line": 387, "column": 62 }, "end": { - "line": 376, + "line": 387, "column": 63 } } @@ -77687,15 +80252,15 @@ "binop": null }, "value": "byteLength", - "start": 15168, - "end": 15178, + "start": 15409, + "end": 15419, "loc": { "start": { - "line": 376, + "line": 387, "column": 63 }, "end": { - "line": 376, + "line": 387, "column": 73 } } @@ -77713,15 +80278,15 @@ "binop": null, "updateContext": null }, - "start": 15178, - "end": 15179, + "start": 15419, + "end": 15420, "loc": { "start": { - "line": 376, + "line": 387, "column": 73 }, "end": { - "line": 376, + "line": 387, "column": 74 } } @@ -77739,15 +80304,15 @@ "binop": null }, "value": "stats", - "start": 15201, - "end": 15206, + "start": 15442, + "end": 15447, "loc": { "start": { - "line": 378, + "line": 389, "column": 20 }, "end": { - "line": 378, + "line": 389, "column": 25 } } @@ -77765,15 +80330,15 @@ "binop": null, "updateContext": null }, - "start": 15206, - "end": 15207, + "start": 15447, + "end": 15448, "loc": { "start": { - "line": 378, + "line": 389, "column": 25 }, "end": { - "line": 378, + "line": 389, "column": 26 } } @@ -77791,15 +80356,15 @@ "binop": null }, "value": "minTileSize", - "start": 15207, - "end": 15218, + "start": 15448, + "end": 15459, "loc": { "start": { - "line": 378, + "line": 389, "column": 26 }, "end": { - "line": 378, + "line": 389, "column": 37 } } @@ -77818,15 +80383,15 @@ "updateContext": null }, "value": "=", - "start": 15219, - "end": 15220, + "start": 15460, + "end": 15461, "loc": { "start": { - "line": 378, + "line": 389, "column": 38 }, "end": { - "line": 378, + "line": 389, "column": 39 } } @@ -77844,15 +80409,15 @@ "binop": null }, "value": "minTileSize", - "start": 15221, - "end": 15232, + "start": 15462, + "end": 15473, "loc": { "start": { - "line": 378, + "line": 389, "column": 40 }, "end": { - "line": 378, + "line": 389, "column": 51 } } @@ -77871,15 +80436,15 @@ "updateContext": null }, "value": "||", - "start": 15233, - "end": 15235, + "start": 15474, + "end": 15476, "loc": { "start": { - "line": 378, + "line": 389, "column": 52 }, "end": { - "line": 378, + "line": 389, "column": 54 } } @@ -77898,15 +80463,15 @@ "updateContext": null }, "value": 200, - "start": 15236, - "end": 15239, + "start": 15477, + "end": 15480, "loc": { "start": { - "line": 378, + "line": 389, "column": 55 }, "end": { - "line": 378, + "line": 389, "column": 58 } } @@ -77924,15 +80489,15 @@ "binop": null, "updateContext": null }, - "start": 15239, - "end": 15240, + "start": 15480, + "end": 15481, "loc": { "start": { - "line": 378, + "line": 389, "column": 58 }, "end": { - "line": 378, + "line": 389, "column": 59 } } @@ -77950,15 +80515,15 @@ "binop": null }, "value": "stats", - "start": 15261, - "end": 15266, + "start": 15502, + "end": 15507, "loc": { "start": { - "line": 379, + "line": 390, "column": 20 }, "end": { - "line": 379, + "line": 390, "column": 25 } } @@ -77976,15 +80541,15 @@ "binop": null, "updateContext": null }, - "start": 15266, - "end": 15267, + "start": 15507, + "end": 15508, "loc": { "start": { - "line": 379, + "line": 390, "column": 25 }, "end": { - "line": 379, + "line": 390, "column": 26 } } @@ -78002,15 +80567,15 @@ "binop": null }, "value": "sourceSize", - "start": 15267, - "end": 15277, + "start": 15508, + "end": 15518, "loc": { "start": { - "line": 379, + "line": 390, "column": 26 }, "end": { - "line": 379, + "line": 390, "column": 36 } } @@ -78029,15 +80594,15 @@ "updateContext": null }, "value": "=", - "start": 15278, - "end": 15279, + "start": 15519, + "end": 15520, "loc": { "start": { - "line": 379, + "line": 390, "column": 37 }, "end": { - "line": 379, + "line": 390, "column": 38 } } @@ -78054,15 +80619,15 @@ "postfix": false, "binop": null }, - "start": 15280, - "end": 15281, + "start": 15521, + "end": 15522, "loc": { "start": { - "line": 379, + "line": 390, "column": 39 }, "end": { - "line": 379, + "line": 390, "column": 40 } } @@ -78080,15 +80645,15 @@ "binop": null }, "value": "sourceFileSizeBytes", - "start": 15281, - "end": 15300, + "start": 15522, + "end": 15541, "loc": { "start": { - "line": 379, + "line": 390, "column": 40 }, "end": { - "line": 379, + "line": 390, "column": 59 } } @@ -78107,15 +80672,15 @@ "updateContext": null }, "value": "/", - "start": 15301, - "end": 15302, + "start": 15542, + "end": 15543, "loc": { "start": { - "line": 379, + "line": 390, "column": 60 }, "end": { - "line": 379, + "line": 390, "column": 61 } } @@ -78134,15 +80699,15 @@ "updateContext": null }, "value": 1000, - "start": 15303, - "end": 15307, + "start": 15544, + "end": 15548, "loc": { "start": { - "line": 379, + "line": 390, "column": 62 }, "end": { - "line": 379, + "line": 390, "column": 66 } } @@ -78159,15 +80724,15 @@ "postfix": false, "binop": null }, - "start": 15307, - "end": 15308, + "start": 15548, + "end": 15549, "loc": { "start": { - "line": 379, + "line": 390, "column": 66 }, "end": { - "line": 379, + "line": 390, "column": 67 } } @@ -78185,15 +80750,15 @@ "binop": null, "updateContext": null }, - "start": 15308, - "end": 15309, + "start": 15549, + "end": 15550, "loc": { "start": { - "line": 379, + "line": 390, "column": 67 }, "end": { - "line": 379, + "line": 390, "column": 68 } } @@ -78211,15 +80776,15 @@ "binop": null }, "value": "toFixed", - "start": 15309, - "end": 15316, + "start": 15550, + "end": 15557, "loc": { "start": { - "line": 379, + "line": 390, "column": 68 }, "end": { - "line": 379, + "line": 390, "column": 75 } } @@ -78236,15 +80801,15 @@ "postfix": false, "binop": null }, - "start": 15316, - "end": 15317, + "start": 15557, + "end": 15558, "loc": { "start": { - "line": 379, + "line": 390, "column": 75 }, "end": { - "line": 379, + "line": 390, "column": 76 } } @@ -78263,15 +80828,15 @@ "updateContext": null }, "value": 2, - "start": 15317, - "end": 15318, + "start": 15558, + "end": 15559, "loc": { "start": { - "line": 379, + "line": 390, "column": 76 }, "end": { - "line": 379, + "line": 390, "column": 77 } } @@ -78288,15 +80853,15 @@ "postfix": false, "binop": null }, - "start": 15318, - "end": 15319, + "start": 15559, + "end": 15560, "loc": { "start": { - "line": 379, + "line": 390, "column": 77 }, "end": { - "line": 379, + "line": 390, "column": 78 } } @@ -78314,15 +80879,15 @@ "binop": null, "updateContext": null }, - "start": 15319, - "end": 15320, + "start": 15560, + "end": 15561, "loc": { "start": { - "line": 379, + "line": 390, "column": 78 }, "end": { - "line": 379, + "line": 390, "column": 79 } } @@ -78340,15 +80905,15 @@ "binop": null }, "value": "stats", - "start": 15341, - "end": 15346, + "start": 15582, + "end": 15587, "loc": { "start": { - "line": 380, + "line": 391, "column": 20 }, "end": { - "line": 380, + "line": 391, "column": 25 } } @@ -78366,15 +80931,15 @@ "binop": null, "updateContext": null }, - "start": 15346, - "end": 15347, + "start": 15587, + "end": 15588, "loc": { "start": { - "line": 380, + "line": 391, "column": 25 }, "end": { - "line": 380, + "line": 391, "column": 26 } } @@ -78392,15 +80957,15 @@ "binop": null }, "value": "xktSize", - "start": 15347, - "end": 15354, + "start": 15588, + "end": 15595, "loc": { "start": { - "line": 380, + "line": 391, "column": 26 }, "end": { - "line": 380, + "line": 391, "column": 33 } } @@ -78419,15 +80984,15 @@ "updateContext": null }, "value": "=", - "start": 15355, - "end": 15356, + "start": 15596, + "end": 15597, "loc": { "start": { - "line": 380, + "line": 391, "column": 34 }, "end": { - "line": 380, + "line": 391, "column": 35 } } @@ -78444,15 +81009,15 @@ "postfix": false, "binop": null }, - "start": 15357, - "end": 15358, + "start": 15598, + "end": 15599, "loc": { "start": { - "line": 380, + "line": 391, "column": 36 }, "end": { - "line": 380, + "line": 391, "column": 37 } } @@ -78470,15 +81035,15 @@ "binop": null }, "value": "targetFileSizeBytes", - "start": 15358, - "end": 15377, + "start": 15599, + "end": 15618, "loc": { "start": { - "line": 380, + "line": 391, "column": 37 }, "end": { - "line": 380, + "line": 391, "column": 56 } } @@ -78497,15 +81062,15 @@ "updateContext": null }, "value": "/", - "start": 15378, - "end": 15379, + "start": 15619, + "end": 15620, "loc": { "start": { - "line": 380, + "line": 391, "column": 57 }, "end": { - "line": 380, + "line": 391, "column": 58 } } @@ -78524,15 +81089,15 @@ "updateContext": null }, "value": 1000, - "start": 15380, - "end": 15384, + "start": 15621, + "end": 15625, "loc": { "start": { - "line": 380, + "line": 391, "column": 59 }, "end": { - "line": 380, + "line": 391, "column": 63 } } @@ -78549,15 +81114,15 @@ "postfix": false, "binop": null }, - "start": 15384, - "end": 15385, + "start": 15625, + "end": 15626, "loc": { "start": { - "line": 380, + "line": 391, "column": 63 }, "end": { - "line": 380, + "line": 391, "column": 64 } } @@ -78575,15 +81140,15 @@ "binop": null, "updateContext": null }, - "start": 15385, - "end": 15386, + "start": 15626, + "end": 15627, "loc": { "start": { - "line": 380, + "line": 391, "column": 64 }, "end": { - "line": 380, + "line": 391, "column": 65 } } @@ -78601,15 +81166,15 @@ "binop": null }, "value": "toFixed", - "start": 15386, - "end": 15393, + "start": 15627, + "end": 15634, "loc": { "start": { - "line": 380, + "line": 391, "column": 65 }, "end": { - "line": 380, + "line": 391, "column": 72 } } @@ -78626,15 +81191,15 @@ "postfix": false, "binop": null }, - "start": 15393, - "end": 15394, + "start": 15634, + "end": 15635, "loc": { "start": { - "line": 380, + "line": 391, "column": 72 }, "end": { - "line": 380, + "line": 391, "column": 73 } } @@ -78653,15 +81218,15 @@ "updateContext": null }, "value": 2, - "start": 15394, - "end": 15395, + "start": 15635, + "end": 15636, "loc": { "start": { - "line": 380, + "line": 391, "column": 73 }, "end": { - "line": 380, + "line": 391, "column": 74 } } @@ -78678,15 +81243,15 @@ "postfix": false, "binop": null }, - "start": 15395, - "end": 15396, + "start": 15636, + "end": 15637, "loc": { "start": { - "line": 380, + "line": 391, "column": 74 }, "end": { - "line": 380, + "line": 391, "column": 75 } } @@ -78704,15 +81269,15 @@ "binop": null, "updateContext": null }, - "start": 15396, - "end": 15397, + "start": 15637, + "end": 15638, "loc": { "start": { - "line": 380, + "line": 391, "column": 75 }, "end": { - "line": 380, + "line": 391, "column": 76 } } @@ -78730,15 +81295,15 @@ "binop": null }, "value": "stats", - "start": 15418, - "end": 15423, + "start": 15659, + "end": 15664, "loc": { "start": { - "line": 381, + "line": 392, "column": 20 }, "end": { - "line": 381, + "line": 392, "column": 25 } } @@ -78756,15 +81321,15 @@ "binop": null, "updateContext": null }, - "start": 15423, - "end": 15424, + "start": 15664, + "end": 15665, "loc": { "start": { - "line": 381, + "line": 392, "column": 25 }, "end": { - "line": 381, + "line": 392, "column": 26 } } @@ -78782,15 +81347,15 @@ "binop": null }, "value": "xktVersion", - "start": 15424, - "end": 15434, + "start": 15665, + "end": 15675, "loc": { "start": { - "line": 381, + "line": 392, "column": 26 }, "end": { - "line": 381, + "line": 392, "column": 36 } } @@ -78809,15 +81374,15 @@ "updateContext": null }, "value": "=", - "start": 15435, - "end": 15436, + "start": 15676, + "end": 15677, "loc": { "start": { - "line": 381, + "line": 392, "column": 37 }, "end": { - "line": 381, + "line": 392, "column": 38 } } @@ -78835,15 +81400,15 @@ "binop": null }, "value": "XKT_INFO", - "start": 15437, - "end": 15445, + "start": 15678, + "end": 15686, "loc": { "start": { - "line": 381, + "line": 392, "column": 39 }, "end": { - "line": 381, + "line": 392, "column": 47 } } @@ -78861,15 +81426,15 @@ "binop": null, "updateContext": null }, - "start": 15445, - "end": 15446, + "start": 15686, + "end": 15687, "loc": { "start": { - "line": 381, + "line": 392, "column": 47 }, "end": { - "line": 381, + "line": 392, "column": 48 } } @@ -78887,15 +81452,15 @@ "binop": null }, "value": "xktVersion", - "start": 15446, - "end": 15456, + "start": 15687, + "end": 15697, "loc": { "start": { - "line": 381, + "line": 392, "column": 48 }, "end": { - "line": 381, + "line": 392, "column": 58 } } @@ -78913,15 +81478,15 @@ "binop": null, "updateContext": null }, - "start": 15456, - "end": 15457, + "start": 15697, + "end": 15698, "loc": { "start": { - "line": 381, + "line": 392, "column": 58 }, "end": { - "line": 381, + "line": 392, "column": 59 } } @@ -78939,15 +81504,15 @@ "binop": null }, "value": "stats", - "start": 15478, - "end": 15483, + "start": 15719, + "end": 15724, "loc": { "start": { - "line": 382, + "line": 393, "column": 20 }, "end": { - "line": 382, + "line": 393, "column": 25 } } @@ -78965,15 +81530,15 @@ "binop": null, "updateContext": null }, - "start": 15483, - "end": 15484, + "start": 15724, + "end": 15725, "loc": { "start": { - "line": 382, + "line": 393, "column": 25 }, "end": { - "line": 382, + "line": 393, "column": 26 } } @@ -78991,15 +81556,15 @@ "binop": null }, "value": "compressionRatio", - "start": 15484, - "end": 15500, + "start": 15725, + "end": 15741, "loc": { "start": { - "line": 382, + "line": 393, "column": 26 }, "end": { - "line": 382, + "line": 393, "column": 42 } } @@ -79018,15 +81583,15 @@ "updateContext": null }, "value": "=", - "start": 15501, - "end": 15502, + "start": 15742, + "end": 15743, "loc": { "start": { - "line": 382, + "line": 393, "column": 43 }, "end": { - "line": 382, + "line": 393, "column": 44 } } @@ -79043,15 +81608,15 @@ "postfix": false, "binop": null }, - "start": 15503, - "end": 15504, + "start": 15744, + "end": 15745, "loc": { "start": { - "line": 382, + "line": 393, "column": 45 }, "end": { - "line": 382, + "line": 393, "column": 46 } } @@ -79069,15 +81634,15 @@ "binop": null }, "value": "sourceFileSizeBytes", - "start": 15504, - "end": 15523, + "start": 15745, + "end": 15764, "loc": { "start": { - "line": 382, + "line": 393, "column": 46 }, "end": { - "line": 382, + "line": 393, "column": 65 } } @@ -79096,15 +81661,15 @@ "updateContext": null }, "value": "/", - "start": 15524, - "end": 15525, + "start": 15765, + "end": 15766, "loc": { "start": { - "line": 382, + "line": 393, "column": 66 }, "end": { - "line": 382, + "line": 393, "column": 67 } } @@ -79122,15 +81687,15 @@ "binop": null }, "value": "targetFileSizeBytes", - "start": 15526, - "end": 15545, + "start": 15767, + "end": 15786, "loc": { "start": { - "line": 382, + "line": 393, "column": 68 }, "end": { - "line": 382, + "line": 393, "column": 87 } } @@ -79147,15 +81712,15 @@ "postfix": false, "binop": null }, - "start": 15545, - "end": 15546, + "start": 15786, + "end": 15787, "loc": { "start": { - "line": 382, + "line": 393, "column": 87 }, "end": { - "line": 382, + "line": 393, "column": 88 } } @@ -79173,15 +81738,15 @@ "binop": null, "updateContext": null }, - "start": 15546, - "end": 15547, + "start": 15787, + "end": 15788, "loc": { "start": { - "line": 382, + "line": 393, "column": 88 }, "end": { - "line": 382, + "line": 393, "column": 89 } } @@ -79199,15 +81764,15 @@ "binop": null }, "value": "toFixed", - "start": 15547, - "end": 15554, + "start": 15788, + "end": 15795, "loc": { "start": { - "line": 382, + "line": 393, "column": 89 }, "end": { - "line": 382, + "line": 393, "column": 96 } } @@ -79224,15 +81789,15 @@ "postfix": false, "binop": null }, - "start": 15554, - "end": 15555, + "start": 15795, + "end": 15796, "loc": { "start": { - "line": 382, + "line": 393, "column": 96 }, "end": { - "line": 382, + "line": 393, "column": 97 } } @@ -79251,15 +81816,15 @@ "updateContext": null }, "value": 2, - "start": 15555, - "end": 15556, + "start": 15796, + "end": 15797, "loc": { "start": { - "line": 382, + "line": 393, "column": 97 }, "end": { - "line": 382, + "line": 393, "column": 98 } } @@ -79276,15 +81841,15 @@ "postfix": false, "binop": null }, - "start": 15556, - "end": 15557, + "start": 15797, + "end": 15798, "loc": { "start": { - "line": 382, + "line": 393, "column": 98 }, "end": { - "line": 382, + "line": 393, "column": 99 } } @@ -79302,15 +81867,15 @@ "binop": null, "updateContext": null }, - "start": 15557, - "end": 15558, + "start": 15798, + "end": 15799, "loc": { "start": { - "line": 382, + "line": 393, "column": 99 }, "end": { - "line": 382, + "line": 393, "column": 100 } } @@ -79328,15 +81893,15 @@ "binop": null }, "value": "stats", - "start": 15579, - "end": 15584, + "start": 15820, + "end": 15825, "loc": { "start": { - "line": 383, + "line": 394, "column": 20 }, "end": { - "line": 383, + "line": 394, "column": 25 } } @@ -79354,15 +81919,15 @@ "binop": null, "updateContext": null }, - "start": 15584, - "end": 15585, + "start": 15825, + "end": 15826, "loc": { "start": { - "line": 383, + "line": 394, "column": 25 }, "end": { - "line": 383, + "line": 394, "column": 26 } } @@ -79380,15 +81945,15 @@ "binop": null }, "value": "conversionTime", - "start": 15585, - "end": 15599, + "start": 15826, + "end": 15840, "loc": { "start": { - "line": 383, + "line": 394, "column": 26 }, "end": { - "line": 383, + "line": 394, "column": 40 } } @@ -79407,15 +81972,15 @@ "updateContext": null }, "value": "=", - "start": 15600, - "end": 15601, + "start": 15841, + "end": 15842, "loc": { "start": { - "line": 383, + "line": 394, "column": 41 }, "end": { - "line": 383, + "line": 394, "column": 42 } } @@ -79432,15 +81997,15 @@ "postfix": false, "binop": null }, - "start": 15602, - "end": 15603, + "start": 15843, + "end": 15844, "loc": { "start": { - "line": 383, + "line": 394, "column": 43 }, "end": { - "line": 383, + "line": 394, "column": 44 } } @@ -79457,15 +82022,15 @@ "postfix": false, "binop": null }, - "start": 15603, - "end": 15604, + "start": 15844, + "end": 15845, "loc": { "start": { - "line": 383, + "line": 394, "column": 44 }, "end": { - "line": 383, + "line": 394, "column": 45 } } @@ -79485,15 +82050,15 @@ "updateContext": null }, "value": "new", - "start": 15604, - "end": 15607, + "start": 15845, + "end": 15848, "loc": { "start": { - "line": 383, + "line": 394, "column": 45 }, "end": { - "line": 383, + "line": 394, "column": 48 } } @@ -79511,15 +82076,15 @@ "binop": null }, "value": "Date", - "start": 15608, - "end": 15612, + "start": 15849, + "end": 15853, "loc": { "start": { - "line": 383, + "line": 394, "column": 49 }, "end": { - "line": 383, + "line": 394, "column": 53 } } @@ -79536,15 +82101,15 @@ "postfix": false, "binop": null }, - "start": 15612, - "end": 15613, + "start": 15853, + "end": 15854, "loc": { "start": { - "line": 383, + "line": 394, "column": 53 }, "end": { - "line": 383, + "line": 394, "column": 54 } } @@ -79561,15 +82126,15 @@ "postfix": false, "binop": null }, - "start": 15613, - "end": 15614, + "start": 15854, + "end": 15855, "loc": { "start": { - "line": 383, + "line": 394, "column": 54 }, "end": { - "line": 383, + "line": 394, "column": 55 } } @@ -79588,15 +82153,15 @@ "updateContext": null }, "value": "-", - "start": 15615, - "end": 15616, + "start": 15856, + "end": 15857, "loc": { "start": { - "line": 383, + "line": 394, "column": 56 }, "end": { - "line": 383, + "line": 394, "column": 57 } } @@ -79614,15 +82179,15 @@ "binop": null }, "value": "startTime", - "start": 15617, - "end": 15626, + "start": 15858, + "end": 15867, "loc": { "start": { - "line": 383, + "line": 394, "column": 58 }, "end": { - "line": 383, + "line": 394, "column": 67 } } @@ -79639,15 +82204,15 @@ "postfix": false, "binop": null }, - "start": 15626, - "end": 15627, + "start": 15867, + "end": 15868, "loc": { "start": { - "line": 383, + "line": 394, "column": 67 }, "end": { - "line": 383, + "line": 394, "column": 68 } } @@ -79666,15 +82231,15 @@ "updateContext": null }, "value": "/", - "start": 15628, - "end": 15629, + "start": 15869, + "end": 15870, "loc": { "start": { - "line": 383, + "line": 394, "column": 69 }, "end": { - "line": 383, + "line": 394, "column": 70 } } @@ -79693,15 +82258,15 @@ "updateContext": null }, "value": 1000, - "start": 15630, - "end": 15636, + "start": 15871, + "end": 15877, "loc": { "start": { - "line": 383, + "line": 394, "column": 71 }, "end": { - "line": 383, + "line": 394, "column": 77 } } @@ -79718,15 +82283,15 @@ "postfix": false, "binop": null }, - "start": 15636, - "end": 15637, + "start": 15877, + "end": 15878, "loc": { "start": { - "line": 383, + "line": 394, "column": 77 }, "end": { - "line": 383, + "line": 394, "column": 78 } } @@ -79744,15 +82309,15 @@ "binop": null, "updateContext": null }, - "start": 15637, - "end": 15638, + "start": 15878, + "end": 15879, "loc": { "start": { - "line": 383, + "line": 394, "column": 78 }, "end": { - "line": 383, + "line": 394, "column": 79 } } @@ -79770,15 +82335,15 @@ "binop": null }, "value": "toFixed", - "start": 15638, - "end": 15645, + "start": 15879, + "end": 15886, "loc": { "start": { - "line": 383, + "line": 394, "column": 79 }, "end": { - "line": 383, + "line": 394, "column": 86 } } @@ -79795,15 +82360,15 @@ "postfix": false, "binop": null }, - "start": 15645, - "end": 15646, + "start": 15886, + "end": 15887, "loc": { "start": { - "line": 383, + "line": 394, "column": 86 }, "end": { - "line": 383, + "line": 394, "column": 87 } } @@ -79822,15 +82387,15 @@ "updateContext": null }, "value": 2, - "start": 15646, - "end": 15647, + "start": 15887, + "end": 15888, "loc": { "start": { - "line": 383, + "line": 394, "column": 87 }, "end": { - "line": 383, + "line": 394, "column": 88 } } @@ -79847,15 +82412,15 @@ "postfix": false, "binop": null }, - "start": 15647, - "end": 15648, + "start": 15888, + "end": 15889, "loc": { "start": { - "line": 383, + "line": 394, "column": 88 }, "end": { - "line": 383, + "line": 394, "column": 89 } } @@ -79873,15 +82438,15 @@ "binop": null, "updateContext": null }, - "start": 15648, - "end": 15649, + "start": 15889, + "end": 15890, "loc": { "start": { - "line": 383, + "line": 394, "column": 89 }, "end": { - "line": 383, + "line": 394, "column": 90 } } @@ -79899,15 +82464,15 @@ "binop": null }, "value": "stats", - "start": 15670, - "end": 15675, + "start": 15911, + "end": 15916, "loc": { "start": { - "line": 384, + "line": 395, "column": 20 }, "end": { - "line": 384, + "line": 395, "column": 25 } } @@ -79925,15 +82490,15 @@ "binop": null, "updateContext": null }, - "start": 15675, - "end": 15676, + "start": 15916, + "end": 15917, "loc": { "start": { - "line": 384, + "line": 395, "column": 25 }, "end": { - "line": 384, + "line": 395, "column": 26 } } @@ -79951,15 +82516,15 @@ "binop": null }, "value": "aabb", - "start": 15676, - "end": 15680, + "start": 15917, + "end": 15921, "loc": { "start": { - "line": 384, + "line": 395, "column": 26 }, "end": { - "line": 384, + "line": 395, "column": 30 } } @@ -79978,15 +82543,15 @@ "updateContext": null }, "value": "=", - "start": 15681, - "end": 15682, + "start": 15922, + "end": 15923, "loc": { "start": { - "line": 384, + "line": 395, "column": 31 }, "end": { - "line": 384, + "line": 395, "column": 32 } } @@ -80004,15 +82569,15 @@ "binop": null }, "value": "xktModel", - "start": 15683, - "end": 15691, + "start": 15924, + "end": 15932, "loc": { "start": { - "line": 384, + "line": 395, "column": 33 }, "end": { - "line": 384, + "line": 395, "column": 41 } } @@ -80030,15 +82595,15 @@ "binop": null, "updateContext": null }, - "start": 15691, - "end": 15692, + "start": 15932, + "end": 15933, "loc": { "start": { - "line": 384, + "line": 395, "column": 41 }, "end": { - "line": 384, + "line": 395, "column": 42 } } @@ -80056,15 +82621,15 @@ "binop": null }, "value": "aabb", - "start": 15692, - "end": 15696, + "start": 15933, + "end": 15937, "loc": { "start": { - "line": 384, + "line": 395, "column": 42 }, "end": { - "line": 384, + "line": 395, "column": 46 } } @@ -80082,15 +82647,15 @@ "binop": null, "updateContext": null }, - "start": 15696, - "end": 15697, + "start": 15937, + "end": 15938, "loc": { "start": { - "line": 384, + "line": 395, "column": 46 }, "end": { - "line": 384, + "line": 395, "column": 47 } } @@ -80108,15 +82673,15 @@ "binop": null }, "value": "log", - "start": 15718, - "end": 15721, + "start": 15959, + "end": 15962, "loc": { "start": { - "line": 385, + "line": 396, "column": 20 }, "end": { - "line": 385, + "line": 396, "column": 23 } } @@ -80133,15 +82698,15 @@ "postfix": false, "binop": null }, - "start": 15721, - "end": 15722, + "start": 15962, + "end": 15963, "loc": { "start": { - "line": 385, + "line": 396, "column": 23 }, "end": { - "line": 385, + "line": 396, "column": 24 } } @@ -80158,15 +82723,15 @@ "postfix": false, "binop": null }, - "start": 15722, - "end": 15723, + "start": 15963, + "end": 15964, "loc": { "start": { - "line": 385, + "line": 396, "column": 24 }, "end": { - "line": 385, + "line": 396, "column": 25 } } @@ -80185,15 +82750,15 @@ "updateContext": null }, "value": "Converted to: XKT v", - "start": 15723, - "end": 15742, + "start": 15964, + "end": 15983, "loc": { "start": { - "line": 385, + "line": 396, "column": 25 }, "end": { - "line": 385, + "line": 396, "column": 44 } } @@ -80210,15 +82775,15 @@ "postfix": false, "binop": null }, - "start": 15742, - "end": 15744, + "start": 15983, + "end": 15985, "loc": { "start": { - "line": 385, + "line": 396, "column": 44 }, "end": { - "line": 385, + "line": 396, "column": 46 } } @@ -80236,15 +82801,15 @@ "binop": null }, "value": "stats", - "start": 15744, - "end": 15749, + "start": 15985, + "end": 15990, "loc": { "start": { - "line": 385, + "line": 396, "column": 46 }, "end": { - "line": 385, + "line": 396, "column": 51 } } @@ -80262,15 +82827,15 @@ "binop": null, "updateContext": null }, - "start": 15749, - "end": 15750, + "start": 15990, + "end": 15991, "loc": { "start": { - "line": 385, + "line": 396, "column": 51 }, "end": { - "line": 385, + "line": 396, "column": 52 } } @@ -80288,15 +82853,15 @@ "binop": null }, "value": "xktVersion", - "start": 15750, - "end": 15760, + "start": 15991, + "end": 16001, "loc": { "start": { - "line": 385, + "line": 396, "column": 52 }, "end": { - "line": 385, + "line": 396, "column": 62 } } @@ -80313,15 +82878,15 @@ "postfix": false, "binop": null }, - "start": 15760, - "end": 15761, + "start": 16001, + "end": 16002, "loc": { "start": { - "line": 385, + "line": 396, "column": 62 }, "end": { - "line": 385, + "line": 396, "column": 63 } } @@ -80340,15 +82905,15 @@ "updateContext": null }, "value": "", - "start": 15761, - "end": 15761, + "start": 16002, + "end": 16002, "loc": { "start": { - "line": 385, + "line": 396, "column": 63 }, "end": { - "line": 385, + "line": 396, "column": 63 } } @@ -80365,15 +82930,15 @@ "postfix": false, "binop": null }, - "start": 15761, - "end": 15762, + "start": 16002, + "end": 16003, "loc": { "start": { - "line": 385, + "line": 396, "column": 63 }, "end": { - "line": 385, + "line": 396, "column": 64 } } @@ -80390,15 +82955,15 @@ "postfix": false, "binop": null }, - "start": 15762, - "end": 15763, + "start": 16003, + "end": 16004, "loc": { "start": { - "line": 385, + "line": 396, "column": 64 }, "end": { - "line": 385, + "line": 396, "column": 65 } } @@ -80416,15 +82981,15 @@ "binop": null, "updateContext": null }, - "start": 15763, - "end": 15764, + "start": 16004, + "end": 16005, "loc": { "start": { - "line": 385, + "line": 396, "column": 65 }, "end": { - "line": 385, + "line": 396, "column": 66 } } @@ -80444,15 +83009,15 @@ "updateContext": null }, "value": "if", - "start": 15785, - "end": 15787, + "start": 16026, + "end": 16028, "loc": { "start": { - "line": 386, + "line": 397, "column": 20 }, "end": { - "line": 386, + "line": 397, "column": 22 } } @@ -80469,15 +83034,15 @@ "postfix": false, "binop": null }, - "start": 15788, - "end": 15789, + "start": 16029, + "end": 16030, "loc": { "start": { - "line": 386, + "line": 397, "column": 23 }, "end": { - "line": 386, + "line": 397, "column": 24 } } @@ -80495,15 +83060,15 @@ "binop": null }, "value": "includeTypes", - "start": 15789, - "end": 15801, + "start": 16030, + "end": 16042, "loc": { "start": { - "line": 386, + "line": 397, "column": 24 }, "end": { - "line": 386, + "line": 397, "column": 36 } } @@ -80520,15 +83085,15 @@ "postfix": false, "binop": null }, - "start": 15801, - "end": 15802, + "start": 16042, + "end": 16043, "loc": { "start": { - "line": 386, + "line": 397, "column": 36 }, "end": { - "line": 386, + "line": 397, "column": 37 } } @@ -80545,15 +83110,15 @@ "postfix": false, "binop": null }, - "start": 15803, - "end": 15804, + "start": 16044, + "end": 16045, "loc": { "start": { - "line": 386, + "line": 397, "column": 38 }, "end": { - "line": 386, + "line": 397, "column": 39 } } @@ -80571,15 +83136,15 @@ "binop": null }, "value": "log", - "start": 15829, - "end": 15832, + "start": 16070, + "end": 16073, "loc": { "start": { - "line": 387, + "line": 398, "column": 24 }, "end": { - "line": 387, + "line": 398, "column": 27 } } @@ -80596,15 +83161,15 @@ "postfix": false, "binop": null }, - "start": 15832, - "end": 15833, + "start": 16073, + "end": 16074, "loc": { "start": { - "line": 387, + "line": 398, "column": 27 }, "end": { - "line": 387, + "line": 398, "column": 28 } } @@ -80623,15 +83188,15 @@ "updateContext": null }, "value": "Include types: ", - "start": 15833, - "end": 15850, + "start": 16074, + "end": 16091, "loc": { "start": { - "line": 387, + "line": 398, "column": 28 }, "end": { - "line": 387, + "line": 398, "column": 45 } } @@ -80650,15 +83215,15 @@ "updateContext": null }, "value": "+", - "start": 15851, - "end": 15852, + "start": 16092, + "end": 16093, "loc": { "start": { - "line": 387, + "line": 398, "column": 46 }, "end": { - "line": 387, + "line": 398, "column": 47 } } @@ -80675,15 +83240,15 @@ "postfix": false, "binop": null }, - "start": 15853, - "end": 15854, + "start": 16094, + "end": 16095, "loc": { "start": { - "line": 387, + "line": 398, "column": 48 }, "end": { - "line": 387, + "line": 398, "column": 49 } } @@ -80701,15 +83266,15 @@ "binop": null }, "value": "includeTypes", - "start": 15854, - "end": 15866, + "start": 16095, + "end": 16107, "loc": { "start": { - "line": 387, + "line": 398, "column": 49 }, "end": { - "line": 387, + "line": 398, "column": 61 } } @@ -80727,15 +83292,15 @@ "binop": null, "updateContext": null }, - "start": 15867, - "end": 15868, + "start": 16108, + "end": 16109, "loc": { "start": { - "line": 387, + "line": 398, "column": 62 }, "end": { - "line": 387, + "line": 398, "column": 63 } } @@ -80753,15 +83318,15 @@ "binop": null }, "value": "includeTypes", - "start": 15869, - "end": 15881, + "start": 16110, + "end": 16122, "loc": { "start": { - "line": 387, + "line": 398, "column": 64 }, "end": { - "line": 387, + "line": 398, "column": 76 } } @@ -80779,15 +83344,15 @@ "binop": null, "updateContext": null }, - "start": 15882, - "end": 15883, + "start": 16123, + "end": 16124, "loc": { "start": { - "line": 387, + "line": 398, "column": 77 }, "end": { - "line": 387, + "line": 398, "column": 78 } } @@ -80806,15 +83371,15 @@ "updateContext": null }, "value": "(include all)", - "start": 15884, - "end": 15899, + "start": 16125, + "end": 16140, "loc": { "start": { - "line": 387, + "line": 398, "column": 79 }, "end": { - "line": 387, + "line": 398, "column": 94 } } @@ -80831,15 +83396,15 @@ "postfix": false, "binop": null }, - "start": 15899, - "end": 15900, + "start": 16140, + "end": 16141, "loc": { "start": { - "line": 387, + "line": 398, "column": 94 }, "end": { - "line": 387, + "line": 398, "column": 95 } } @@ -80856,15 +83421,15 @@ "postfix": false, "binop": null }, - "start": 15900, - "end": 15901, + "start": 16141, + "end": 16142, "loc": { "start": { - "line": 387, + "line": 398, "column": 95 }, "end": { - "line": 387, + "line": 398, "column": 96 } } @@ -80882,15 +83447,15 @@ "binop": null, "updateContext": null }, - "start": 15901, - "end": 15902, + "start": 16142, + "end": 16143, "loc": { "start": { - "line": 387, + "line": 398, "column": 96 }, "end": { - "line": 387, + "line": 398, "column": 97 } } @@ -80907,15 +83472,15 @@ "postfix": false, "binop": null }, - "start": 15923, - "end": 15924, + "start": 16164, + "end": 16165, "loc": { "start": { - "line": 388, + "line": 399, "column": 20 }, "end": { - "line": 388, + "line": 399, "column": 21 } } @@ -80935,15 +83500,15 @@ "updateContext": null }, "value": "if", - "start": 15945, - "end": 15947, + "start": 16186, + "end": 16188, "loc": { "start": { - "line": 389, + "line": 400, "column": 20 }, "end": { - "line": 389, + "line": 400, "column": 22 } } @@ -80960,15 +83525,15 @@ "postfix": false, "binop": null }, - "start": 15948, - "end": 15949, + "start": 16189, + "end": 16190, "loc": { "start": { - "line": 389, + "line": 400, "column": 23 }, "end": { - "line": 389, + "line": 400, "column": 24 } } @@ -80986,15 +83551,15 @@ "binop": null }, "value": "excludeTypes", - "start": 15949, - "end": 15961, + "start": 16190, + "end": 16202, "loc": { "start": { - "line": 389, + "line": 400, "column": 24 }, "end": { - "line": 389, + "line": 400, "column": 36 } } @@ -81011,15 +83576,15 @@ "postfix": false, "binop": null }, - "start": 15961, - "end": 15962, + "start": 16202, + "end": 16203, "loc": { "start": { - "line": 389, + "line": 400, "column": 36 }, "end": { - "line": 389, + "line": 400, "column": 37 } } @@ -81036,15 +83601,15 @@ "postfix": false, "binop": null }, - "start": 15963, - "end": 15964, + "start": 16204, + "end": 16205, "loc": { "start": { - "line": 389, + "line": 400, "column": 38 }, "end": { - "line": 389, + "line": 400, "column": 39 } } @@ -81062,15 +83627,15 @@ "binop": null }, "value": "log", - "start": 15989, - "end": 15992, + "start": 16230, + "end": 16233, "loc": { "start": { - "line": 390, + "line": 401, "column": 24 }, "end": { - "line": 390, + "line": 401, "column": 27 } } @@ -81087,15 +83652,15 @@ "postfix": false, "binop": null }, - "start": 15992, - "end": 15993, + "start": 16233, + "end": 16234, "loc": { "start": { - "line": 390, + "line": 401, "column": 27 }, "end": { - "line": 390, + "line": 401, "column": 28 } } @@ -81114,15 +83679,15 @@ "updateContext": null }, "value": "Exclude types: ", - "start": 15993, - "end": 16010, + "start": 16234, + "end": 16251, "loc": { "start": { - "line": 390, + "line": 401, "column": 28 }, "end": { - "line": 390, + "line": 401, "column": 45 } } @@ -81141,15 +83706,15 @@ "updateContext": null }, "value": "+", - "start": 16011, - "end": 16012, + "start": 16252, + "end": 16253, "loc": { "start": { - "line": 390, + "line": 401, "column": 46 }, "end": { - "line": 390, + "line": 401, "column": 47 } } @@ -81166,15 +83731,15 @@ "postfix": false, "binop": null }, - "start": 16013, - "end": 16014, + "start": 16254, + "end": 16255, "loc": { "start": { - "line": 390, + "line": 401, "column": 48 }, "end": { - "line": 390, + "line": 401, "column": 49 } } @@ -81192,15 +83757,15 @@ "binop": null }, "value": "excludeTypes", - "start": 16014, - "end": 16026, + "start": 16255, + "end": 16267, "loc": { "start": { - "line": 390, + "line": 401, "column": 49 }, "end": { - "line": 390, + "line": 401, "column": 61 } } @@ -81218,15 +83783,15 @@ "binop": null, "updateContext": null }, - "start": 16027, - "end": 16028, + "start": 16268, + "end": 16269, "loc": { "start": { - "line": 390, + "line": 401, "column": 62 }, "end": { - "line": 390, + "line": 401, "column": 63 } } @@ -81244,15 +83809,15 @@ "binop": null }, "value": "excludeTypes", - "start": 16029, - "end": 16041, + "start": 16270, + "end": 16282, "loc": { "start": { - "line": 390, + "line": 401, "column": 64 }, "end": { - "line": 390, + "line": 401, "column": 76 } } @@ -81270,15 +83835,15 @@ "binop": null, "updateContext": null }, - "start": 16042, - "end": 16043, + "start": 16283, + "end": 16284, "loc": { "start": { - "line": 390, + "line": 401, "column": 77 }, "end": { - "line": 390, + "line": 401, "column": 78 } } @@ -81297,15 +83862,15 @@ "updateContext": null }, "value": "(exclude none)", - "start": 16044, - "end": 16060, + "start": 16285, + "end": 16301, "loc": { "start": { - "line": 390, + "line": 401, "column": 79 }, "end": { - "line": 390, + "line": 401, "column": 95 } } @@ -81322,15 +83887,15 @@ "postfix": false, "binop": null }, - "start": 16060, - "end": 16061, + "start": 16301, + "end": 16302, "loc": { "start": { - "line": 390, + "line": 401, "column": 95 }, "end": { - "line": 390, + "line": 401, "column": 96 } } @@ -81347,15 +83912,15 @@ "postfix": false, "binop": null }, - "start": 16061, - "end": 16062, + "start": 16302, + "end": 16303, "loc": { "start": { - "line": 390, + "line": 401, "column": 96 }, "end": { - "line": 390, + "line": 401, "column": 97 } } @@ -81373,15 +83938,15 @@ "binop": null, "updateContext": null }, - "start": 16062, - "end": 16063, + "start": 16303, + "end": 16304, "loc": { "start": { - "line": 390, + "line": 401, "column": 97 }, "end": { - "line": 390, + "line": 401, "column": 98 } } @@ -81398,15 +83963,15 @@ "postfix": false, "binop": null }, - "start": 16084, - "end": 16085, + "start": 16325, + "end": 16326, "loc": { "start": { - "line": 391, + "line": 402, "column": 20 }, "end": { - "line": 391, + "line": 402, "column": 21 } } @@ -81424,15 +83989,15 @@ "binop": null }, "value": "log", - "start": 16106, - "end": 16109, + "start": 16347, + "end": 16350, "loc": { "start": { - "line": 392, + "line": 403, "column": 20 }, "end": { - "line": 392, + "line": 403, "column": 23 } } @@ -81449,15 +84014,15 @@ "postfix": false, "binop": null }, - "start": 16109, - "end": 16110, + "start": 16350, + "end": 16351, "loc": { "start": { - "line": 392, + "line": 403, "column": 23 }, "end": { - "line": 392, + "line": 403, "column": 24 } } @@ -81476,15 +84041,15 @@ "updateContext": null }, "value": "XKT size: ", - "start": 16110, - "end": 16122, + "start": 16351, + "end": 16363, "loc": { "start": { - "line": 392, + "line": 403, "column": 24 }, "end": { - "line": 392, + "line": 403, "column": 36 } } @@ -81503,15 +84068,15 @@ "updateContext": null }, "value": "+", - "start": 16123, - "end": 16124, + "start": 16364, + "end": 16365, "loc": { "start": { - "line": 392, + "line": 403, "column": 37 }, "end": { - "line": 392, + "line": 403, "column": 38 } } @@ -81529,15 +84094,15 @@ "binop": null }, "value": "stats", - "start": 16125, - "end": 16130, + "start": 16366, + "end": 16371, "loc": { "start": { - "line": 392, + "line": 403, "column": 39 }, "end": { - "line": 392, + "line": 403, "column": 44 } } @@ -81555,15 +84120,15 @@ "binop": null, "updateContext": null }, - "start": 16130, - "end": 16131, + "start": 16371, + "end": 16372, "loc": { "start": { - "line": 392, + "line": 403, "column": 44 }, "end": { - "line": 392, + "line": 403, "column": 45 } } @@ -81581,15 +84146,15 @@ "binop": null }, "value": "xktSize", - "start": 16131, - "end": 16138, + "start": 16372, + "end": 16379, "loc": { "start": { - "line": 392, + "line": 403, "column": 45 }, "end": { - "line": 392, + "line": 403, "column": 52 } } @@ -81608,15 +84173,15 @@ "updateContext": null }, "value": "+", - "start": 16139, - "end": 16140, + "start": 16380, + "end": 16381, "loc": { "start": { - "line": 392, + "line": 403, "column": 53 }, "end": { - "line": 392, + "line": 403, "column": 54 } } @@ -81635,15 +84200,15 @@ "updateContext": null }, "value": " kB", - "start": 16141, - "end": 16146, + "start": 16382, + "end": 16387, "loc": { "start": { - "line": 392, + "line": 403, "column": 55 }, "end": { - "line": 392, + "line": 403, "column": 60 } } @@ -81660,15 +84225,15 @@ "postfix": false, "binop": null }, - "start": 16146, - "end": 16147, + "start": 16387, + "end": 16388, "loc": { "start": { - "line": 392, + "line": 403, "column": 60 }, "end": { - "line": 392, + "line": 403, "column": 61 } } @@ -81686,15 +84251,15 @@ "binop": null, "updateContext": null }, - "start": 16147, - "end": 16148, + "start": 16388, + "end": 16389, "loc": { "start": { - "line": 392, + "line": 403, "column": 61 }, "end": { - "line": 392, + "line": 403, "column": 62 } } @@ -81712,15 +84277,15 @@ "binop": null }, "value": "log", - "start": 16169, - "end": 16172, + "start": 16410, + "end": 16413, "loc": { "start": { - "line": 393, + "line": 404, "column": 20 }, "end": { - "line": 393, + "line": 404, "column": 23 } } @@ -81737,15 +84302,15 @@ "postfix": false, "binop": null }, - "start": 16172, - "end": 16173, + "start": 16413, + "end": 16414, "loc": { "start": { - "line": 393, + "line": 404, "column": 23 }, "end": { - "line": 393, + "line": 404, "column": 24 } } @@ -81764,15 +84329,15 @@ "updateContext": null }, "value": "XKT textures size: ", - "start": 16173, - "end": 16194, + "start": 16414, + "end": 16435, "loc": { "start": { - "line": 393, + "line": 404, "column": 24 }, "end": { - "line": 393, + "line": 404, "column": 45 } } @@ -81791,15 +84356,15 @@ "updateContext": null }, "value": "+", - "start": 16195, - "end": 16196, + "start": 16436, + "end": 16437, "loc": { "start": { - "line": 393, + "line": 404, "column": 46 }, "end": { - "line": 393, + "line": 404, "column": 47 } } @@ -81816,15 +84381,15 @@ "postfix": false, "binop": null }, - "start": 16197, - "end": 16198, + "start": 16438, + "end": 16439, "loc": { "start": { - "line": 393, + "line": 404, "column": 48 }, "end": { - "line": 393, + "line": 404, "column": 49 } } @@ -81842,15 +84407,15 @@ "binop": null }, "value": "stats", - "start": 16198, - "end": 16203, + "start": 16439, + "end": 16444, "loc": { "start": { - "line": 393, + "line": 404, "column": 49 }, "end": { - "line": 393, + "line": 404, "column": 54 } } @@ -81868,15 +84433,15 @@ "binop": null, "updateContext": null }, - "start": 16203, - "end": 16204, + "start": 16444, + "end": 16445, "loc": { "start": { - "line": 393, + "line": 404, "column": 54 }, "end": { - "line": 393, + "line": 404, "column": 55 } } @@ -81894,15 +84459,15 @@ "binop": null }, "value": "texturesSize", - "start": 16204, - "end": 16216, + "start": 16445, + "end": 16457, "loc": { "start": { - "line": 393, + "line": 404, "column": 55 }, "end": { - "line": 393, + "line": 404, "column": 67 } } @@ -81921,15 +84486,15 @@ "updateContext": null }, "value": "/", - "start": 16217, - "end": 16218, + "start": 16458, + "end": 16459, "loc": { "start": { - "line": 393, + "line": 404, "column": 68 }, "end": { - "line": 393, + "line": 404, "column": 69 } } @@ -81948,15 +84513,15 @@ "updateContext": null }, "value": 1000, - "start": 16219, - "end": 16223, + "start": 16460, + "end": 16464, "loc": { "start": { - "line": 393, + "line": 404, "column": 70 }, "end": { - "line": 393, + "line": 404, "column": 74 } } @@ -81973,15 +84538,15 @@ "postfix": false, "binop": null }, - "start": 16223, - "end": 16224, + "start": 16464, + "end": 16465, "loc": { "start": { - "line": 393, + "line": 404, "column": 74 }, "end": { - "line": 393, + "line": 404, "column": 75 } } @@ -81999,15 +84564,15 @@ "binop": null, "updateContext": null }, - "start": 16224, - "end": 16225, + "start": 16465, + "end": 16466, "loc": { "start": { - "line": 393, + "line": 404, "column": 75 }, "end": { - "line": 393, + "line": 404, "column": 76 } } @@ -82025,15 +84590,15 @@ "binop": null }, "value": "toFixed", - "start": 16225, - "end": 16232, + "start": 16466, + "end": 16473, "loc": { "start": { - "line": 393, + "line": 404, "column": 76 }, "end": { - "line": 393, + "line": 404, "column": 83 } } @@ -82050,15 +84615,15 @@ "postfix": false, "binop": null }, - "start": 16232, - "end": 16233, + "start": 16473, + "end": 16474, "loc": { "start": { - "line": 393, + "line": 404, "column": 83 }, "end": { - "line": 393, + "line": 404, "column": 84 } } @@ -82077,15 +84642,15 @@ "updateContext": null }, "value": 2, - "start": 16233, - "end": 16234, + "start": 16474, + "end": 16475, "loc": { "start": { - "line": 393, + "line": 404, "column": 84 }, "end": { - "line": 393, + "line": 404, "column": 85 } } @@ -82102,15 +84667,15 @@ "postfix": false, "binop": null }, - "start": 16234, - "end": 16235, + "start": 16475, + "end": 16476, "loc": { "start": { - "line": 393, + "line": 404, "column": 85 }, "end": { - "line": 393, + "line": 404, "column": 86 } } @@ -82129,15 +84694,15 @@ "updateContext": null }, "value": "+", - "start": 16236, - "end": 16237, + "start": 16477, + "end": 16478, "loc": { "start": { - "line": 393, + "line": 404, "column": 87 }, "end": { - "line": 393, + "line": 404, "column": 88 } } @@ -82156,15 +84721,15 @@ "updateContext": null }, "value": "kB", - "start": 16238, - "end": 16242, + "start": 16479, + "end": 16483, "loc": { "start": { - "line": 393, + "line": 404, "column": 89 }, "end": { - "line": 393, + "line": 404, "column": 93 } } @@ -82181,15 +84746,15 @@ "postfix": false, "binop": null }, - "start": 16242, - "end": 16243, + "start": 16483, + "end": 16484, "loc": { "start": { - "line": 393, + "line": 404, "column": 93 }, "end": { - "line": 393, + "line": 404, "column": 94 } } @@ -82207,15 +84772,15 @@ "binop": null, "updateContext": null }, - "start": 16243, - "end": 16244, + "start": 16484, + "end": 16485, "loc": { "start": { - "line": 393, + "line": 404, "column": 94 }, "end": { - "line": 393, + "line": 404, "column": 95 } } @@ -82233,15 +84798,15 @@ "binop": null }, "value": "log", - "start": 16265, - "end": 16268, + "start": 16506, + "end": 16509, "loc": { "start": { - "line": 394, + "line": 405, "column": 20 }, "end": { - "line": 394, + "line": 405, "column": 23 } } @@ -82258,15 +84823,15 @@ "postfix": false, "binop": null }, - "start": 16268, - "end": 16269, + "start": 16509, + "end": 16510, "loc": { "start": { - "line": 394, + "line": 405, "column": 23 }, "end": { - "line": 394, + "line": 405, "column": 24 } } @@ -82285,15 +84850,15 @@ "updateContext": null }, "value": "Compression ratio: ", - "start": 16269, - "end": 16290, + "start": 16510, + "end": 16531, "loc": { "start": { - "line": 394, + "line": 405, "column": 24 }, "end": { - "line": 394, + "line": 405, "column": 45 } } @@ -82312,15 +84877,15 @@ "updateContext": null }, "value": "+", - "start": 16291, - "end": 16292, + "start": 16532, + "end": 16533, "loc": { "start": { - "line": 394, + "line": 405, "column": 46 }, "end": { - "line": 394, + "line": 405, "column": 47 } } @@ -82338,15 +84903,15 @@ "binop": null }, "value": "stats", - "start": 16293, - "end": 16298, + "start": 16534, + "end": 16539, "loc": { "start": { - "line": 394, + "line": 405, "column": 48 }, "end": { - "line": 394, + "line": 405, "column": 53 } } @@ -82364,15 +84929,15 @@ "binop": null, "updateContext": null }, - "start": 16298, - "end": 16299, + "start": 16539, + "end": 16540, "loc": { "start": { - "line": 394, + "line": 405, "column": 53 }, "end": { - "line": 394, + "line": 405, "column": 54 } } @@ -82390,15 +84955,15 @@ "binop": null }, "value": "compressionRatio", - "start": 16299, - "end": 16315, + "start": 16540, + "end": 16556, "loc": { "start": { - "line": 394, + "line": 405, "column": 54 }, "end": { - "line": 394, + "line": 405, "column": 70 } } @@ -82415,15 +84980,15 @@ "postfix": false, "binop": null }, - "start": 16315, - "end": 16316, + "start": 16556, + "end": 16557, "loc": { "start": { - "line": 394, + "line": 405, "column": 70 }, "end": { - "line": 394, + "line": 405, "column": 71 } } @@ -82441,15 +85006,15 @@ "binop": null, "updateContext": null }, - "start": 16316, - "end": 16317, + "start": 16557, + "end": 16558, "loc": { "start": { - "line": 394, + "line": 405, "column": 71 }, "end": { - "line": 394, + "line": 405, "column": 72 } } @@ -82467,15 +85032,15 @@ "binop": null }, "value": "log", - "start": 16338, - "end": 16341, + "start": 16579, + "end": 16582, "loc": { "start": { - "line": 395, + "line": 406, "column": 20 }, "end": { - "line": 395, + "line": 406, "column": 23 } } @@ -82492,15 +85057,15 @@ "postfix": false, "binop": null }, - "start": 16341, - "end": 16342, + "start": 16582, + "end": 16583, "loc": { "start": { - "line": 395, + "line": 406, "column": 23 }, "end": { - "line": 395, + "line": 406, "column": 24 } } @@ -82519,15 +85084,15 @@ "updateContext": null }, "value": "Conversion time: ", - "start": 16342, - "end": 16361, + "start": 16583, + "end": 16602, "loc": { "start": { - "line": 395, + "line": 406, "column": 24 }, "end": { - "line": 395, + "line": 406, "column": 43 } } @@ -82546,15 +85111,15 @@ "updateContext": null }, "value": "+", - "start": 16362, - "end": 16363, + "start": 16603, + "end": 16604, "loc": { "start": { - "line": 395, + "line": 406, "column": 44 }, "end": { - "line": 395, + "line": 406, "column": 45 } } @@ -82572,15 +85137,15 @@ "binop": null }, "value": "stats", - "start": 16364, - "end": 16369, + "start": 16605, + "end": 16610, "loc": { "start": { - "line": 395, + "line": 406, "column": 46 }, "end": { - "line": 395, + "line": 406, "column": 51 } } @@ -82598,15 +85163,15 @@ "binop": null, "updateContext": null }, - "start": 16369, - "end": 16370, + "start": 16610, + "end": 16611, "loc": { "start": { - "line": 395, + "line": 406, "column": 51 }, "end": { - "line": 395, + "line": 406, "column": 52 } } @@ -82624,15 +85189,15 @@ "binop": null }, "value": "conversionTime", - "start": 16370, - "end": 16384, + "start": 16611, + "end": 16625, "loc": { "start": { - "line": 395, + "line": 406, "column": 52 }, "end": { - "line": 395, + "line": 406, "column": 66 } } @@ -82651,15 +85216,15 @@ "updateContext": null }, "value": "+", - "start": 16385, - "end": 16386, + "start": 16626, + "end": 16627, "loc": { "start": { - "line": 395, + "line": 406, "column": 67 }, "end": { - "line": 395, + "line": 406, "column": 68 } } @@ -82678,15 +85243,15 @@ "updateContext": null }, "value": " s", - "start": 16387, - "end": 16391, + "start": 16628, + "end": 16632, "loc": { "start": { - "line": 395, + "line": 406, "column": 69 }, "end": { - "line": 395, + "line": 406, "column": 73 } } @@ -82703,15 +85268,15 @@ "postfix": false, "binop": null }, - "start": 16391, - "end": 16392, + "start": 16632, + "end": 16633, "loc": { "start": { - "line": 395, + "line": 406, "column": 73 }, "end": { - "line": 395, + "line": 406, "column": 74 } } @@ -82729,15 +85294,15 @@ "binop": null, "updateContext": null }, - "start": 16392, - "end": 16393, + "start": 16633, + "end": 16634, "loc": { "start": { - "line": 395, + "line": 406, "column": 74 }, "end": { - "line": 395, + "line": 406, "column": 75 } } @@ -82755,15 +85320,15 @@ "binop": null }, "value": "log", - "start": 16414, - "end": 16417, + "start": 16655, + "end": 16658, "loc": { "start": { - "line": 396, + "line": 407, "column": 20 }, "end": { - "line": 396, + "line": 407, "column": 23 } } @@ -82780,15 +85345,15 @@ "postfix": false, "binop": null }, - "start": 16417, - "end": 16418, + "start": 16658, + "end": 16659, "loc": { "start": { - "line": 396, + "line": 407, "column": 23 }, "end": { - "line": 396, + "line": 407, "column": 24 } } @@ -82807,15 +85372,15 @@ "updateContext": null }, "value": "Converted metaobjects: ", - "start": 16418, - "end": 16443, + "start": 16659, + "end": 16684, "loc": { "start": { - "line": 396, + "line": 407, "column": 24 }, "end": { - "line": 396, + "line": 407, "column": 49 } } @@ -82834,15 +85399,15 @@ "updateContext": null }, "value": "+", - "start": 16444, - "end": 16445, + "start": 16685, + "end": 16686, "loc": { "start": { - "line": 396, + "line": 407, "column": 50 }, "end": { - "line": 396, + "line": 407, "column": 51 } } @@ -82860,15 +85425,15 @@ "binop": null }, "value": "stats", - "start": 16446, - "end": 16451, + "start": 16687, + "end": 16692, "loc": { "start": { - "line": 396, + "line": 407, "column": 52 }, "end": { - "line": 396, + "line": 407, "column": 57 } } @@ -82886,15 +85451,15 @@ "binop": null, "updateContext": null }, - "start": 16451, - "end": 16452, + "start": 16692, + "end": 16693, "loc": { "start": { - "line": 396, + "line": 407, "column": 57 }, "end": { - "line": 396, + "line": 407, "column": 58 } } @@ -82912,15 +85477,15 @@ "binop": null }, "value": "numMetaObjects", - "start": 16452, - "end": 16466, + "start": 16693, + "end": 16707, "loc": { "start": { - "line": 396, + "line": 407, "column": 58 }, "end": { - "line": 396, + "line": 407, "column": 72 } } @@ -82937,15 +85502,15 @@ "postfix": false, "binop": null }, - "start": 16466, - "end": 16467, + "start": 16707, + "end": 16708, "loc": { "start": { - "line": 396, + "line": 407, "column": 72 }, "end": { - "line": 396, + "line": 407, "column": 73 } } @@ -82963,15 +85528,15 @@ "binop": null, "updateContext": null }, - "start": 16467, - "end": 16468, + "start": 16708, + "end": 16709, "loc": { "start": { - "line": 396, + "line": 407, "column": 73 }, "end": { - "line": 396, + "line": 407, "column": 74 } } @@ -82989,15 +85554,15 @@ "binop": null }, "value": "log", - "start": 16489, - "end": 16492, + "start": 16730, + "end": 16733, "loc": { "start": { - "line": 397, + "line": 408, "column": 20 }, "end": { - "line": 397, + "line": 408, "column": 23 } } @@ -83014,15 +85579,15 @@ "postfix": false, "binop": null }, - "start": 16492, - "end": 16493, + "start": 16733, + "end": 16734, "loc": { "start": { - "line": 397, + "line": 408, "column": 23 }, "end": { - "line": 397, + "line": 408, "column": 24 } } @@ -83041,15 +85606,15 @@ "updateContext": null }, "value": "Converted property sets: ", - "start": 16493, - "end": 16520, + "start": 16734, + "end": 16761, "loc": { "start": { - "line": 397, + "line": 408, "column": 24 }, "end": { - "line": 397, + "line": 408, "column": 51 } } @@ -83068,15 +85633,15 @@ "updateContext": null }, "value": "+", - "start": 16521, - "end": 16522, + "start": 16762, + "end": 16763, "loc": { "start": { - "line": 397, + "line": 408, "column": 52 }, "end": { - "line": 397, + "line": 408, "column": 53 } } @@ -83094,15 +85659,15 @@ "binop": null }, "value": "stats", - "start": 16523, - "end": 16528, + "start": 16764, + "end": 16769, "loc": { "start": { - "line": 397, + "line": 408, "column": 54 }, "end": { - "line": 397, + "line": 408, "column": 59 } } @@ -83120,15 +85685,15 @@ "binop": null, "updateContext": null }, - "start": 16528, - "end": 16529, + "start": 16769, + "end": 16770, "loc": { "start": { - "line": 397, + "line": 408, "column": 59 }, "end": { - "line": 397, + "line": 408, "column": 60 } } @@ -83146,15 +85711,15 @@ "binop": null }, "value": "numPropertySets", - "start": 16529, - "end": 16544, + "start": 16770, + "end": 16785, "loc": { "start": { - "line": 397, + "line": 408, "column": 60 }, "end": { - "line": 397, + "line": 408, "column": 75 } } @@ -83171,15 +85736,15 @@ "postfix": false, "binop": null }, - "start": 16544, - "end": 16545, + "start": 16785, + "end": 16786, "loc": { "start": { - "line": 397, + "line": 408, "column": 75 }, "end": { - "line": 397, + "line": 408, "column": 76 } } @@ -83197,15 +85762,15 @@ "binop": null, "updateContext": null }, - "start": 16545, - "end": 16546, + "start": 16786, + "end": 16787, "loc": { "start": { - "line": 397, + "line": 408, "column": 76 }, "end": { - "line": 397, + "line": 408, "column": 77 } } @@ -83223,15 +85788,15 @@ "binop": null }, "value": "log", - "start": 16567, - "end": 16570, + "start": 16808, + "end": 16811, "loc": { "start": { - "line": 398, + "line": 409, "column": 20 }, "end": { - "line": 398, + "line": 409, "column": 23 } } @@ -83248,15 +85813,15 @@ "postfix": false, "binop": null }, - "start": 16570, - "end": 16571, + "start": 16811, + "end": 16812, "loc": { "start": { - "line": 398, + "line": 409, "column": 23 }, "end": { - "line": 398, + "line": 409, "column": 24 } } @@ -83275,15 +85840,15 @@ "updateContext": null }, "value": "Converted drawable objects: ", - "start": 16571, - "end": 16601, + "start": 16812, + "end": 16842, "loc": { "start": { - "line": 398, + "line": 409, "column": 24 }, "end": { - "line": 398, + "line": 409, "column": 54 } } @@ -83302,15 +85867,15 @@ "updateContext": null }, "value": "+", - "start": 16602, - "end": 16603, + "start": 16843, + "end": 16844, "loc": { "start": { - "line": 398, + "line": 409, "column": 55 }, "end": { - "line": 398, + "line": 409, "column": 56 } } @@ -83328,15 +85893,15 @@ "binop": null }, "value": "stats", - "start": 16604, - "end": 16609, + "start": 16845, + "end": 16850, "loc": { "start": { - "line": 398, + "line": 409, "column": 57 }, "end": { - "line": 398, + "line": 409, "column": 62 } } @@ -83354,15 +85919,15 @@ "binop": null, "updateContext": null }, - "start": 16609, - "end": 16610, + "start": 16850, + "end": 16851, "loc": { "start": { - "line": 398, + "line": 409, "column": 62 }, "end": { - "line": 398, + "line": 409, "column": 63 } } @@ -83380,15 +85945,15 @@ "binop": null }, "value": "numObjects", - "start": 16610, - "end": 16620, + "start": 16851, + "end": 16861, "loc": { "start": { - "line": 398, + "line": 409, "column": 63 }, "end": { - "line": 398, + "line": 409, "column": 73 } } @@ -83405,15 +85970,15 @@ "postfix": false, "binop": null }, - "start": 16620, - "end": 16621, + "start": 16861, + "end": 16862, "loc": { "start": { - "line": 398, + "line": 409, "column": 73 }, "end": { - "line": 398, + "line": 409, "column": 74 } } @@ -83431,15 +85996,15 @@ "binop": null, "updateContext": null }, - "start": 16621, - "end": 16622, + "start": 16862, + "end": 16863, "loc": { "start": { - "line": 398, + "line": 409, "column": 74 }, "end": { - "line": 398, + "line": 409, "column": 75 } } @@ -83457,15 +86022,15 @@ "binop": null }, "value": "log", - "start": 16643, - "end": 16646, + "start": 16884, + "end": 16887, "loc": { "start": { - "line": 399, + "line": 410, "column": 20 }, "end": { - "line": 399, + "line": 410, "column": 23 } } @@ -83482,15 +86047,15 @@ "postfix": false, "binop": null }, - "start": 16646, - "end": 16647, + "start": 16887, + "end": 16888, "loc": { "start": { - "line": 399, + "line": 410, "column": 23 }, "end": { - "line": 399, + "line": 410, "column": 24 } } @@ -83509,15 +86074,15 @@ "updateContext": null }, "value": "Converted geometries: ", - "start": 16647, - "end": 16671, + "start": 16888, + "end": 16912, "loc": { "start": { - "line": 399, + "line": 410, "column": 24 }, "end": { - "line": 399, + "line": 410, "column": 48 } } @@ -83536,15 +86101,15 @@ "updateContext": null }, "value": "+", - "start": 16672, - "end": 16673, + "start": 16913, + "end": 16914, "loc": { "start": { - "line": 399, + "line": 410, "column": 49 }, "end": { - "line": 399, + "line": 410, "column": 50 } } @@ -83562,15 +86127,15 @@ "binop": null }, "value": "stats", - "start": 16674, - "end": 16679, + "start": 16915, + "end": 16920, "loc": { "start": { - "line": 399, + "line": 410, "column": 51 }, "end": { - "line": 399, + "line": 410, "column": 56 } } @@ -83588,15 +86153,15 @@ "binop": null, "updateContext": null }, - "start": 16679, - "end": 16680, + "start": 16920, + "end": 16921, "loc": { "start": { - "line": 399, + "line": 410, "column": 56 }, "end": { - "line": 399, + "line": 410, "column": 57 } } @@ -83614,15 +86179,15 @@ "binop": null }, "value": "numGeometries", - "start": 16680, - "end": 16693, + "start": 16921, + "end": 16934, "loc": { "start": { - "line": 399, + "line": 410, "column": 57 }, "end": { - "line": 399, + "line": 410, "column": 70 } } @@ -83639,15 +86204,15 @@ "postfix": false, "binop": null }, - "start": 16693, - "end": 16694, + "start": 16934, + "end": 16935, "loc": { "start": { - "line": 399, + "line": 410, "column": 70 }, "end": { - "line": 399, + "line": 410, "column": 71 } } @@ -83665,15 +86230,15 @@ "binop": null, "updateContext": null }, - "start": 16694, - "end": 16695, + "start": 16935, + "end": 16936, "loc": { "start": { - "line": 399, + "line": 410, "column": 71 }, "end": { - "line": 399, + "line": 410, "column": 72 } } @@ -83691,15 +86256,15 @@ "binop": null }, "value": "log", - "start": 16716, - "end": 16719, + "start": 16957, + "end": 16960, "loc": { "start": { - "line": 400, + "line": 411, "column": 20 }, "end": { - "line": 400, + "line": 411, "column": 23 } } @@ -83716,15 +86281,15 @@ "postfix": false, "binop": null }, - "start": 16719, - "end": 16720, + "start": 16960, + "end": 16961, "loc": { "start": { - "line": 400, + "line": 411, "column": 23 }, "end": { - "line": 400, + "line": 411, "column": 24 } } @@ -83743,15 +86308,15 @@ "updateContext": null }, "value": "Converted textures: ", - "start": 16720, - "end": 16742, + "start": 16961, + "end": 16983, "loc": { "start": { - "line": 400, + "line": 411, "column": 24 }, "end": { - "line": 400, + "line": 411, "column": 46 } } @@ -83770,15 +86335,15 @@ "updateContext": null }, "value": "+", - "start": 16743, - "end": 16744, + "start": 16984, + "end": 16985, "loc": { "start": { - "line": 400, + "line": 411, "column": 47 }, "end": { - "line": 400, + "line": 411, "column": 48 } } @@ -83796,15 +86361,15 @@ "binop": null }, "value": "stats", - "start": 16745, - "end": 16750, + "start": 16986, + "end": 16991, "loc": { "start": { - "line": 400, + "line": 411, "column": 49 }, "end": { - "line": 400, + "line": 411, "column": 54 } } @@ -83822,15 +86387,15 @@ "binop": null, "updateContext": null }, - "start": 16750, - "end": 16751, + "start": 16991, + "end": 16992, "loc": { "start": { - "line": 400, + "line": 411, "column": 54 }, "end": { - "line": 400, + "line": 411, "column": 55 } } @@ -83848,15 +86413,15 @@ "binop": null }, "value": "numTextures", - "start": 16751, - "end": 16762, + "start": 16992, + "end": 17003, "loc": { "start": { - "line": 400, + "line": 411, "column": 55 }, "end": { - "line": 400, + "line": 411, "column": 66 } } @@ -83873,15 +86438,15 @@ "postfix": false, "binop": null }, - "start": 16762, - "end": 16763, + "start": 17003, + "end": 17004, "loc": { "start": { - "line": 400, + "line": 411, "column": 66 }, "end": { - "line": 400, + "line": 411, "column": 67 } } @@ -83899,15 +86464,15 @@ "binop": null, "updateContext": null }, - "start": 16763, - "end": 16764, + "start": 17004, + "end": 17005, "loc": { "start": { - "line": 400, + "line": 411, "column": 67 }, "end": { - "line": 400, + "line": 411, "column": 68 } } @@ -83925,15 +86490,15 @@ "binop": null }, "value": "log", - "start": 16785, - "end": 16788, + "start": 17026, + "end": 17029, "loc": { "start": { - "line": 401, + "line": 412, "column": 20 }, "end": { - "line": 401, + "line": 412, "column": 23 } } @@ -83950,15 +86515,15 @@ "postfix": false, "binop": null }, - "start": 16788, - "end": 16789, + "start": 17029, + "end": 17030, "loc": { "start": { - "line": 401, + "line": 412, "column": 23 }, "end": { - "line": 401, + "line": 412, "column": 24 } } @@ -83977,15 +86542,15 @@ "updateContext": null }, "value": "Converted textureSets: ", - "start": 16789, - "end": 16814, + "start": 17030, + "end": 17055, "loc": { "start": { - "line": 401, + "line": 412, "column": 24 }, "end": { - "line": 401, + "line": 412, "column": 49 } } @@ -84004,15 +86569,15 @@ "updateContext": null }, "value": "+", - "start": 16815, - "end": 16816, + "start": 17056, + "end": 17057, "loc": { "start": { - "line": 401, + "line": 412, "column": 50 }, "end": { - "line": 401, + "line": 412, "column": 51 } } @@ -84030,15 +86595,15 @@ "binop": null }, "value": "stats", - "start": 16817, - "end": 16822, + "start": 17058, + "end": 17063, "loc": { "start": { - "line": 401, + "line": 412, "column": 52 }, "end": { - "line": 401, + "line": 412, "column": 57 } } @@ -84056,15 +86621,15 @@ "binop": null, "updateContext": null }, - "start": 16822, - "end": 16823, + "start": 17063, + "end": 17064, "loc": { "start": { - "line": 401, + "line": 412, "column": 57 }, "end": { - "line": 401, + "line": 412, "column": 58 } } @@ -84082,15 +86647,15 @@ "binop": null }, "value": "numTextureSets", - "start": 16823, - "end": 16837, + "start": 17064, + "end": 17078, "loc": { "start": { - "line": 401, + "line": 412, "column": 58 }, "end": { - "line": 401, + "line": 412, "column": 72 } } @@ -84107,15 +86672,15 @@ "postfix": false, "binop": null }, - "start": 16837, - "end": 16838, + "start": 17078, + "end": 17079, "loc": { "start": { - "line": 401, + "line": 412, "column": 72 }, "end": { - "line": 401, + "line": 412, "column": 73 } } @@ -84133,15 +86698,15 @@ "binop": null, "updateContext": null }, - "start": 16838, - "end": 16839, + "start": 17079, + "end": 17080, "loc": { "start": { - "line": 401, + "line": 412, "column": 73 }, "end": { - "line": 401, + "line": 412, "column": 74 } } @@ -84159,15 +86724,15 @@ "binop": null }, "value": "log", - "start": 16860, - "end": 16863, + "start": 17101, + "end": 17104, "loc": { "start": { - "line": 402, + "line": 413, "column": 20 }, "end": { - "line": 402, + "line": 413, "column": 23 } } @@ -84184,15 +86749,15 @@ "postfix": false, "binop": null }, - "start": 16863, - "end": 16864, + "start": 17104, + "end": 17105, "loc": { "start": { - "line": 402, + "line": 413, "column": 23 }, "end": { - "line": 402, + "line": 413, "column": 24 } } @@ -84211,15 +86776,15 @@ "updateContext": null }, "value": "Converted triangles: ", - "start": 16864, - "end": 16887, + "start": 17105, + "end": 17128, "loc": { "start": { - "line": 402, + "line": 413, "column": 24 }, "end": { - "line": 402, + "line": 413, "column": 47 } } @@ -84238,15 +86803,15 @@ "updateContext": null }, "value": "+", - "start": 16888, - "end": 16889, + "start": 17129, + "end": 17130, "loc": { "start": { - "line": 402, + "line": 413, "column": 48 }, "end": { - "line": 402, + "line": 413, "column": 49 } } @@ -84264,15 +86829,15 @@ "binop": null }, "value": "stats", - "start": 16890, - "end": 16895, + "start": 17131, + "end": 17136, "loc": { "start": { - "line": 402, + "line": 413, "column": 50 }, "end": { - "line": 402, + "line": 413, "column": 55 } } @@ -84290,15 +86855,15 @@ "binop": null, "updateContext": null }, - "start": 16895, - "end": 16896, + "start": 17136, + "end": 17137, "loc": { "start": { - "line": 402, + "line": 413, "column": 55 }, "end": { - "line": 402, + "line": 413, "column": 56 } } @@ -84316,15 +86881,15 @@ "binop": null }, "value": "numTriangles", - "start": 16896, - "end": 16908, + "start": 17137, + "end": 17149, "loc": { "start": { - "line": 402, + "line": 413, "column": 56 }, "end": { - "line": 402, + "line": 413, "column": 68 } } @@ -84341,15 +86906,15 @@ "postfix": false, "binop": null }, - "start": 16908, - "end": 16909, + "start": 17149, + "end": 17150, "loc": { "start": { - "line": 402, + "line": 413, "column": 68 }, "end": { - "line": 402, + "line": 413, "column": 69 } } @@ -84367,15 +86932,15 @@ "binop": null, "updateContext": null }, - "start": 16909, - "end": 16910, + "start": 17150, + "end": 17151, "loc": { "start": { - "line": 402, + "line": 413, "column": 69 }, "end": { - "line": 402, + "line": 413, "column": 70 } } @@ -84393,15 +86958,15 @@ "binop": null }, "value": "log", - "start": 16931, - "end": 16934, + "start": 17172, + "end": 17175, "loc": { "start": { - "line": 403, + "line": 414, "column": 20 }, "end": { - "line": 403, + "line": 414, "column": 23 } } @@ -84418,15 +86983,15 @@ "postfix": false, "binop": null }, - "start": 16934, - "end": 16935, + "start": 17175, + "end": 17176, "loc": { "start": { - "line": 403, + "line": 414, "column": 23 }, "end": { - "line": 403, + "line": 414, "column": 24 } } @@ -84445,15 +87010,15 @@ "updateContext": null }, "value": "Converted vertices: ", - "start": 16935, - "end": 16957, + "start": 17176, + "end": 17198, "loc": { "start": { - "line": 403, + "line": 414, "column": 24 }, "end": { - "line": 403, + "line": 414, "column": 46 } } @@ -84472,15 +87037,15 @@ "updateContext": null }, "value": "+", - "start": 16958, - "end": 16959, + "start": 17199, + "end": 17200, "loc": { "start": { - "line": 403, + "line": 414, "column": 47 }, "end": { - "line": 403, + "line": 414, "column": 48 } } @@ -84498,15 +87063,15 @@ "binop": null }, "value": "stats", - "start": 16960, - "end": 16965, + "start": 17201, + "end": 17206, "loc": { "start": { - "line": 403, + "line": 414, "column": 49 }, "end": { - "line": 403, + "line": 414, "column": 54 } } @@ -84524,15 +87089,15 @@ "binop": null, "updateContext": null }, - "start": 16965, - "end": 16966, + "start": 17206, + "end": 17207, "loc": { "start": { - "line": 403, + "line": 414, "column": 54 }, "end": { - "line": 403, + "line": 414, "column": 55 } } @@ -84550,15 +87115,15 @@ "binop": null }, "value": "numVertices", - "start": 16966, - "end": 16977, + "start": 17207, + "end": 17218, "loc": { "start": { - "line": 403, + "line": 414, "column": 55 }, "end": { - "line": 403, + "line": 414, "column": 66 } } @@ -84575,15 +87140,15 @@ "postfix": false, "binop": null }, - "start": 16977, - "end": 16978, + "start": 17218, + "end": 17219, "loc": { "start": { - "line": 403, + "line": 414, "column": 66 }, "end": { - "line": 403, + "line": 414, "column": 67 } } @@ -84601,15 +87166,15 @@ "binop": null, "updateContext": null }, - "start": 16978, - "end": 16979, + "start": 17219, + "end": 17220, "loc": { "start": { - "line": 403, + "line": 414, "column": 67 }, "end": { - "line": 403, + "line": 414, "column": 68 } } @@ -84627,15 +87192,15 @@ "binop": null }, "value": "log", - "start": 17000, - "end": 17003, + "start": 17241, + "end": 17244, "loc": { "start": { - "line": 404, + "line": 415, "column": 20 }, "end": { - "line": 404, + "line": 415, "column": 23 } } @@ -84652,15 +87217,15 @@ "postfix": false, "binop": null }, - "start": 17003, - "end": 17004, + "start": 17244, + "end": 17245, "loc": { "start": { - "line": 404, + "line": 415, "column": 23 }, "end": { - "line": 404, + "line": 415, "column": 24 } } @@ -84679,15 +87244,15 @@ "updateContext": null }, "value": "Converted UVs: ", - "start": 17004, - "end": 17021, + "start": 17245, + "end": 17262, "loc": { "start": { - "line": 404, + "line": 415, "column": 24 }, "end": { - "line": 404, + "line": 415, "column": 41 } } @@ -84706,15 +87271,15 @@ "updateContext": null }, "value": "+", - "start": 17022, - "end": 17023, + "start": 17263, + "end": 17264, "loc": { "start": { - "line": 404, + "line": 415, "column": 42 }, "end": { - "line": 404, + "line": 415, "column": 43 } } @@ -84732,15 +87297,15 @@ "binop": null }, "value": "stats", - "start": 17024, - "end": 17029, + "start": 17265, + "end": 17270, "loc": { "start": { - "line": 404, + "line": 415, "column": 44 }, "end": { - "line": 404, + "line": 415, "column": 49 } } @@ -84758,15 +87323,15 @@ "binop": null, "updateContext": null }, - "start": 17029, - "end": 17030, + "start": 17270, + "end": 17271, "loc": { "start": { - "line": 404, + "line": 415, "column": 49 }, "end": { - "line": 404, + "line": 415, "column": 50 } } @@ -84784,15 +87349,15 @@ "binop": null }, "value": "numUVs", - "start": 17030, - "end": 17036, + "start": 17271, + "end": 17277, "loc": { "start": { - "line": 404, + "line": 415, "column": 50 }, "end": { - "line": 404, + "line": 415, "column": 56 } } @@ -84809,15 +87374,15 @@ "postfix": false, "binop": null }, - "start": 17036, - "end": 17037, + "start": 17277, + "end": 17278, "loc": { "start": { - "line": 404, + "line": 415, "column": 56 }, "end": { - "line": 404, + "line": 415, "column": 57 } } @@ -84835,15 +87400,15 @@ "binop": null, "updateContext": null }, - "start": 17037, - "end": 17038, + "start": 17278, + "end": 17279, "loc": { "start": { - "line": 404, + "line": 415, "column": 57 }, "end": { - "line": 404, + "line": 415, "column": 58 } } @@ -84861,15 +87426,15 @@ "binop": null }, "value": "log", - "start": 17059, - "end": 17062, + "start": 17300, + "end": 17303, "loc": { "start": { - "line": 405, + "line": 416, "column": 20 }, "end": { - "line": 405, + "line": 416, "column": 23 } } @@ -84886,15 +87451,15 @@ "postfix": false, "binop": null }, - "start": 17062, - "end": 17063, + "start": 17303, + "end": 17304, "loc": { "start": { - "line": 405, + "line": 416, "column": 23 }, "end": { - "line": 405, + "line": 416, "column": 24 } } @@ -84913,15 +87478,15 @@ "updateContext": null }, "value": "Converted normals: ", - "start": 17063, - "end": 17084, + "start": 17304, + "end": 17325, "loc": { "start": { - "line": 405, + "line": 416, "column": 24 }, "end": { - "line": 405, + "line": 416, "column": 45 } } @@ -84940,15 +87505,15 @@ "updateContext": null }, "value": "+", - "start": 17085, - "end": 17086, + "start": 17326, + "end": 17327, "loc": { "start": { - "line": 405, + "line": 416, "column": 46 }, "end": { - "line": 405, + "line": 416, "column": 47 } } @@ -84966,15 +87531,15 @@ "binop": null }, "value": "stats", - "start": 17087, - "end": 17092, + "start": 17328, + "end": 17333, "loc": { "start": { - "line": 405, + "line": 416, "column": 48 }, "end": { - "line": 405, + "line": 416, "column": 53 } } @@ -84992,15 +87557,15 @@ "binop": null, "updateContext": null }, - "start": 17092, - "end": 17093, + "start": 17333, + "end": 17334, "loc": { "start": { - "line": 405, + "line": 416, "column": 53 }, "end": { - "line": 405, + "line": 416, "column": 54 } } @@ -85018,15 +87583,15 @@ "binop": null }, "value": "numNormals", - "start": 17093, - "end": 17103, + "start": 17334, + "end": 17344, "loc": { "start": { - "line": 405, + "line": 416, "column": 54 }, "end": { - "line": 405, + "line": 416, "column": 64 } } @@ -85043,15 +87608,15 @@ "postfix": false, "binop": null }, - "start": 17103, - "end": 17104, + "start": 17344, + "end": 17345, "loc": { "start": { - "line": 405, + "line": 416, "column": 64 }, "end": { - "line": 405, + "line": 416, "column": 65 } } @@ -85069,15 +87634,15 @@ "binop": null, "updateContext": null }, - "start": 17104, - "end": 17105, + "start": 17345, + "end": 17346, "loc": { "start": { - "line": 405, + "line": 416, "column": 65 }, "end": { - "line": 405, + "line": 416, "column": 66 } } @@ -85095,15 +87660,15 @@ "binop": null }, "value": "log", - "start": 17126, - "end": 17129, + "start": 17367, + "end": 17370, "loc": { "start": { - "line": 406, + "line": 417, "column": 20 }, "end": { - "line": 406, + "line": 417, "column": 23 } } @@ -85120,15 +87685,15 @@ "postfix": false, "binop": null }, - "start": 17129, - "end": 17130, + "start": 17370, + "end": 17371, "loc": { "start": { - "line": 406, + "line": 417, "column": 23 }, "end": { - "line": 406, + "line": 417, "column": 24 } } @@ -85147,15 +87712,15 @@ "updateContext": null }, "value": "Converted tiles: ", - "start": 17130, - "end": 17149, + "start": 17371, + "end": 17390, "loc": { "start": { - "line": 406, + "line": 417, "column": 24 }, "end": { - "line": 406, + "line": 417, "column": 43 } } @@ -85174,15 +87739,15 @@ "updateContext": null }, "value": "+", - "start": 17150, - "end": 17151, + "start": 17391, + "end": 17392, "loc": { "start": { - "line": 406, + "line": 417, "column": 44 }, "end": { - "line": 406, + "line": 417, "column": 45 } } @@ -85200,15 +87765,15 @@ "binop": null }, "value": "xktModel", - "start": 17152, - "end": 17160, + "start": 17393, + "end": 17401, "loc": { "start": { - "line": 406, + "line": 417, "column": 46 }, "end": { - "line": 406, + "line": 417, "column": 54 } } @@ -85226,15 +87791,15 @@ "binop": null, "updateContext": null }, - "start": 17160, - "end": 17161, + "start": 17401, + "end": 17402, "loc": { "start": { - "line": 406, + "line": 417, "column": 54 }, "end": { - "line": 406, + "line": 417, "column": 55 } } @@ -85252,15 +87817,15 @@ "binop": null }, "value": "tilesList", - "start": 17161, - "end": 17170, + "start": 17402, + "end": 17411, "loc": { "start": { - "line": 406, + "line": 417, "column": 55 }, "end": { - "line": 406, + "line": 417, "column": 64 } } @@ -85278,15 +87843,15 @@ "binop": null, "updateContext": null }, - "start": 17170, - "end": 17171, + "start": 17411, + "end": 17412, "loc": { "start": { - "line": 406, + "line": 417, "column": 64 }, "end": { - "line": 406, + "line": 417, "column": 65 } } @@ -85304,15 +87869,15 @@ "binop": null }, "value": "length", - "start": 17171, - "end": 17177, + "start": 17412, + "end": 17418, "loc": { "start": { - "line": 406, + "line": 417, "column": 65 }, "end": { - "line": 406, + "line": 417, "column": 71 } } @@ -85329,15 +87894,15 @@ "postfix": false, "binop": null }, - "start": 17177, - "end": 17178, + "start": 17418, + "end": 17419, "loc": { "start": { - "line": 406, + "line": 417, "column": 71 }, "end": { - "line": 406, + "line": 417, "column": 72 } } @@ -85355,15 +87920,15 @@ "binop": null, "updateContext": null }, - "start": 17178, - "end": 17179, + "start": 17419, + "end": 17420, "loc": { "start": { - "line": 406, + "line": 417, "column": 72 }, "end": { - "line": 406, + "line": 417, "column": 73 } } @@ -85381,15 +87946,15 @@ "binop": null }, "value": "log", - "start": 17200, - "end": 17203, + "start": 17441, + "end": 17444, "loc": { "start": { - "line": 407, + "line": 418, "column": 20 }, "end": { - "line": 407, + "line": 418, "column": 23 } } @@ -85406,15 +87971,15 @@ "postfix": false, "binop": null }, - "start": 17203, - "end": 17204, + "start": 17444, + "end": 17445, "loc": { "start": { - "line": 407, + "line": 418, "column": 23 }, "end": { - "line": 407, + "line": 418, "column": 24 } } @@ -85433,15 +87998,15 @@ "updateContext": null }, "value": "minTileSize: ", - "start": 17204, - "end": 17219, + "start": 17445, + "end": 17460, "loc": { "start": { - "line": 407, + "line": 418, "column": 24 }, "end": { - "line": 407, + "line": 418, "column": 39 } } @@ -85460,15 +88025,15 @@ "updateContext": null }, "value": "+", - "start": 17220, - "end": 17221, + "start": 17461, + "end": 17462, "loc": { "start": { - "line": 407, + "line": 418, "column": 40 }, "end": { - "line": 407, + "line": 418, "column": 41 } } @@ -85486,15 +88051,15 @@ "binop": null }, "value": "stats", - "start": 17222, - "end": 17227, + "start": 17463, + "end": 17468, "loc": { "start": { - "line": 407, + "line": 418, "column": 42 }, "end": { - "line": 407, + "line": 418, "column": 47 } } @@ -85512,15 +88077,15 @@ "binop": null, "updateContext": null }, - "start": 17227, - "end": 17228, + "start": 17468, + "end": 17469, "loc": { "start": { - "line": 407, + "line": 418, "column": 47 }, "end": { - "line": 407, + "line": 418, "column": 48 } } @@ -85538,15 +88103,15 @@ "binop": null }, "value": "minTileSize", - "start": 17228, - "end": 17239, + "start": 17469, + "end": 17480, "loc": { "start": { - "line": 407, + "line": 418, "column": 48 }, "end": { - "line": 407, + "line": 418, "column": 59 } } @@ -85563,15 +88128,15 @@ "postfix": false, "binop": null }, - "start": 17239, - "end": 17240, + "start": 17480, + "end": 17481, "loc": { "start": { - "line": 407, + "line": 418, "column": 59 }, "end": { - "line": 407, + "line": 418, "column": 60 } } @@ -85589,15 +88154,15 @@ "binop": null, "updateContext": null }, - "start": 17240, - "end": 17241, + "start": 17481, + "end": 17482, "loc": { "start": { - "line": 407, + "line": 418, "column": 60 }, "end": { - "line": 407, + "line": 418, "column": 61 } } @@ -85617,15 +88182,15 @@ "updateContext": null }, "value": "if", - "start": 17263, - "end": 17265, + "start": 17504, + "end": 17506, "loc": { "start": { - "line": 409, + "line": 420, "column": 20 }, "end": { - "line": 409, + "line": 420, "column": 22 } } @@ -85642,15 +88207,15 @@ "postfix": false, "binop": null }, - "start": 17266, - "end": 17267, + "start": 17507, + "end": 17508, "loc": { "start": { - "line": 409, + "line": 420, "column": 23 }, "end": { - "line": 409, + "line": 420, "column": 24 } } @@ -85668,15 +88233,15 @@ "binop": null }, "value": "output", - "start": 17267, - "end": 17273, + "start": 17508, + "end": 17514, "loc": { "start": { - "line": 409, + "line": 420, "column": 24 }, "end": { - "line": 409, + "line": 420, "column": 30 } } @@ -85693,15 +88258,15 @@ "postfix": false, "binop": null }, - "start": 17273, - "end": 17274, + "start": 17514, + "end": 17515, "loc": { "start": { - "line": 409, + "line": 420, "column": 30 }, "end": { - "line": 409, + "line": 420, "column": 31 } } @@ -85718,15 +88283,15 @@ "postfix": false, "binop": null }, - "start": 17275, - "end": 17276, + "start": 17516, + "end": 17517, "loc": { "start": { - "line": 409, + "line": 420, "column": 32 }, "end": { - "line": 409, + "line": 420, "column": 33 } } @@ -85746,15 +88311,15 @@ "updateContext": null }, "value": "const", - "start": 17301, - "end": 17306, + "start": 17542, + "end": 17547, "loc": { "start": { - "line": 410, + "line": 421, "column": 24 }, "end": { - "line": 410, + "line": 421, "column": 29 } } @@ -85772,15 +88337,15 @@ "binop": null }, "value": "outputDir", - "start": 17307, - "end": 17316, + "start": 17548, + "end": 17557, "loc": { "start": { - "line": 410, + "line": 421, "column": 30 }, "end": { - "line": 410, + "line": 421, "column": 39 } } @@ -85799,15 +88364,15 @@ "updateContext": null }, "value": "=", - "start": 17317, - "end": 17318, + "start": 17558, + "end": 17559, "loc": { "start": { - "line": 410, + "line": 421, "column": 40 }, "end": { - "line": 410, + "line": 421, "column": 41 } } @@ -85825,15 +88390,15 @@ "binop": null }, "value": "path", - "start": 17319, - "end": 17323, + "start": 17560, + "end": 17564, "loc": { "start": { - "line": 410, + "line": 421, "column": 42 }, "end": { - "line": 410, + "line": 421, "column": 46 } } @@ -85851,15 +88416,15 @@ "binop": null, "updateContext": null }, - "start": 17323, - "end": 17324, + "start": 17564, + "end": 17565, "loc": { "start": { - "line": 410, + "line": 421, "column": 46 }, "end": { - "line": 410, + "line": 421, "column": 47 } } @@ -85877,15 +88442,15 @@ "binop": null }, "value": "dirname", - "start": 17324, - "end": 17331, + "start": 17565, + "end": 17572, "loc": { "start": { - "line": 410, + "line": 421, "column": 47 }, "end": { - "line": 410, + "line": 421, "column": 54 } } @@ -85902,15 +88467,15 @@ "postfix": false, "binop": null }, - "start": 17331, - "end": 17332, + "start": 17572, + "end": 17573, "loc": { "start": { - "line": 410, + "line": 421, "column": 54 }, "end": { - "line": 410, + "line": 421, "column": 55 } } @@ -85928,15 +88493,15 @@ "binop": null }, "value": "output", - "start": 17332, - "end": 17338, + "start": 17573, + "end": 17579, "loc": { "start": { - "line": 410, + "line": 421, "column": 55 }, "end": { - "line": 410, + "line": 421, "column": 61 } } @@ -85953,15 +88518,15 @@ "postfix": false, "binop": null }, - "start": 17338, - "end": 17339, + "start": 17579, + "end": 17580, "loc": { "start": { - "line": 410, + "line": 421, "column": 61 }, "end": { - "line": 410, + "line": 421, "column": 62 } } @@ -85979,15 +88544,15 @@ "binop": null, "updateContext": null }, - "start": 17339, - "end": 17340, + "start": 17580, + "end": 17581, "loc": { "start": { - "line": 410, + "line": 421, "column": 62 }, "end": { - "line": 410, + "line": 421, "column": 63 } } @@ -86007,15 +88572,15 @@ "updateContext": null }, "value": "if", - "start": 17365, - "end": 17367, + "start": 17606, + "end": 17608, "loc": { "start": { - "line": 411, + "line": 422, "column": 24 }, "end": { - "line": 411, + "line": 422, "column": 26 } } @@ -86032,15 +88597,15 @@ "postfix": false, "binop": null }, - "start": 17368, - "end": 17369, + "start": 17609, + "end": 17610, "loc": { "start": { - "line": 411, + "line": 422, "column": 27 }, "end": { - "line": 411, + "line": 422, "column": 28 } } @@ -86058,15 +88623,15 @@ "binop": null }, "value": "outputDir", - "start": 17369, - "end": 17378, + "start": 17610, + "end": 17619, "loc": { "start": { - "line": 411, + "line": 422, "column": 28 }, "end": { - "line": 411, + "line": 422, "column": 37 } } @@ -86085,15 +88650,15 @@ "updateContext": null }, "value": "!==", - "start": 17379, - "end": 17382, + "start": 17620, + "end": 17623, "loc": { "start": { - "line": 411, + "line": 422, "column": 38 }, "end": { - "line": 411, + "line": 422, "column": 41 } } @@ -86112,15 +88677,15 @@ "updateContext": null }, "value": "", - "start": 17383, - "end": 17385, + "start": 17624, + "end": 17626, "loc": { "start": { - "line": 411, + "line": 422, "column": 42 }, "end": { - "line": 411, + "line": 422, "column": 44 } } @@ -86139,15 +88704,15 @@ "updateContext": null }, "value": "&&", - "start": 17386, - "end": 17388, + "start": 17627, + "end": 17629, "loc": { "start": { - "line": 411, + "line": 422, "column": 45 }, "end": { - "line": 411, + "line": 422, "column": 47 } } @@ -86166,15 +88731,15 @@ "updateContext": null }, "value": "!", - "start": 17389, - "end": 17390, + "start": 17630, + "end": 17631, "loc": { "start": { - "line": 411, + "line": 422, "column": 48 }, "end": { - "line": 411, + "line": 422, "column": 49 } } @@ -86192,15 +88757,15 @@ "binop": null }, "value": "fs", - "start": 17390, - "end": 17392, + "start": 17631, + "end": 17633, "loc": { "start": { - "line": 411, + "line": 422, "column": 49 }, "end": { - "line": 411, + "line": 422, "column": 51 } } @@ -86218,15 +88783,15 @@ "binop": null, "updateContext": null }, - "start": 17392, - "end": 17393, + "start": 17633, + "end": 17634, "loc": { "start": { - "line": 411, + "line": 422, "column": 51 }, "end": { - "line": 411, + "line": 422, "column": 52 } } @@ -86244,15 +88809,15 @@ "binop": null }, "value": "existsSync", - "start": 17393, - "end": 17403, + "start": 17634, + "end": 17644, "loc": { "start": { - "line": 411, + "line": 422, "column": 52 }, "end": { - "line": 411, + "line": 422, "column": 62 } } @@ -86269,15 +88834,15 @@ "postfix": false, "binop": null }, - "start": 17403, - "end": 17404, + "start": 17644, + "end": 17645, "loc": { "start": { - "line": 411, + "line": 422, "column": 62 }, "end": { - "line": 411, + "line": 422, "column": 63 } } @@ -86295,15 +88860,15 @@ "binop": null }, "value": "outputDir", - "start": 17404, - "end": 17413, + "start": 17645, + "end": 17654, "loc": { "start": { - "line": 411, + "line": 422, "column": 63 }, "end": { - "line": 411, + "line": 422, "column": 72 } } @@ -86320,15 +88885,15 @@ "postfix": false, "binop": null }, - "start": 17413, - "end": 17414, + "start": 17654, + "end": 17655, "loc": { "start": { - "line": 411, + "line": 422, "column": 72 }, "end": { - "line": 411, + "line": 422, "column": 73 } } @@ -86345,15 +88910,15 @@ "postfix": false, "binop": null }, - "start": 17414, - "end": 17415, + "start": 17655, + "end": 17656, "loc": { "start": { - "line": 411, + "line": 422, "column": 73 }, "end": { - "line": 411, + "line": 422, "column": 74 } } @@ -86370,15 +88935,15 @@ "postfix": false, "binop": null }, - "start": 17416, - "end": 17417, + "start": 17657, + "end": 17658, "loc": { "start": { - "line": 411, + "line": 422, "column": 75 }, "end": { - "line": 411, + "line": 422, "column": 76 } } @@ -86396,15 +88961,15 @@ "binop": null }, "value": "fs", - "start": 17446, - "end": 17448, + "start": 17687, + "end": 17689, "loc": { "start": { - "line": 412, + "line": 423, "column": 28 }, "end": { - "line": 412, + "line": 423, "column": 30 } } @@ -86422,15 +88987,15 @@ "binop": null, "updateContext": null }, - "start": 17448, - "end": 17449, + "start": 17689, + "end": 17690, "loc": { "start": { - "line": 412, + "line": 423, "column": 30 }, "end": { - "line": 412, + "line": 423, "column": 31 } } @@ -86448,15 +89013,15 @@ "binop": null }, "value": "mkdirSync", - "start": 17449, - "end": 17458, + "start": 17690, + "end": 17699, "loc": { "start": { - "line": 412, + "line": 423, "column": 31 }, "end": { - "line": 412, + "line": 423, "column": 40 } } @@ -86473,15 +89038,15 @@ "postfix": false, "binop": null }, - "start": 17458, - "end": 17459, + "start": 17699, + "end": 17700, "loc": { "start": { - "line": 412, + "line": 423, "column": 40 }, "end": { - "line": 412, + "line": 423, "column": 41 } } @@ -86499,15 +89064,15 @@ "binop": null }, "value": "outputDir", - "start": 17459, - "end": 17468, + "start": 17700, + "end": 17709, "loc": { "start": { - "line": 412, + "line": 423, "column": 41 }, "end": { - "line": 412, + "line": 423, "column": 50 } } @@ -86525,15 +89090,15 @@ "binop": null, "updateContext": null }, - "start": 17468, - "end": 17469, + "start": 17709, + "end": 17710, "loc": { "start": { - "line": 412, + "line": 423, "column": 50 }, "end": { - "line": 412, + "line": 423, "column": 51 } } @@ -86550,15 +89115,15 @@ "postfix": false, "binop": null }, - "start": 17470, - "end": 17471, + "start": 17711, + "end": 17712, "loc": { "start": { - "line": 412, + "line": 423, "column": 52 }, "end": { - "line": 412, + "line": 423, "column": 53 } } @@ -86576,15 +89141,15 @@ "binop": null }, "value": "recursive", - "start": 17471, - "end": 17480, + "start": 17712, + "end": 17721, "loc": { "start": { - "line": 412, + "line": 423, "column": 53 }, "end": { - "line": 412, + "line": 423, "column": 62 } } @@ -86602,15 +89167,15 @@ "binop": null, "updateContext": null }, - "start": 17480, - "end": 17481, + "start": 17721, + "end": 17722, "loc": { "start": { - "line": 412, + "line": 423, "column": 62 }, "end": { - "line": 412, + "line": 423, "column": 63 } } @@ -86630,15 +89195,15 @@ "updateContext": null }, "value": "true", - "start": 17482, - "end": 17486, + "start": 17723, + "end": 17727, "loc": { "start": { - "line": 412, + "line": 423, "column": 64 }, "end": { - "line": 412, + "line": 423, "column": 68 } } @@ -86655,15 +89220,15 @@ "postfix": false, "binop": null }, - "start": 17486, - "end": 17487, + "start": 17727, + "end": 17728, "loc": { "start": { - "line": 412, + "line": 423, "column": 68 }, "end": { - "line": 412, + "line": 423, "column": 69 } } @@ -86680,15 +89245,15 @@ "postfix": false, "binop": null }, - "start": 17487, - "end": 17488, + "start": 17728, + "end": 17729, "loc": { "start": { - "line": 412, + "line": 423, "column": 69 }, "end": { - "line": 412, + "line": 423, "column": 70 } } @@ -86706,15 +89271,15 @@ "binop": null, "updateContext": null }, - "start": 17488, - "end": 17489, + "start": 17729, + "end": 17730, "loc": { "start": { - "line": 412, + "line": 423, "column": 70 }, "end": { - "line": 412, + "line": 423, "column": 71 } } @@ -86731,15 +89296,15 @@ "postfix": false, "binop": null }, - "start": 17514, - "end": 17515, + "start": 17755, + "end": 17756, "loc": { "start": { - "line": 413, + "line": 424, "column": 24 }, "end": { - "line": 413, + "line": 424, "column": 25 } } @@ -86757,15 +89322,15 @@ "binop": null }, "value": "log", - "start": 17540, - "end": 17543, + "start": 17781, + "end": 17784, "loc": { "start": { - "line": 414, + "line": 425, "column": 24 }, "end": { - "line": 414, + "line": 425, "column": 27 } } @@ -86782,15 +89347,15 @@ "postfix": false, "binop": null }, - "start": 17543, - "end": 17544, + "start": 17784, + "end": 17785, "loc": { "start": { - "line": 414, + "line": 425, "column": 27 }, "end": { - "line": 414, + "line": 425, "column": 28 } } @@ -86809,15 +89374,15 @@ "updateContext": null }, "value": "Writing XKT file: ", - "start": 17544, - "end": 17564, + "start": 17785, + "end": 17805, "loc": { "start": { - "line": 414, + "line": 425, "column": 28 }, "end": { - "line": 414, + "line": 425, "column": 48 } } @@ -86836,15 +89401,15 @@ "updateContext": null }, "value": "+", - "start": 17565, - "end": 17566, + "start": 17806, + "end": 17807, "loc": { "start": { - "line": 414, + "line": 425, "column": 49 }, "end": { - "line": 414, + "line": 425, "column": 50 } } @@ -86862,15 +89427,15 @@ "binop": null }, "value": "output", - "start": 17567, - "end": 17573, + "start": 17808, + "end": 17814, "loc": { "start": { - "line": 414, + "line": 425, "column": 51 }, "end": { - "line": 414, + "line": 425, "column": 57 } } @@ -86887,15 +89452,15 @@ "postfix": false, "binop": null }, - "start": 17573, - "end": 17574, + "start": 17814, + "end": 17815, "loc": { "start": { - "line": 414, + "line": 425, "column": 57 }, "end": { - "line": 414, + "line": 425, "column": 58 } } @@ -86913,15 +89478,15 @@ "binop": null, "updateContext": null }, - "start": 17574, - "end": 17575, + "start": 17815, + "end": 17816, "loc": { "start": { - "line": 414, + "line": 425, "column": 58 }, "end": { - "line": 414, + "line": 425, "column": 59 } } @@ -86939,15 +89504,15 @@ "binop": null }, "value": "fs", - "start": 17600, - "end": 17602, + "start": 17841, + "end": 17843, "loc": { "start": { - "line": 415, + "line": 426, "column": 24 }, "end": { - "line": 415, + "line": 426, "column": 26 } } @@ -86965,15 +89530,15 @@ "binop": null, "updateContext": null }, - "start": 17602, - "end": 17603, + "start": 17843, + "end": 17844, "loc": { "start": { - "line": 415, + "line": 426, "column": 26 }, "end": { - "line": 415, + "line": 426, "column": 27 } } @@ -86991,15 +89556,15 @@ "binop": null }, "value": "writeFileSync", - "start": 17603, - "end": 17616, + "start": 17844, + "end": 17857, "loc": { "start": { - "line": 415, + "line": 426, "column": 27 }, "end": { - "line": 415, + "line": 426, "column": 40 } } @@ -87016,15 +89581,15 @@ "postfix": false, "binop": null }, - "start": 17616, - "end": 17617, + "start": 17857, + "end": 17858, "loc": { "start": { - "line": 415, + "line": 426, "column": 40 }, "end": { - "line": 415, + "line": 426, "column": 41 } } @@ -87042,15 +89607,15 @@ "binop": null }, "value": "output", - "start": 17617, - "end": 17623, + "start": 17858, + "end": 17864, "loc": { "start": { - "line": 415, + "line": 426, "column": 41 }, "end": { - "line": 415, + "line": 426, "column": 47 } } @@ -87068,15 +89633,15 @@ "binop": null, "updateContext": null }, - "start": 17623, - "end": 17624, + "start": 17864, + "end": 17865, "loc": { "start": { - "line": 415, + "line": 426, "column": 47 }, "end": { - "line": 415, + "line": 426, "column": 48 } } @@ -87094,15 +89659,15 @@ "binop": null }, "value": "xktContent", - "start": 17625, - "end": 17635, + "start": 17866, + "end": 17876, "loc": { "start": { - "line": 415, + "line": 426, "column": 49 }, "end": { - "line": 415, + "line": 426, "column": 59 } } @@ -87119,15 +89684,15 @@ "postfix": false, "binop": null }, - "start": 17635, - "end": 17636, + "start": 17876, + "end": 17877, "loc": { "start": { - "line": 415, + "line": 426, "column": 59 }, "end": { - "line": 415, + "line": 426, "column": 60 } } @@ -87145,15 +89710,15 @@ "binop": null, "updateContext": null }, - "start": 17636, - "end": 17637, + "start": 17877, + "end": 17878, "loc": { "start": { - "line": 415, + "line": 426, "column": 60 }, "end": { - "line": 415, + "line": 426, "column": 61 } } @@ -87170,15 +89735,15 @@ "postfix": false, "binop": null }, - "start": 17658, - "end": 17659, + "start": 17899, + "end": 17900, "loc": { "start": { - "line": 416, + "line": 427, "column": 20 }, "end": { - "line": 416, + "line": 427, "column": 21 } } @@ -87198,15 +89763,15 @@ "updateContext": null }, "value": "if", - "start": 17681, - "end": 17683, + "start": 17922, + "end": 17924, "loc": { "start": { - "line": 418, + "line": 429, "column": 20 }, "end": { - "line": 418, + "line": 429, "column": 22 } } @@ -87223,15 +89788,15 @@ "postfix": false, "binop": null }, - "start": 17684, - "end": 17685, + "start": 17925, + "end": 17926, "loc": { "start": { - "line": 418, + "line": 429, "column": 23 }, "end": { - "line": 418, + "line": 429, "column": 24 } } @@ -87249,15 +89814,15 @@ "binop": null }, "value": "outputXKTModel", - "start": 17685, - "end": 17699, + "start": 17926, + "end": 17940, "loc": { "start": { - "line": 418, + "line": 429, "column": 24 }, "end": { - "line": 418, + "line": 429, "column": 38 } } @@ -87274,15 +89839,15 @@ "postfix": false, "binop": null }, - "start": 17699, - "end": 17700, + "start": 17940, + "end": 17941, "loc": { "start": { - "line": 418, + "line": 429, "column": 38 }, "end": { - "line": 418, + "line": 429, "column": 39 } } @@ -87299,15 +89864,15 @@ "postfix": false, "binop": null }, - "start": 17701, - "end": 17702, + "start": 17942, + "end": 17943, "loc": { "start": { - "line": 418, + "line": 429, "column": 40 }, "end": { - "line": 418, + "line": 429, "column": 41 } } @@ -87325,15 +89890,15 @@ "binop": null }, "value": "outputXKTModel", - "start": 17727, - "end": 17741, + "start": 17968, + "end": 17982, "loc": { "start": { - "line": 419, + "line": 430, "column": 24 }, "end": { - "line": 419, + "line": 430, "column": 38 } } @@ -87350,15 +89915,15 @@ "postfix": false, "binop": null }, - "start": 17741, - "end": 17742, + "start": 17982, + "end": 17983, "loc": { "start": { - "line": 419, + "line": 430, "column": 38 }, "end": { - "line": 419, + "line": 430, "column": 39 } } @@ -87376,15 +89941,15 @@ "binop": null }, "value": "xktModel", - "start": 17742, - "end": 17750, + "start": 17983, + "end": 17991, "loc": { "start": { - "line": 419, + "line": 430, "column": 39 }, "end": { - "line": 419, + "line": 430, "column": 47 } } @@ -87401,15 +89966,15 @@ "postfix": false, "binop": null }, - "start": 17750, - "end": 17751, + "start": 17991, + "end": 17992, "loc": { "start": { - "line": 419, + "line": 430, "column": 47 }, "end": { - "line": 419, + "line": 430, "column": 48 } } @@ -87427,15 +89992,15 @@ "binop": null, "updateContext": null }, - "start": 17751, - "end": 17752, + "start": 17992, + "end": 17993, "loc": { "start": { - "line": 419, + "line": 430, "column": 48 }, "end": { - "line": 419, + "line": 430, "column": 49 } } @@ -87452,15 +90017,15 @@ "postfix": false, "binop": null }, - "start": 17773, - "end": 17774, + "start": 18014, + "end": 18015, "loc": { "start": { - "line": 420, + "line": 431, "column": 20 }, "end": { - "line": 420, + "line": 431, "column": 21 } } @@ -87480,15 +90045,15 @@ "updateContext": null }, "value": "if", - "start": 17796, - "end": 17798, + "start": 18037, + "end": 18039, "loc": { "start": { - "line": 422, + "line": 433, "column": 20 }, "end": { - "line": 422, + "line": 433, "column": 22 } } @@ -87505,15 +90070,15 @@ "postfix": false, "binop": null }, - "start": 17799, - "end": 17800, + "start": 18040, + "end": 18041, "loc": { "start": { - "line": 422, + "line": 433, "column": 23 }, "end": { - "line": 422, + "line": 433, "column": 24 } } @@ -87531,15 +90096,15 @@ "binop": null }, "value": "outputXKT", - "start": 17800, - "end": 17809, + "start": 18041, + "end": 18050, "loc": { "start": { - "line": 422, + "line": 433, "column": 24 }, "end": { - "line": 422, + "line": 433, "column": 33 } } @@ -87556,15 +90121,15 @@ "postfix": false, "binop": null }, - "start": 17809, - "end": 17810, + "start": 18050, + "end": 18051, "loc": { "start": { - "line": 422, + "line": 433, "column": 33 }, "end": { - "line": 422, + "line": 433, "column": 34 } } @@ -87581,15 +90146,15 @@ "postfix": false, "binop": null }, - "start": 17811, - "end": 17812, + "start": 18052, + "end": 18053, "loc": { "start": { - "line": 422, + "line": 433, "column": 35 }, "end": { - "line": 422, + "line": 433, "column": 36 } } @@ -87607,15 +90172,15 @@ "binop": null }, "value": "outputXKT", - "start": 17837, - "end": 17846, + "start": 18078, + "end": 18087, "loc": { "start": { - "line": 423, + "line": 434, "column": 24 }, "end": { - "line": 423, + "line": 434, "column": 33 } } @@ -87632,15 +90197,15 @@ "postfix": false, "binop": null }, - "start": 17846, - "end": 17847, + "start": 18087, + "end": 18088, "loc": { "start": { - "line": 423, + "line": 434, "column": 33 }, "end": { - "line": 423, + "line": 434, "column": 34 } } @@ -87658,15 +90223,15 @@ "binop": null }, "value": "xktContent", - "start": 17847, - "end": 17857, + "start": 18088, + "end": 18098, "loc": { "start": { - "line": 423, + "line": 434, "column": 34 }, "end": { - "line": 423, + "line": 434, "column": 44 } } @@ -87683,15 +90248,15 @@ "postfix": false, "binop": null }, - "start": 17857, - "end": 17858, + "start": 18098, + "end": 18099, "loc": { "start": { - "line": 423, + "line": 434, "column": 44 }, "end": { - "line": 423, + "line": 434, "column": 45 } } @@ -87709,15 +90274,15 @@ "binop": null, "updateContext": null }, - "start": 17858, - "end": 17859, + "start": 18099, + "end": 18100, "loc": { "start": { - "line": 423, + "line": 434, "column": 45 }, "end": { - "line": 423, + "line": 434, "column": 46 } } @@ -87734,15 +90299,15 @@ "postfix": false, "binop": null }, - "start": 17880, - "end": 17881, + "start": 18121, + "end": 18122, "loc": { "start": { - "line": 424, + "line": 435, "column": 20 }, "end": { - "line": 424, + "line": 435, "column": 21 } } @@ -87762,15 +90327,15 @@ "updateContext": null }, "value": "if", - "start": 17903, - "end": 17905, + "start": 18144, + "end": 18146, "loc": { "start": { - "line": 426, + "line": 437, "column": 20 }, "end": { - "line": 426, + "line": 437, "column": 22 } } @@ -87787,15 +90352,15 @@ "postfix": false, "binop": null }, - "start": 17906, - "end": 17907, + "start": 18147, + "end": 18148, "loc": { "start": { - "line": 426, + "line": 437, "column": 23 }, "end": { - "line": 426, + "line": 437, "column": 24 } } @@ -87813,15 +90378,15 @@ "binop": null }, "value": "outputStats", - "start": 17907, - "end": 17918, + "start": 18148, + "end": 18159, "loc": { "start": { - "line": 426, + "line": 437, "column": 24 }, "end": { - "line": 426, + "line": 437, "column": 35 } } @@ -87838,15 +90403,15 @@ "postfix": false, "binop": null }, - "start": 17918, - "end": 17919, + "start": 18159, + "end": 18160, "loc": { "start": { - "line": 426, + "line": 437, "column": 35 }, "end": { - "line": 426, + "line": 437, "column": 36 } } @@ -87863,15 +90428,15 @@ "postfix": false, "binop": null }, - "start": 17920, - "end": 17921, + "start": 18161, + "end": 18162, "loc": { "start": { - "line": 426, + "line": 437, "column": 37 }, "end": { - "line": 426, + "line": 437, "column": 38 } } @@ -87889,15 +90454,15 @@ "binop": null }, "value": "outputStats", - "start": 17946, - "end": 17957, + "start": 18187, + "end": 18198, "loc": { "start": { - "line": 427, + "line": 438, "column": 24 }, "end": { - "line": 427, + "line": 438, "column": 35 } } @@ -87914,15 +90479,15 @@ "postfix": false, "binop": null }, - "start": 17957, - "end": 17958, + "start": 18198, + "end": 18199, "loc": { "start": { - "line": 427, + "line": 438, "column": 35 }, "end": { - "line": 427, + "line": 438, "column": 36 } } @@ -87940,15 +90505,15 @@ "binop": null }, "value": "stats", - "start": 17958, - "end": 17963, + "start": 18199, + "end": 18204, "loc": { "start": { - "line": 427, + "line": 438, "column": 36 }, "end": { - "line": 427, + "line": 438, "column": 41 } } @@ -87965,15 +90530,15 @@ "postfix": false, "binop": null }, - "start": 17963, - "end": 17964, + "start": 18204, + "end": 18205, "loc": { "start": { - "line": 427, + "line": 438, "column": 41 }, "end": { - "line": 427, + "line": 438, "column": 42 } } @@ -87991,15 +90556,15 @@ "binop": null, "updateContext": null }, - "start": 17964, - "end": 17965, + "start": 18205, + "end": 18206, "loc": { "start": { - "line": 427, + "line": 438, "column": 42 }, "end": { - "line": 427, + "line": 438, "column": 43 } } @@ -88016,15 +90581,15 @@ "postfix": false, "binop": null }, - "start": 17986, - "end": 17987, + "start": 18227, + "end": 18228, "loc": { "start": { - "line": 428, + "line": 439, "column": 20 }, "end": { - "line": 428, + "line": 439, "column": 21 } } @@ -88042,15 +90607,15 @@ "binop": null }, "value": "resolve", - "start": 18009, - "end": 18016, + "start": 18250, + "end": 18257, "loc": { "start": { - "line": 430, + "line": 441, "column": 20 }, "end": { - "line": 430, + "line": 441, "column": 27 } } @@ -88067,15 +90632,15 @@ "postfix": false, "binop": null }, - "start": 18016, - "end": 18017, + "start": 18257, + "end": 18258, "loc": { "start": { - "line": 430, + "line": 441, "column": 27 }, "end": { - "line": 430, + "line": 441, "column": 28 } } @@ -88092,15 +90657,15 @@ "postfix": false, "binop": null }, - "start": 18017, - "end": 18018, + "start": 18258, + "end": 18259, "loc": { "start": { - "line": 430, + "line": 441, "column": 28 }, "end": { - "line": 430, + "line": 441, "column": 29 } } @@ -88118,15 +90683,15 @@ "binop": null, "updateContext": null }, - "start": 18018, - "end": 18019, + "start": 18259, + "end": 18260, "loc": { "start": { - "line": 430, + "line": 441, "column": 29 }, "end": { - "line": 430, + "line": 441, "column": 30 } } @@ -88143,15 +90708,15 @@ "postfix": false, "binop": null }, - "start": 18036, - "end": 18037, + "start": 18277, + "end": 18278, "loc": { "start": { - "line": 431, + "line": 442, "column": 16 }, "end": { - "line": 431, + "line": 442, "column": 17 } } @@ -88168,15 +90733,15 @@ "postfix": false, "binop": null }, - "start": 18037, - "end": 18038, + "start": 18278, + "end": 18279, "loc": { "start": { - "line": 431, + "line": 442, "column": 17 }, "end": { - "line": 431, + "line": 442, "column": 18 } } @@ -88194,15 +90759,15 @@ "binop": null, "updateContext": null }, - "start": 18038, - "end": 18039, + "start": 18279, + "end": 18280, "loc": { "start": { - "line": 431, + "line": 442, "column": 18 }, "end": { - "line": 431, + "line": 442, "column": 19 } } @@ -88219,15 +90784,15 @@ "postfix": false, "binop": null }, - "start": 18052, - "end": 18053, + "start": 18293, + "end": 18294, "loc": { "start": { - "line": 432, + "line": 443, "column": 12 }, "end": { - "line": 432, + "line": 443, "column": 13 } } @@ -88245,15 +90810,15 @@ "binop": null, "updateContext": null }, - "start": 18053, - "end": 18054, + "start": 18294, + "end": 18295, "loc": { "start": { - "line": 432, + "line": 443, "column": 13 }, "end": { - "line": 432, + "line": 443, "column": 14 } } @@ -88270,15 +90835,15 @@ "postfix": false, "binop": null }, - "start": 18055, - "end": 18056, + "start": 18296, + "end": 18297, "loc": { "start": { - "line": 432, + "line": 443, "column": 15 }, "end": { - "line": 432, + "line": 443, "column": 16 } } @@ -88296,15 +90861,15 @@ "binop": null }, "value": "err", - "start": 18056, - "end": 18059, + "start": 18297, + "end": 18300, "loc": { "start": { - "line": 432, + "line": 443, "column": 16 }, "end": { - "line": 432, + "line": 443, "column": 19 } } @@ -88321,15 +90886,15 @@ "postfix": false, "binop": null }, - "start": 18059, - "end": 18060, + "start": 18300, + "end": 18301, "loc": { "start": { - "line": 432, + "line": 443, "column": 19 }, "end": { - "line": 432, + "line": 443, "column": 20 } } @@ -88347,15 +90912,15 @@ "binop": null, "updateContext": null }, - "start": 18061, - "end": 18063, + "start": 18302, + "end": 18304, "loc": { "start": { - "line": 432, + "line": 443, "column": 21 }, "end": { - "line": 432, + "line": 443, "column": 23 } } @@ -88372,15 +90937,15 @@ "postfix": false, "binop": null }, - "start": 18064, - "end": 18065, + "start": 18305, + "end": 18306, "loc": { "start": { - "line": 432, + "line": 443, "column": 24 }, "end": { - "line": 432, + "line": 443, "column": 25 } } @@ -88398,15 +90963,15 @@ "binop": null }, "value": "reject", - "start": 18082, - "end": 18088, + "start": 18323, + "end": 18329, "loc": { "start": { - "line": 433, + "line": 444, "column": 16 }, "end": { - "line": 433, + "line": 444, "column": 22 } } @@ -88423,15 +90988,15 @@ "postfix": false, "binop": null }, - "start": 18088, - "end": 18089, + "start": 18329, + "end": 18330, "loc": { "start": { - "line": 433, + "line": 444, "column": 22 }, "end": { - "line": 433, + "line": 444, "column": 23 } } @@ -88449,15 +91014,15 @@ "binop": null }, "value": "err", - "start": 18089, - "end": 18092, + "start": 18330, + "end": 18333, "loc": { "start": { - "line": 433, + "line": 444, "column": 23 }, "end": { - "line": 433, + "line": 444, "column": 26 } } @@ -88474,15 +91039,15 @@ "postfix": false, "binop": null }, - "start": 18092, - "end": 18093, + "start": 18333, + "end": 18334, "loc": { "start": { - "line": 433, + "line": 444, "column": 26 }, "end": { - "line": 433, + "line": 444, "column": 27 } } @@ -88500,15 +91065,15 @@ "binop": null, "updateContext": null }, - "start": 18093, - "end": 18094, + "start": 18334, + "end": 18335, "loc": { "start": { - "line": 433, + "line": 444, "column": 27 }, "end": { - "line": 433, + "line": 444, "column": 28 } } @@ -88525,15 +91090,15 @@ "postfix": false, "binop": null }, - "start": 18107, - "end": 18108, + "start": 18348, + "end": 18349, "loc": { "start": { - "line": 434, + "line": 445, "column": 12 }, "end": { - "line": 434, + "line": 445, "column": 13 } } @@ -88550,15 +91115,15 @@ "postfix": false, "binop": null }, - "start": 18108, - "end": 18109, + "start": 18349, + "end": 18350, "loc": { "start": { - "line": 434, + "line": 445, "column": 13 }, "end": { - "line": 434, + "line": 445, "column": 14 } } @@ -88576,15 +91141,15 @@ "binop": null, "updateContext": null }, - "start": 18109, - "end": 18110, + "start": 18350, + "end": 18351, "loc": { "start": { - "line": 434, + "line": 445, "column": 14 }, "end": { - "line": 434, + "line": 445, "column": 15 } } @@ -88601,15 +91166,15 @@ "postfix": false, "binop": null }, - "start": 18119, - "end": 18120, + "start": 18360, + "end": 18361, "loc": { "start": { - "line": 435, + "line": 446, "column": 8 }, "end": { - "line": 435, + "line": 446, "column": 9 } } @@ -88626,15 +91191,15 @@ "postfix": false, "binop": null }, - "start": 18125, - "end": 18126, + "start": 18366, + "end": 18367, "loc": { "start": { - "line": 436, + "line": 447, "column": 4 }, "end": { - "line": 436, + "line": 447, "column": 5 } } @@ -88651,15 +91216,15 @@ "postfix": false, "binop": null }, - "start": 18126, - "end": 18127, + "start": 18367, + "end": 18368, "loc": { "start": { - "line": 436, + "line": 447, "column": 5 }, "end": { - "line": 436, + "line": 447, "column": 6 } } @@ -88677,15 +91242,15 @@ "binop": null, "updateContext": null }, - "start": 18127, - "end": 18128, + "start": 18368, + "end": 18369, "loc": { "start": { - "line": 436, + "line": 447, "column": 6 }, "end": { - "line": 436, + "line": 447, "column": 7 } } @@ -88702,15 +91267,15 @@ "postfix": false, "binop": null }, - "start": 18129, - "end": 18130, + "start": 18370, + "end": 18371, "loc": { "start": { - "line": 437, + "line": 448, "column": 0 }, "end": { - "line": 437, + "line": 448, "column": 1 } } @@ -88730,15 +91295,15 @@ "updateContext": null }, "value": "export", - "start": 18132, - "end": 18138, + "start": 18373, + "end": 18379, "loc": { "start": { - "line": 439, + "line": 450, "column": 0 }, "end": { - "line": 439, + "line": 450, "column": 6 } } @@ -88755,15 +91320,15 @@ "postfix": false, "binop": null }, - "start": 18139, - "end": 18140, + "start": 18380, + "end": 18381, "loc": { "start": { - "line": 439, + "line": 450, "column": 7 }, "end": { - "line": 439, + "line": 450, "column": 8 } } @@ -88781,15 +91346,15 @@ "binop": null }, "value": "convert2xkt", - "start": 18140, - "end": 18151, + "start": 18381, + "end": 18392, "loc": { "start": { - "line": 439, + "line": 450, "column": 8 }, "end": { - "line": 439, + "line": 450, "column": 19 } } @@ -88806,15 +91371,15 @@ "postfix": false, "binop": null }, - "start": 18151, - "end": 18152, + "start": 18392, + "end": 18393, "loc": { "start": { - "line": 439, + "line": 450, "column": 19 }, "end": { - "line": 439, + "line": 450, "column": 20 } } @@ -88832,15 +91397,15 @@ "binop": null, "updateContext": null }, - "start": 18152, - "end": 18153, + "start": 18393, + "end": 18394, "loc": { "start": { - "line": 439, + "line": 450, "column": 20 }, "end": { - "line": 439, + "line": 450, "column": 21 } } @@ -88858,15 +91423,15 @@ "binop": null, "updateContext": null }, - "start": 18153, - "end": 18153, + "start": 18394, + "end": 18394, "loc": { "start": { - "line": 439, + "line": 450, "column": 21 }, "end": { - "line": 439, + "line": 450, "column": 21 } } diff --git a/docs/file/src/convert2xkt.js.html b/docs/file/src/convert2xkt.js.html index 11afbe0..3093312 100644 --- a/docs/file/src/convert2xkt.js.html +++ b/docs/file/src/convert2xkt.js.html @@ -201,6 +201,14 @@ stats.conversionTime = 0; stats.aabb = null; + function getFileExtension(fileName) { + let ext = path.extname(source); + if (ext.charAt(0) === ".") { + ext = ext.substring(1); + } + return ext; + } + return new Promise(function (resolve, reject) { const _log = log; log = (msg) => { @@ -229,7 +237,10 @@ const startTime = new Date(); const sourceConfigs = configs.sourceConfigs || {}; - const ext = sourceFormat || path.extname(source); + const ext = sourceFormat || getFileExtension(source); + + log(`Input file extension: "${ext}"`); + let fileTypeConfigs = sourceConfigs[ext]; if (!fileTypeConfigs) { diff --git a/docs/index.json b/docs/index.json index e19d577..78a79ea 100644 --- a/docs/index.json +++ b/docs/index.json @@ -569,7 +569,7 @@ "name": "src/XKTModel/KDNode.js", "content": "/**\n * A kd-Tree node, used internally by {@link XKTModel}.\n *\n * @private\n */\nclass KDNode {\n\n /**\n * Create a KDNode with an axis-aligned 3D World-space boundary.\n */\n constructor(aabb) {\n\n /**\n * The axis-aligned 3D World-space boundary of this KDNode.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}s within this KDNode.\n */\n this.entities = null;\n\n /**\n * The left child KDNode.\n */\n this.left = null;\n\n /**\n * The right child KDNode.\n */\n this.right = null;\n }\n}\n\nexport {KDNode};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/KDNode.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/KDNode.js", "access": "public", "description": null, "lineNumber": 1 @@ -676,7 +676,7 @@ "name": "src/XKTModel/MockXKTModel.js", "content": "import {math} from \"../lib/math.js\";\nimport {geometryCompression} from \"./lib/geometryCompression.js\";\nimport {buildEdgeIndices} from \"./lib/buildEdgeIndices.js\";\n\nconst tempVec4a = math.vec4([0, 0, 0, 1]);\nconst tempVec4b = math.vec4([0, 0, 0, 1]);\nconst tempMat4 = math.mat4();\nconst tempMat4b = math.mat4();\n\n/**\n * A mock {@link XKTModel} that creates {@link Mesh}es and {@link Geometry}s to visualize the output of {@link parseGLTFIntoXKTModel}.\n *\n * @private\n */\nclass MockXKTModel {\n\n /**\n *\n * @param cfg\n */\n constructor(cfg={}) {\n\n if (!cfg.handlePrimitive) {\n throw \"Expected config: handlePrimitive\";\n }\n\n if (!cfg.handleEntity) {\n throw \"Expected config: handleEntity\";\n }\n\n this._handlePrimitive = cfg.handlePrimitive;\n this._handleEntity = cfg.handleEntity;\n\n this.geometries = {};\n }\n\n createGeometry(params) {\n\n const geometryId = params.geometryId;\n const primitiveType = params.primitiveType;\n const reused = params.reused;\n const primitiveModelingMatrix = params.primitiveModelingMatrix ? params.primitiveModelingMatrix.slice : math.identityMat4();\n const color = params.color;\n const opacity = params.opacity;\n const positions = params.positions.slice();\n const normals = params.normals.slice();\n const indices = params.indices;\n\n const positions2 = positions.slice();\n\n const edgeIndices = buildEdgeIndices(positions, indices, null, 10);\n\n if (!reused) {\n\n // Bake single-use geometry's positions into World-space\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n\n math.transformPoint4(primitiveModelingMatrix, tempVec4a, tempVec4b);\n\n positions2[i + 0] = tempVec4b[0];\n positions2[i + 1] = tempVec4b[1];\n positions2[i + 2] = tempVec4b[2];\n }\n }\n\n const modelNormalMatrix = math.inverseMat4(math.transposeMat4(primitiveModelingMatrix, tempMat4b), tempMat4);\n const normalsOctEncoded = new Int8Array(normals.length);\n\n geometryCompression.transformAndOctEncodeNormals(modelNormalMatrix, normals, normals.length, normalsOctEncoded, 0);\n\n const primitive = new VBOGeometry(this.scene, {\n id: geometryId,\n primitive: \"triangles\",\n positions: positions2,\n normals: normals,\n indices: indices,\n edgeIndices: edgeIndices\n });\n\n this.geometries[geometryId] = primitive;\n }\n\n createEntity(params) {\n\n const entityId = params.entityId;\n const entityModelingMatrix = params.entityModelingMatrix ? params.entityModelingMatrix.slice() : math.identityMat4();\n const primitiveIds = params.primitiveIds;\n\n for (let primitiveIdIdx = 0, primitiveIdLen = primitiveIds.length; primitiveIdIdx < primitiveIdLen; primitiveIdIdx++) {\n\n const geometryId = primitiveIds[primitiveIdIdx];\n const primitive = this.geometries[geometryId];\n\n if (!primitive) {\n console.error(\"primitive not found: \" + geometryId);\n continue;\n }\n\n new Mesh(this.scene, {\n id: entityId,\n geometry: primitive,\n matrix: entityModelingMatrix,\n edges: true\n });\n }\n }\n\n finalize() {\n }\n}\n\nexport {MockXKTModel};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/MockXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/MockXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -927,7 +927,7 @@ "name": "src/XKTModel/XKTEntity.js", "content": "import {math} from \"../lib/math.js\";\n\n/**\n * An object within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTModel#entities} and {@link XKTModel#entitiesList}\n * * Has one or more {@link XKTMesh}s, each having an {@link XKTGeometry}\n *\n * @class XKTEntity\n */\nclass XKTEntity {\n\n /**\n * @private\n * @param entityId\n * @param meshes\n */\n constructor(entityId, meshes) {\n\n /**\n * Unique ID of this ````XKTEntity```` in {@link XKTModel#entities}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * We can also use {@link XKTModel#createMetaObject} to create an {@link XKTMetaObject} to specify metadata for\n * this ````XKTEntity````. To associate the {@link XKTMetaObject} with our {@link XKTEntity}, we give\n * {@link XKTMetaObject#metaObjectId} the same value as {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.entityId = entityId;\n\n /**\n * Index of this ````XKTEntity```` in {@link XKTModel#entitiesList}.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Number}\n */\n this.entityIndex = null;\n\n /**\n * A list of {@link XKTMesh}s that indicate which {@link XKTGeometry}s are used by this Entity.\n *\n * @type {XKTMesh[]}\n */\n this.meshes = meshes;\n\n /**\n * World-space axis-aligned bounding box (AABB) that encloses the {@link XKTGeometry#positions} of\n * the {@link XKTGeometry}s that are used by this ````XKTEntity````.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {Float32Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this ````XKTEntity```` shares {@link XKTGeometry}s with other {@link XKTEntity}'s.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * Note that when an ````XKTEntity```` shares ````XKTGeometrys````, it shares **all** of its ````XKTGeometrys````. An ````XKTEntity````\n * never shares only some of its ````XKTGeometrys```` - it always shares either the whole set or none at all.\n *\n * @type {Boolean}\n */\n this.hasReusedGeometries = false;\n }\n}\n\nexport {XKTEntity};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTEntity.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTEntity.js", "access": "public", "description": null, "lineNumber": 1 @@ -1090,7 +1090,7 @@ "name": "src/XKTModel/XKTGeometry.js", "content": "/**\n * An element of reusable geometry within an {@link XKTModel}.\n *\n * * Created by {@link XKTModel#createGeometry}\n * * Stored in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}\n * * Referenced by {@link XKTMesh}s, which belong to {@link XKTEntity}s\n *\n * @class XKTGeometry\n */\nclass XKTGeometry {\n\n /**\n * @private\n * @param {*} cfg Configuration for the XKTGeometry.\n * @param {Number} cfg.geometryId Unique ID of the geometry in {@link XKTModel#geometries}.\n * @param {String} cfg.primitiveType Type of this geometry - \"triangles\", \"points\" or \"lines\" so far.\n * @param {Number} cfg.geometryIndex Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n * @param {Float64Array} cfg.positions Non-quantized 3D vertex positions.\n * @param {Float32Array} cfg.normals Non-compressed vertex normals.\n * @param {Uint8Array} cfg.colorsCompressed Unsigned 8-bit integer RGBA vertex colors.\n * @param {Float32Array} cfg.uvs Non-compressed vertex UV coordinates.\n * @param {Uint32Array} cfg.indices Indices to organize the vertex positions and normals into triangles.\n * @param {Uint32Array} cfg.edgeIndices Indices to organize the vertex positions into edges.\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTGeometry in {@link XKTModel#geometries}.\n *\n * @type {Number}\n */\n this.geometryId = cfg.geometryId;\n\n /**\n * The type of primitive - \"triangles\" | \"points\" | \"lines\".\n *\n * @type {String}\n */\n this.primitiveType = cfg.primitiveType;\n\n /**\n * Index of this XKTGeometry in {@link XKTModel#geometriesList}.\n *\n * @type {Number}\n */\n this.geometryIndex = cfg.geometryIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTGeometry.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * Non-quantized 3D vertex positions.\n *\n * Defined for all primitive types.\n *\n * @type {Float64Array}\n */\n this.positions = cfg.positions;\n\n /**\n * Quantized vertex positions.\n *\n * Defined for all primitive types.\n *\n * This array is later created from {@link XKTGeometry#positions} by {@link XKTModel#finalize}.\n *\n * @type {Uint16Array}\n */\n this.positionsQuantized = new Uint16Array(cfg.positions.length);\n\n /**\n * Non-compressed 3D vertex normals.\n *\n * Defined only for triangle primitives. Can be null if we want xeokit to auto-generate them. Ignored for points and lines.\n *\n * @type {Float32Array}\n */\n this.normals = cfg.normals;\n\n /**\n * Compressed vertex normals.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * This array is later created from {@link XKTGeometry#normals} by {@link XKTModel#finalize}.\n *\n * Will be null if {@link XKTGeometry#normals} is also null.\n *\n * @type {Int8Array}\n */\n this.normalsOctEncoded = null;\n\n /**\n * Compressed RGBA vertex colors.\n *\n * Defined only for point primitives. Ignored for triangles and lines.\n *\n * @type {Uint8Array}\n */\n this.colorsCompressed = cfg.colorsCompressed;\n\n /**\n * Non-compressed vertex UVs.\n *\n * @type {Float32Array}\n */\n this.uvs = cfg.uvs;\n\n /**\n * Compressed vertex UVs.\n *\n * @type {Uint16Array}\n */\n this.uvsCompressed = cfg.uvsCompressed;\n\n /**\n * Indices that organize the vertex positions and normals as triangles.\n *\n * Defined only for triangle and lines primitives. Ignored for points.\n *\n * @type {Uint32Array}\n */\n this.indices = cfg.indices;\n\n /**\n * Indices that organize the vertex positions as edges.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * @type {Uint32Array}\n */\n this.edgeIndices = cfg.edgeIndices;\n\n /**\n * When {@link XKTGeometry#primitiveType} is \"triangles\", this is ````true```` when this geometry is a watertight mesh.\n *\n * Defined only for triangle primitives. Ignored for points and lines.\n *\n * Set by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.solid = false;\n }\n\n /**\n * Convenience property that is ````true```` when {@link XKTGeometry#numInstances} is greater that one.\n * @returns {boolean}\n */\n get reused() {\n return (this.numInstances > 1);\n }\n}\n\nexport {XKTGeometry};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -1536,7 +1536,7 @@ "name": "src/XKTModel/XKTMesh.js", "content": "/**\n * Represents the usage of a {@link XKTGeometry} by an {@link XKTEntity}.\n *\n * * Created by {@link XKTModel#createEntity}\n * * Stored in {@link XKTEntity#meshes} and {@link XKTModel#meshesList}\n * * Has an {@link XKTGeometry}, and an optional {@link XKTTextureSet}, both of which it can share with other {@link XKTMesh}es\n * * Has {@link XKTMesh#color}, {@link XKTMesh#opacity}, {@link XKTMesh#metallic} and {@link XKTMesh#roughness} PBR attributes\n * @class XKTMesh\n */\nclass XKTMesh {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTMesh in {@link XKTModel#meshes}.\n *\n * @type {Number}\n */\n this.meshId = cfg.meshId;\n\n /**\n * Index of this XKTMesh in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.meshIndex = cfg.meshIndex;\n\n /**\n * The 4x4 modeling transform matrix.\n *\n * Transform is relative to the center of the {@link XKTTile} that contains this XKTMesh's {@link XKTEntity},\n * which is given in {@link XKTMesh#entity}.\n *\n * When the ````XKTEntity```` shares its {@link XKTGeometry}s with other ````XKTEntity````s, this matrix is used\n * to transform this XKTMesh's XKTGeometry into World-space. When this XKTMesh does not share its ````XKTGeometry````,\n * then this matrix is ignored.\n *\n * @type {Number[]}\n */\n this.matrix = cfg.matrix;\n\n /**\n * The instanced {@link XKTGeometry}.\n *\n * @type {XKTGeometry}\n */\n this.geometry = cfg.geometry;\n\n /**\n * RGB color of this XKTMesh.\n *\n * @type {Float32Array}\n */\n this.color = cfg.color || new Float32Array([1, 1, 1]);\n\n /**\n * PBR metallness of this XKTMesh.\n *\n * @type {Number}\n */\n this.metallic = (cfg.metallic !== null && cfg.metallic !== undefined) ? cfg.metallic : 0;\n\n /**\n * PBR roughness of this XKTMesh.\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {Number}\n * @type {XKTTextureSet}\n */\n this.roughness = (cfg.roughness !== null && cfg.roughness !== undefined) ? cfg.roughness : 1;\n\n /**\n * Opacity of this XKTMesh.\n *\n * @type {Number}\n */\n this.opacity = (cfg.opacity !== undefined && cfg.opacity !== null) ? cfg.opacity : 1.0;\n\n /**\n * The {@link XKTTextureSet} that defines the appearance of this XKTMesh.\n *\n * @type {XKTTextureSet}\n */\n this.textureSet = cfg.textureSet;\n\n /**\n * The owner {@link XKTEntity}.\n *\n * Set by {@link XKTModel#createEntity}.\n *\n * @type {XKTEntity}\n */\n this.entity = null; // Set after instantiation, when the Entity is known\n }\n}\n\nexport {XKTMesh};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTMesh.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTMesh.js", "access": "public", "description": null, "lineNumber": 1 @@ -1772,7 +1772,7 @@ "name": "src/XKTModel/XKTMetaObject.js", "content": "/**\n * A meta object within an {@link XKTModel}.\n *\n * These are plugged together into a parent-child hierarchy to represent structural\n * metadata for the {@link XKTModel}.\n *\n * The leaf XKTMetaObjects are usually associated with\n * an {@link XKTEntity}, which they do so by sharing the same ID,\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * * Created by {@link XKTModel#createMetaObject}\n * * Stored in {@link XKTModel#metaObjects} and {@link XKTModel#metaObjectsList}\n * * Has an ID, a type, and a human-readable name\n * * May have a parent {@link XKTMetaObject}\n * * When no children, is usually associated with an {@link XKTEntity}\n *\n * @class XKTMetaObject\n */\nclass XKTMetaObject {\n\n /**\n * @private\n * @param metaObjectId\n * @param propertySetIds\n * @param metaObjectType\n * @param metaObjectName\n * @param parentMetaObjectId\n */\n constructor(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId) {\n\n /**\n * Unique ID of this ````XKTMetaObject```` in {@link XKTModel#metaObjects}.\n *\n * For a BIM model, this will be an IFC product ID.\n *\n * If this is a leaf XKTMetaObject, where it is not a parent to any other XKTMetaObject,\n * then this will be equal to the ID of an {@link XKTEntity} in {@link XKTModel#entities},\n * ie. where {@link XKTMetaObject#metaObjectId} == {@link XKTEntity#entityId}.\n *\n * @type {String}\n */\n this.metaObjectId = metaObjectId;\n\n /**\n * Unique ID of one or more property sets that contains additional metadata about this\n * {@link XKTMetaObject}. The property sets can be stored in an external system, or\n * within the {@link XKTModel}, as {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n *\n * @type {String[]}\n */\n this.propertySetIds = propertySetIds;\n\n /**\n * Indicates the XKTMetaObject meta object type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.metaObjectType = metaObjectType;\n\n /**\n * Indicates the XKTMetaObject meta object name.\n *\n * This defaults to {@link XKTMetaObject#metaObjectId}.\n *\n * @type {string}\n */\n this.metaObjectName = metaObjectName;\n\n /**\n * The parent XKTMetaObject, if any.\n *\n * Will be null if there is no parent.\n *\n * @type {String}\n */\n this.parentMetaObjectId = parentMetaObjectId;\n }\n}\n\nexport {XKTMetaObject};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTMetaObject.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTMetaObject.js", "access": "public", "description": null, "lineNumber": 1 @@ -1965,7 +1965,7 @@ "name": "src/XKTModel/XKTModel.js", "content": "import {math} from \"../lib/math.js\";\nimport {geometryCompression} from \"./lib/geometryCompression.js\";\nimport {buildEdgeIndices} from \"./lib/buildEdgeIndices.js\";\nimport {isTriangleMeshSolid} from \"./lib/isTriangleMeshSolid.js\";\n\nimport {XKTMesh} from './XKTMesh.js';\nimport {XKTGeometry} from './XKTGeometry.js';\nimport {XKTEntity} from './XKTEntity.js';\nimport {XKTTile} from './XKTTile.js';\nimport {KDNode} from \"./KDNode.js\";\nimport {XKTMetaObject} from \"./XKTMetaObject.js\";\nimport {XKTPropertySet} from \"./XKTPropertySet.js\";\nimport {mergeVertices} from \"../lib/mergeVertices.js\";\nimport {XKT_INFO} from \"../XKT_INFO.js\";\nimport {XKTTexture} from \"./XKTTexture\";\nimport {XKTTextureSet} from \"./XKTTextureSet\";\nimport {encode, load} from \"@loaders.gl/core\";\nimport {KTX2BasisWriter} from \"@loaders.gl/textures\";\nimport {ImageLoader} from '@loaders.gl/images';\n\nconst tempVec4a = math.vec4([0, 0, 0, 1]);\nconst tempVec4b = math.vec4([0, 0, 0, 1]);\n\nconst tempMat4 = math.mat4();\nconst tempMat4b = math.mat4();\n\nconst kdTreeDimLength = new Float64Array(3);\n\n// XKT texture types\n\nconst COLOR_TEXTURE = 0;\nconst METALLIC_ROUGHNESS_TEXTURE = 1;\nconst NORMALS_TEXTURE = 2;\nconst EMISSIVE_TEXTURE = 3;\nconst OCCLUSION_TEXTURE = 4;\n\n// KTX2 encoding options for each texture type\n\nconst TEXTURE_ENCODING_OPTIONS = {}\nTEXTURE_ENCODING_OPTIONS[COLOR_TEXTURE] = {\n useSRGB: true,\n qualityLevel: 50,\n encodeUASTC: true,\n mipmaps: true\n};\nTEXTURE_ENCODING_OPTIONS[EMISSIVE_TEXTURE] = {\n useSRGB: true,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[METALLIC_ROUGHNESS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 50,\n mipmaps: true // Needed for GGX roughness shading\n};\nTEXTURE_ENCODING_OPTIONS[NORMALS_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\nTEXTURE_ENCODING_OPTIONS[OCCLUSION_TEXTURE] = {\n useSRGB: false,\n encodeUASTC: true,\n qualityLevel: 10,\n mipmaps: false\n};\n\n/**\n * A document model that represents the contents of an .XKT file.\n *\n * * An XKTModel contains {@link XKTTile}s, which spatially subdivide the model into axis-aligned, box-shaped regions.\n * * Each {@link XKTTile} contains {@link XKTEntity}s, which represent the objects within its region.\n * * Each {@link XKTEntity} has {@link XKTMesh}s, which each have a {@link XKTGeometry}. Each {@link XKTGeometry} can be shared by multiple {@link XKTMesh}s.\n * * Import models into an XKTModel using {@link parseGLTFJSONIntoXKTModel}, {@link parseIFCIntoXKTModel}, {@link parseCityJSONIntoXKTModel} etc.\n * * Build an XKTModel programmatically using {@link XKTModel#createGeometry}, {@link XKTModel#createMesh} and {@link XKTModel#createEntity}.\n * * Serialize an XKTModel to an ArrayBuffer using {@link writeXKTModelToArrayBuffer}.\n *\n * ## Usage\n *\n * See [main docs page](/docs/#javascript-api) for usage examples.\n *\n * @class XKTModel\n */\nclass XKTModel {\n\n /**\n * Constructs a new XKTModel.\n *\n * @param {*} [cfg] Configuration\n * @param {Number} [cfg.edgeThreshold=10]\n * @param {Number} [cfg.minTileSize=500]\n */\n constructor(cfg = {}) {\n\n /**\n * The model's ID, if available.\n *\n * Will be \"default\" by default.\n *\n * @type {String}\n */\n this.modelId = cfg.modelId || \"default\";\n\n /**\n * The project ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.projectId = cfg.projectId || \"\";\n\n /**\n * The revision ID, if available.\n *\n * Will be an empty string by default.\n *\n * @type {String}\n */\n this.revisionId = cfg.revisionId || \"\";\n\n /**\n * The model author, if available.\n *\n * Will be an empty string by default.\n *\n * @property author\n * @type {String}\n */\n this.author = cfg.author || \"\";\n\n /**\n * The date the model was created, if available.\n *\n * Will be an empty string by default.\n *\n * @property createdAt\n * @type {String}\n */\n this.createdAt = cfg.createdAt || \"\";\n\n /**\n * The application that created the model, if available.\n *\n * Will be an empty string by default.\n *\n * @property creatingApplication\n * @type {String}\n */\n this.creatingApplication = cfg.creatingApplication || \"\";\n\n /**\n * The model schema version, if available.\n *\n * In the case of IFC, this could be \"IFC2x3\" or \"IFC4\", for example.\n *\n * Will be an empty string by default.\n *\n * @property schema\n * @type {String}\n */\n this.schema = cfg.schema || \"\";\n\n /**\n * The XKT format version.\n *\n * @property xktVersion;\n * @type {number}\n */\n this.xktVersion = XKT_INFO.xktVersion;\n\n /**\n *\n * @type {Number|number}\n */\n this.edgeThreshold = cfg.edgeThreshold || 10;\n\n /**\n * Minimum diagonal size of the boundary of an {@link XKTTile}.\n *\n * @type {Number|number}\n */\n this.minTileSize = cfg.minTileSize || 500;\n\n /**\n * Optional overall AABB that contains all the {@link XKTEntity}s we'll create in this model, if previously known.\n *\n * This is the AABB of a complete set of input files that are provided as a split-model set for conversion.\n *\n * This is used to help the {@link XKTTile.aabb}s within split models align neatly with each other, as we\n * build them with a k-d tree in {@link XKTModel#finalize}. Without this, the AABBs of the different parts\n * tend to misalign slightly, resulting in excess number of {@link XKTTile}s, which degrades memory and rendering\n * performance when the XKT is viewer in the xeokit Viewer.\n */\n this.modelAABB = cfg.modelAABB;\n\n /**\n * Map of {@link XKTPropertySet}s within this XKTModel, each mapped to {@link XKTPropertySet#propertySetId}.\n *\n * Created by {@link XKTModel#createPropertySet}.\n *\n * @type {{String:XKTPropertySet}}\n */\n this.propertySets = {};\n\n /**\n * {@link XKTPropertySet}s within this XKTModel.\n *\n * Each XKTPropertySet holds its position in this list in {@link XKTPropertySet#propertySetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTPropertySet[]}\n */\n this.propertySetsList = [];\n\n /**\n * Map of {@link XKTMetaObject}s within this XKTModel, each mapped to {@link XKTMetaObject#metaObjectId}.\n *\n * Created by {@link XKTModel#createMetaObject}.\n *\n * @type {{String:XKTMetaObject}}\n */\n this.metaObjects = {};\n\n /**\n * {@link XKTMetaObject}s within this XKTModel.\n *\n * Each XKTMetaObject holds its position in this list in {@link XKTMetaObject#metaObjectIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMetaObject[]}\n */\n this.metaObjectsList = [];\n\n /**\n * The positions of all shared {@link XKTGeometry}s are de-quantized using this singular\n * de-quantization matrix.\n *\n * This de-quantization matrix is generated from the collective Local-space boundary of the\n * positions of all shared {@link XKTGeometry}s.\n *\n * @type {Float32Array}\n */\n this.reusedGeometriesDecodeMatrix = new Float32Array(16);\n\n /**\n * Map of {@link XKTGeometry}s within this XKTModel, each mapped to {@link XKTGeometry#geometryId}.\n *\n * Created by {@link XKTModel#createGeometry}.\n *\n * @type {{Number:XKTGeometry}}\n */\n this.geometries = {};\n\n /**\n * List of {@link XKTGeometry}s within this XKTModel, in the order they were created.\n *\n * Each XKTGeometry holds its position in this list in {@link XKTGeometry#geometryIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTGeometry[]}\n */\n this.geometriesList = [];\n\n /**\n * Map of {@link XKTTexture}s within this XKTModel, each mapped to {@link XKTTexture#textureId}.\n *\n * Created by {@link XKTModel#createTexture}.\n *\n * @type {{Number:XKTTexture}}\n */\n this.textures = {};\n\n /**\n * List of {@link XKTTexture}s within this XKTModel, in the order they were created.\n *\n * Each XKTTexture holds its position in this list in {@link XKTTexture#textureIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTexture[]}\n */\n this.texturesList = [];\n\n /**\n * Map of {@link XKTTextureSet}s within this XKTModel, each mapped to {@link XKTTextureSet#textureSetId}.\n *\n * Created by {@link XKTModel#createTextureSet}.\n *\n * @type {{Number:XKTTextureSet}}\n */\n this.textureSets = {};\n\n /**\n * List of {@link XKTTextureSet}s within this XKTModel, in the order they were created.\n *\n * Each XKTTextureSet holds its position in this list in {@link XKTTextureSet#textureSetIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTextureSet[]}\n */\n this.textureSetsList = [];\n\n /**\n * Map of {@link XKTMesh}s within this XKTModel, each mapped to {@link XKTMesh#meshId}.\n *\n * Created by {@link XKTModel#createMesh}.\n *\n * @type {{Number:XKTMesh}}\n */\n this.meshes = {};\n\n /**\n * List of {@link XKTMesh}s within this XKTModel, in the order they were created.\n *\n * Each XKTMesh holds its position in this list in {@link XKTMesh#meshIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTMesh[]}\n */\n this.meshesList = [];\n\n /**\n * Map of {@link XKTEntity}s within this XKTModel, each mapped to {@link XKTEntity#entityId}.\n *\n * Created by {@link XKTModel#createEntity}.\n *\n * @type {{String:XKTEntity}}\n */\n this.entities = {};\n\n /**\n * {@link XKTEntity}s within this XKTModel.\n *\n * Each XKTEntity holds its position in this list in {@link XKTEntity#entityIndex}.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTEntity[]}\n */\n this.entitiesList = [];\n\n /**\n * {@link XKTTile}s within this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {XKTTile[]}\n */\n this.tilesList = [];\n\n /**\n * The axis-aligned 3D World-space boundary of this XKTModel.\n *\n * Created by {@link XKTModel#finalize}.\n *\n * @type {Float64Array}\n */\n this.aabb = math.AABB3();\n\n /**\n * Indicates if this XKTModel has been finalized.\n *\n * Set ````true```` by {@link XKTModel#finalize}.\n *\n * @type {boolean}\n */\n this.finalized = false;\n }\n\n /**\n * Creates an {@link XKTPropertySet} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.propertySetId Unique ID for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetType=\"default\"] A meta type for the {@link XKTPropertySet}.\n * @param {String} [params.propertySetName] Human-readable name for the {@link XKTPropertySet}. Defaults to the ````propertySetId```` parameter.\n * @param {String[]} params.properties Properties for the {@link XKTPropertySet}.\n * @returns {XKTPropertySet} The new {@link XKTPropertySet}.\n */\n createPropertySet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.propertySetId === null || params.propertySetId === undefined) {\n throw \"Parameter expected: params.propertySetId\";\n }\n\n if (params.properties === null || params.properties === undefined) {\n throw \"Parameter expected: params.properties\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more property sets\");\n return;\n }\n\n if (this.propertySets[params.propertySetId]) {\n // console.error(\"XKTPropertySet already exists with this ID: \" + params.propertySetId);\n return;\n }\n\n const propertySetId = params.propertySetId;\n const propertySetType = params.propertySetType || \"Default\";\n const propertySetName = params.propertySetName || params.propertySetId;\n const properties = params.properties || [];\n\n const propertySet = new XKTPropertySet(propertySetId, propertySetType, propertySetName, properties);\n\n this.propertySets[propertySetId] = propertySet;\n this.propertySetsList.push(propertySet);\n\n return propertySet;\n }\n\n /**\n * Creates an {@link XKTMetaObject} within this XKTModel.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.metaObjectId Unique ID for the {@link XKTMetaObject}.\n * @param {String} params.propertySetIds ID of one or more property sets that contains additional metadata about\n * this {@link XKTMetaObject}. The property sets could be stored externally (ie not managed at all by the XKT file),\n * or could be {@link XKTPropertySet}s within {@link XKTModel#propertySets}.\n * @param {String} [params.metaObjectType=\"default\"] A meta type for the {@link XKTMetaObject}. Can be anything,\n * but is usually an IFC type, such as \"IfcSite\" or \"IfcWall\".\n * @param {String} [params.metaObjectName] Human-readable name for the {@link XKTMetaObject}. Defaults to the ````metaObjectId```` parameter.\n * @param {String} [params.parentMetaObjectId] ID of the parent {@link XKTMetaObject}, if any. Defaults to the ````metaObjectId```` parameter.\n * @returns {XKTMetaObject} The new {@link XKTMetaObject}.\n */\n createMetaObject(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.metaObjectId === null || params.metaObjectId === undefined) {\n throw \"Parameter expected: params.metaObjectId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more meta objects\");\n return;\n }\n\n if (this.metaObjects[params.metaObjectId]) {\n // console.error(\"XKTMetaObject already exists with this ID: \" + params.metaObjectId);\n return;\n }\n\n const metaObjectId = params.metaObjectId;\n const propertySetIds = params.propertySetIds;\n const metaObjectType = params.metaObjectType || \"Default\";\n const metaObjectName = params.metaObjectName || params.metaObjectId;\n const parentMetaObjectId = params.parentMetaObjectId;\n\n const metaObject = new XKTMetaObject(metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId);\n\n this.metaObjects[metaObjectId] = metaObject;\n this.metaObjectsList.push(metaObject);\n\n if (!parentMetaObjectId) {\n if (!this._rootMetaObject) {\n this._rootMetaObject = metaObject;\n }\n }\n\n return metaObject;\n }\n\n /**\n * Creates an {@link XKTTexture} within this XKTModel.\n *\n * Registers the new {@link XKTTexture} in {@link XKTModel#textures} and {@link XKTModel#texturesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureId Unique ID for the {@link XKTTexture}.\n * @param {String} [params.src] Source of an image file for the texture.\n * @param {Buffer} [params.imageData] Image data for the texture.\n * @param {Number} [params.mediaType] Media type (ie. MIME type) of ````imageData````. Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n * @param {Number} [params.width] Texture width, used with ````imageData````. Ignored for compressed textures.\n * @param {Number} [params.height] Texture height, used with ````imageData````. Ignored for compressed textures.\n * @param {Boolean} [params.compressed=true] Whether to compress the texture.\n * @param {Number} [params.minFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers less than one pixel. Supported\n * values are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter}, {@link NearestMipMapNearestFilter},\n * {@link NearestMipMapLinearFilter} and {@link LinearMipMapLinearFilter}. Ignored for compressed textures.\n * @param {Number} [params.magFilter=LinearMipMapNearestFilter] How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}. Ignored for compressed textures.\n * @param {Number} [params.wrapS=RepeatWrapping] Wrap parameter for texture coordinate *S*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @param {Number} [params.wrapT=RepeatWrapping] Wrap parameter for texture coordinate *T*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * {@param {Number} [params.wrapR=RepeatWrapping] Wrap parameter for texture coordinate *R*. Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}. Ignored for compressed textures.\n * @returns {XKTTexture} The new {@link XKTTexture}.\n */\n createTexture(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureId === null || params.textureId === undefined) {\n throw \"Parameter expected: params.textureId\";\n }\n\n if (!params.imageData && !params.src) {\n throw \"Parameter expected: params.imageData or params.src\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textures\");\n return;\n }\n\n if (this.textures[params.textureId]) {\n console.error(\"XKTTexture already exists with this ID: \" + params.textureId);\n return;\n }\n\n if (params.src) {\n const fileExt = params.src.split('.').pop();\n if (fileExt !== \"jpg\" && fileExt !== \"jpeg\" && fileExt !== \"png\") {\n console.error(`XKTModel does not support image files with extension '${fileExt}' - won't create texture '${params.textureId}`);\n return;\n }\n }\n\n const textureId = params.textureId;\n\n const texture = new XKTTexture({\n textureId,\n imageData: params.imageData,\n mediaType: params.mediaType,\n minFilter: params.minFilter,\n magFilter: params.magFilter,\n wrapS: params.wrapS,\n wrapT: params.wrapT,\n wrapR: params.wrapR,\n width: params.width,\n height: params.height,\n compressed: (params.compressed !== false),\n src: params.src\n });\n\n this.textures[textureId] = texture;\n this.texturesList.push(texture);\n\n return texture;\n }\n\n /**\n * Creates an {@link XKTTextureSet} within this XKTModel.\n *\n * Registers the new {@link XKTTextureSet} in {@link XKTModel#textureSets} and {@link XKTModel#.textureSetsList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.textureSetId Unique ID for the {@link XKTTextureSet}.\n * @param {*} [params.colorTextureId] ID of *RGBA* base color {@link XKTTexture}, with color in *RGB* and alpha in *A*.\n * @param {*} [params.metallicRoughnessTextureId] ID of *RGBA* metal-roughness {@link XKTTexture}, with the metallic factor in *R*, and roughness factor in *G*.\n * @param {*} [params.normalsTextureId] ID of *RGBA* normal {@link XKTTexture}, with normal map vectors in *RGB*.\n * @param {*} [params.emissiveTextureId] ID of *RGBA* emissive {@link XKTTexture}, with emissive color in *RGB*.\n * @param {*} [params.occlusionTextureId] ID of *RGBA* occlusion {@link XKTTexture}, with occlusion factor in *R*.\n * @returns {XKTTextureSet} The new {@link XKTTextureSet}.\n */\n createTextureSet(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.textureSetId === null || params.textureSetId === undefined) {\n throw \"Parameter expected: params.textureSetId\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more textureSets\");\n return;\n }\n\n if (this.textureSets[params.textureSetId]) {\n console.error(\"XKTTextureSet already exists with this ID: \" + params.textureSetId);\n return;\n }\n\n let colorTexture;\n if (params.colorTextureId !== undefined && params.colorTextureId !== null) {\n colorTexture = this.textures[params.colorTextureId];\n if (!colorTexture) {\n console.error(`Texture not found: ${params.colorTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n colorTexture.channel = COLOR_TEXTURE;\n }\n\n let metallicRoughnessTexture;\n if (params.metallicRoughnessTextureId !== undefined && params.metallicRoughnessTextureId !== null) {\n metallicRoughnessTexture = this.textures[params.metallicRoughnessTextureId];\n if (!metallicRoughnessTexture) {\n console.error(`Texture not found: ${params.metallicRoughnessTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n metallicRoughnessTexture.channel = METALLIC_ROUGHNESS_TEXTURE;\n }\n\n let normalsTexture;\n if (params.normalsTextureId !== undefined && params.normalsTextureId !== null) {\n normalsTexture = this.textures[params.normalsTextureId];\n if (!normalsTexture) {\n console.error(`Texture not found: ${params.normalsTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n normalsTexture.channel = NORMALS_TEXTURE;\n }\n\n let emissiveTexture;\n if (params.emissiveTextureId !== undefined && params.emissiveTextureId !== null) {\n emissiveTexture = this.textures[params.emissiveTextureId];\n if (!emissiveTexture) {\n console.error(`Texture not found: ${params.emissiveTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n emissiveTexture.channel = EMISSIVE_TEXTURE;\n }\n\n let occlusionTexture;\n if (params.occlusionTextureId !== undefined && params.occlusionTextureId !== null) {\n occlusionTexture = this.textures[params.occlusionTextureId];\n if (!occlusionTexture) {\n console.error(`Texture not found: ${params.occlusionTextureId} - ensure that you create it first with createTexture()`);\n return;\n }\n occlusionTexture.channel = OCCLUSION_TEXTURE;\n }\n\n const textureSet = new XKTTextureSet({\n textureSetId: params.textureSetId,\n textureSetIndex: this.textureSetsList.length,\n colorTexture,\n metallicRoughnessTexture,\n normalsTexture,\n emissiveTexture,\n occlusionTexture\n });\n\n this.textureSets[params.textureSetId] = textureSet;\n this.textureSetsList.push(textureSet);\n\n return textureSet;\n }\n\n /**\n * Creates an {@link XKTGeometry} within this XKTModel.\n *\n * Registers the new {@link XKTGeometry} in {@link XKTModel#geometries} and {@link XKTModel#geometriesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {Number} params.geometryId Unique ID for the {@link XKTGeometry}.\n * @param {String} params.primitiveType The type of {@link XKTGeometry}: \"triangles\", \"lines\" or \"points\".\n * @param {Float64Array} params.positions Floating-point Local-space vertex positions for the {@link XKTGeometry}. Required for all primitive types.\n * @param {Number[]} [params.normals] Floating-point vertex normals for the {@link XKTGeometry}. Only used with triangles primitives. Ignored for points and lines.\n * @param {Number[]} [params.colors] Floating-point RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Number[]} [params.uvs] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uv````.\n * @param {Number[]} [params.uv] Floating-point vertex UV coordinates for the {@link XKTGeometry}. Alias for ````uvs````.\n * @param {Number[]} [params.colorsCompressed] Integer RGBA vertex colors for the {@link XKTGeometry}. Required for points primitives. Ignored for lines and triangles.\n * @param {Uint32Array} [params.indices] Indices for the {@link XKTGeometry}. Required for triangles and lines primitives. Ignored for points.\n * @param {Number} [params.edgeThreshold=10]\n * @returns {XKTGeometry} The new {@link XKTGeometry}.\n */\n createGeometry(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (!params.primitiveType) {\n throw \"Parameter expected: params.primitiveType\";\n }\n\n if (!params.positions) {\n throw \"Parameter expected: params.positions\";\n }\n\n const triangles = params.primitiveType === \"triangles\";\n const points = params.primitiveType === \"points\";\n const lines = params.primitiveType === \"lines\";\n const line_strip = params.primitiveType === \"line-strip\";\n const triangle_strip = params.primitiveType === \"triangle-strip\";\n const triangle_fan = params.primitiveType === \"triangle-fan\";\n\n if (!triangles && !points && !lines && !line_strip) {\n throw \"Unsupported value for params.primitiveType: \"\n + params.primitiveType\n + \"' - supported values are 'triangles', 'points', 'lines', 'line-strip', 'triangle-strip' and 'triangle-fan\";\n }\n\n if (triangles) {\n if (!params.indices) {\n params.indices = this._createDefaultIndices()\n throw \"Parameter expected for 'triangles' primitive: params.indices\";\n }\n }\n\n if (points) {\n if (!params.colors && !params.colorsCompressed) {\n throw \"Parameter expected for 'points' primitive: params.colors or params.colorsCompressed\";\n }\n }\n\n if (lines) {\n if (!params.indices) {\n throw \"Parameter expected for 'lines' primitive: params.indices\";\n }\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more geometries\");\n return;\n }\n\n if (this.geometries[params.geometryId]) {\n console.error(\"XKTGeometry already exists with this ID: \" + params.geometryId);\n return;\n }\n\n const geometryId = params.geometryId;\n const primitiveType = params.primitiveType;\n const positions = new Float64Array(params.positions); // May modify in #finalize\n\n const xktGeometryCfg = {\n geometryId: geometryId,\n geometryIndex: this.geometriesList.length,\n primitiveType: primitiveType,\n positions: positions,\n uvs: params.uvs || params.uv\n }\n\n if (triangles) {\n if (params.normals) {\n xktGeometryCfg.normals = new Float32Array(params.normals);\n }\n if (params.indices) {\n xktGeometryCfg.indices = params.indices;\n } else {\n xktGeometryCfg.indices = this._createDefaultIndices(positions.length / 3);\n }\n }\n\n if (points) {\n if (params.colorsCompressed) {\n xktGeometryCfg.colorsCompressed = new Uint8Array(params.colorsCompressed);\n\n } else {\n const colors = params.colors;\n const colorsCompressed = new Uint8Array(colors.length);\n for (let i = 0, len = colors.length; i < len; i++) {\n colorsCompressed[i] = Math.floor(colors[i] * 255);\n }\n xktGeometryCfg.colorsCompressed = colorsCompressed;\n }\n }\n\n if (lines) {\n xktGeometryCfg.indices = params.indices;\n }\n\n if (triangles) {\n\n if (!params.normals && !params.uv && !params.uvs) {\n\n // Building models often duplicate positions to allow face-aligned vertex normals; when we're not\n // providing normals for a geometry, it becomes possible to merge duplicate vertex positions within it.\n\n // TODO: Make vertex merging also merge normals?\n\n const mergedPositions = [];\n const mergedIndices = [];\n mergeVertices(xktGeometryCfg.positions, xktGeometryCfg.indices, mergedPositions, mergedIndices);\n xktGeometryCfg.positions = new Float64Array(mergedPositions);\n xktGeometryCfg.indices = mergedIndices;\n }\n\n xktGeometryCfg.edgeIndices = buildEdgeIndices(xktGeometryCfg.positions, xktGeometryCfg.indices, null, params.edgeThreshold || this.edgeThreshold || 10);\n }\n\n const geometry = new XKTGeometry(xktGeometryCfg);\n\n this.geometries[geometryId] = geometry;\n this.geometriesList.push(geometry);\n\n return geometry;\n }\n\n _createDefaultIndices(numIndices) {\n const indices = [];\n for (let i = 0; i < numIndices; i++) {\n indices.push(i);\n }\n return indices;\n }\n\n /**\n * Creates an {@link XKTMesh} within this XKTModel.\n *\n * An {@link XKTMesh} can be owned by one {@link XKTEntity}, which can own multiple {@link XKTMesh}es.\n *\n * Registers the new {@link XKTMesh} in {@link XKTModel#meshes} and {@link XKTModel#meshesList}.\n *\n * @param {*} params Method parameters.\n * @param {Number} params.meshId Unique ID for the {@link XKTMesh}.\n * @param {Number} params.geometryId ID of an existing {@link XKTGeometry} in {@link XKTModel#geometries}.\n * @param {Number} [params.textureSetId] Unique ID of an {@link XKTTextureSet} in {@link XKTModel#textureSets}.\n * @param {Float32Array} params.color RGB color for the {@link XKTMesh}, with each color component in range [0..1].\n * @param {Number} [params.metallic=0] How metallic the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully dielectric material, while ````1```` indicates fully metallic.\n * @param {Number} [params.roughness=1] How rough the {@link XKTMesh} is, in range [0..1]. A value of ````0```` indicates fully smooth, while ````1```` indicates fully rough.\n * @param {Number} params.opacity Opacity factor for the {@link XKTMesh}, in range [0..1].\n * @param {Float64Array} [params.matrix] Modeling matrix for the {@link XKTMesh}. Overrides ````position````, ````scale```` and ````rotation```` parameters.\n * @param {Number[]} [params.position=[0,0,0]] Position of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.scale=[1,1,1]] Scale of the {@link XKTMesh}. Overridden by the ````matrix```` parameter.\n * @param {Number[]} [params.rotation=[0,0,0]] Rotation of the {@link XKTMesh} as Euler angles given in degrees, for each of the X, Y and Z axis. Overridden by the ````matrix```` parameter.\n * @returns {XKTMesh} The new {@link XKTMesh}.\n */\n createMesh(params) {\n\n if (params.meshId === null || params.meshId === undefined) {\n throw \"Parameter expected: params.meshId\";\n }\n\n if (params.geometryId === null || params.geometryId === undefined) {\n throw \"Parameter expected: params.geometryId\";\n }\n\n if (this.finalized) {\n throw \"XKTModel has been finalized, can't add more meshes\";\n }\n\n if (this.meshes[params.meshId]) {\n console.error(\"XKTMesh already exists with this ID: \" + params.meshId);\n return;\n }\n\n const geometry = this.geometries[params.geometryId];\n\n if (!geometry) {\n console.error(\"XKTGeometry not found: \" + params.geometryId);\n return;\n }\n\n geometry.numInstances++;\n\n let textureSet = null;\n if (params.textureSetId) {\n textureSet = this.textureSets[params.textureSetId];\n if (!textureSet) {\n console.error(\"XKTTextureSet not found: \" + params.textureSetId);\n return;\n }\n textureSet.numInstances++;\n }\n\n let matrix = params.matrix;\n\n if (!matrix) {\n\n const position = params.position;\n const scale = params.scale;\n const rotation = params.rotation;\n\n if (position || scale || rotation) {\n matrix = math.identityMat4();\n const quaternion = math.eulerToQuaternion(rotation || [0, 0, 0], \"XYZ\", math.identityQuaternion());\n math.composeMat4(position || [0, 0, 0], quaternion, scale || [1, 1, 1], matrix)\n\n } else {\n matrix = math.identityMat4();\n }\n }\n\n const meshIndex = this.meshesList.length;\n\n const mesh = new XKTMesh({\n meshId: params.meshId,\n meshIndex,\n matrix,\n geometry,\n color: params.color,\n metallic: params.metallic,\n roughness: params.roughness,\n opacity: params.opacity,\n textureSet\n });\n\n this.meshes[mesh.meshId] = mesh;\n this.meshesList.push(mesh);\n\n return mesh;\n }\n\n /**\n * Creates an {@link XKTEntity} within this XKTModel.\n *\n * Registers the new {@link XKTEntity} in {@link XKTModel#entities} and {@link XKTModel#entitiesList}.\n *\n * Logs error and does nothing if this XKTModel has been finalized (see {@link XKTModel#finalized}).\n *\n * @param {*} params Method parameters.\n * @param {String} params.entityId Unique ID for the {@link XKTEntity}.\n * @param {String[]} params.meshIds IDs of {@link XKTMesh}es used by the {@link XKTEntity}. Note that each {@link XKTMesh} can only be used by one {@link XKTEntity}.\n * @returns {XKTEntity} The new {@link XKTEntity}.\n */\n createEntity(params) {\n\n if (!params) {\n throw \"Parameters expected: params\";\n }\n\n if (params.entityId === null || params.entityId === undefined) {\n throw \"Parameter expected: params.entityId\";\n }\n\n if (!params.meshIds) {\n throw \"Parameter expected: params.meshIds\";\n }\n\n if (this.finalized) {\n console.error(\"XKTModel has been finalized, can't add more entities\");\n return;\n }\n\n if (params.meshIds.length === 0) {\n console.warn(\"XKTEntity has no meshes - won't create: \" + params.entityId);\n return;\n }\n\n let entityId = params.entityId;\n\n if (this.entities[entityId]) {\n while (this.entities[entityId]) {\n entityId = math.createUUID();\n }\n console.error(\"XKTEntity already exists with this ID: \" + params.entityId + \" - substituting random ID instead: \" + entityId);\n }\n\n const meshIds = params.meshIds;\n const meshes = [];\n\n for (let meshIdIdx = 0, meshIdLen = meshIds.length; meshIdIdx < meshIdLen; meshIdIdx++) {\n\n const meshId = meshIds[meshIdIdx];\n const mesh = this.meshes[meshId];\n\n if (!mesh) {\n console.error(\"XKTMesh found: \" + meshId);\n continue;\n }\n\n if (mesh.entity) {\n console.error(\"XKTMesh \" + meshId + \" already used by XKTEntity \" + mesh.entity.entityId);\n continue;\n }\n\n meshes.push(mesh);\n }\n\n const entity = new XKTEntity(entityId, meshes);\n\n for (let i = 0, len = meshes.length; i < len; i++) {\n const mesh = meshes[i];\n mesh.entity = entity;\n }\n\n this.entities[entityId] = entity;\n this.entitiesList.push(entity);\n\n return entity;\n }\n\n /**\n * Creates a default {@link XKTMetaObject} for each {@link XKTEntity} that does not already have one.\n */\n createDefaultMetaObjects() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const metaObjectId = entity.entityId;\n const metaObject = this.metaObjects[metaObjectId];\n\n if (!metaObject) {\n\n if (!this._rootMetaObject) {\n this._rootMetaObject = this.createMetaObject({\n metaObjectId: this.modelId,\n metaObjectType: \"Default\",\n metaObjectName: this.modelId\n });\n }\n\n this.createMetaObject({\n metaObjectId: metaObjectId,\n metaObjectType: \"Default\",\n metaObjectName: \"\" + metaObjectId,\n parentMetaObjectId: this._rootMetaObject.metaObjectId\n });\n }\n }\n }\n\n /**\n * Finalizes this XKTModel.\n *\n * After finalizing, we may then serialize the model to an array buffer using {@link writeXKTModelToArrayBuffer}.\n *\n * Logs error and does nothing if this XKTModel has already been finalized.\n *\n * Internally, this method:\n *\n * * for each {@link XKTEntity} that doesn't already have a {@link XKTMetaObject}, creates one with {@link XKTMetaObject#metaObjectType} set to \"default\"\n * * sets each {@link XKTEntity}'s {@link XKTEntity#hasReusedGeometries} true if it shares its {@link XKTGeometry}s with other {@link XKTEntity}s,\n * * creates each {@link XKTEntity}'s {@link XKTEntity#aabb},\n * * creates {@link XKTTile}s in {@link XKTModel#tilesList}, and\n * * sets {@link XKTModel#finalized} ````true````.\n */\n async finalize() {\n\n if (this.finalized) {\n console.log(\"XKTModel already finalized\");\n return;\n }\n\n this._removeUnusedTextures();\n\n await this._compressTextures();\n\n this._bakeSingleUseGeometryPositions();\n\n this._bakeAndOctEncodeNormals();\n\n this._createEntityAABBs();\n\n const rootKDNode = this._createKDTree();\n\n this.entitiesList = [];\n\n this._createTilesFromKDTree(rootKDNode);\n\n this._createReusedGeometriesDecodeMatrix();\n\n this._flagSolidGeometries();\n\n this.aabb.set(rootKDNode.aabb);\n\n this.finalized = true;\n }\n\n _removeUnusedTextures() {\n let texturesList = [];\n const textures = {};\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n if (texture.channel !== null) {\n texture.textureIndex = texturesList.length;\n texturesList.push(texture);\n textures[texture.textureId] = texture;\n }\n }\n this.texturesList = texturesList;\n this.textures = textures;\n }\n\n _compressTextures() {\n let countTextures = this.texturesList.length;\n return new Promise((resolve) => {\n if (countTextures === 0) {\n resolve();\n return;\n }\n for (let i = 0, leni = this.texturesList.length; i < leni; i++) {\n const texture = this.texturesList[i];\n const encodingOptions = TEXTURE_ENCODING_OPTIONS[texture.channel] || {};\n\n if (texture.src) {\n\n // XKTTexture created with XKTModel#createTexture({ src: ... })\n\n const src = texture.src;\n const fileExt = src.split('.').pop();\n switch (fileExt) {\n case \"jpeg\":\n case \"jpg\":\n case \"png\":\n load(src, ImageLoader, {\n image: {\n type: \"data\"\n }\n }).then((imageData) => {\n if (texture.compressed) {\n encode(imageData, KTX2BasisWriter, encodingOptions).then((encodedData) => {\n const encodedImageData = new Uint8Array(encodedData);\n texture.imageData = encodedImageData;\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to load image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n break;\n default:\n if (--countTextures <= 0) {\n resolve();\n }\n break;\n }\n }\n\n if (texture.imageData) {\n\n // XKTTexture created with XKTModel#createTexture({ imageData: ... })\n\n if (texture.compressed) {\n encode(texture.imageData, KTX2BasisWriter, encodingOptions)\n .then((encodedImageData) => {\n texture.imageData = new Uint8Array(encodedImageData);\n if (--countTextures <= 0) {\n resolve();\n }\n }).catch((err) => {\n console.error(\"[XKTModel.finalize] Failed to encode image: \" + err);\n if (--countTextures <= 0) {\n resolve();\n }\n });\n } else {\n texture.imageData = new Uint8Array(1);\n if (--countTextures <= 0) {\n resolve();\n }\n }\n }\n }\n });\n }\n\n _bakeSingleUseGeometryPositions() {\n\n for (let j = 0, lenj = this.meshesList.length; j < lenj; j++) {\n\n const mesh = this.meshesList[j];\n\n const geometry = mesh.geometry;\n\n if (geometry.numInstances === 1) {\n\n const matrix = mesh.matrix;\n\n if (matrix && (!math.isIdentityMat4(matrix))) {\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n\n positions[i + 0] = tempVec4b[0];\n positions[i + 1] = tempVec4b[1];\n positions[i + 2] = tempVec4b[2];\n }\n }\n }\n }\n }\n\n _bakeAndOctEncodeNormals() {\n\n for (let i = 0, len = this.meshesList.length; i < len; i++) {\n\n const mesh = this.meshesList[i];\n const geometry = mesh.geometry;\n\n if (geometry.normals && !geometry.normalsOctEncoded) {\n\n geometry.normalsOctEncoded = new Int8Array(geometry.normals.length);\n\n if (geometry.numInstances > 1) {\n geometryCompression.octEncodeNormals(geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n\n } else {\n const modelNormalMatrix = math.inverseMat4(math.transposeMat4(mesh.matrix, tempMat4), tempMat4b);\n geometryCompression.transformAndOctEncodeNormals(modelNormalMatrix, geometry.normals, geometry.normals.length, geometry.normalsOctEncoded, 0);\n }\n }\n }\n }\n\n _createEntityAABBs() {\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n\n const entity = this.entitiesList[i];\n const entityAABB = entity.aabb;\n const meshes = entity.meshes;\n\n math.collapseAABB3(entityAABB);\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n const matrix = mesh.matrix;\n\n if (geometry.numInstances > 1) {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n tempVec4a[3] = 1;\n math.transformPoint4(matrix, tempVec4a, tempVec4b);\n math.expandAABB3Point3(entityAABB, tempVec4b);\n }\n\n } else {\n\n const positions = geometry.positions;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n tempVec4a[0] = positions[i + 0];\n tempVec4a[1] = positions[i + 1];\n tempVec4a[2] = positions[i + 2];\n math.expandAABB3Point3(entityAABB, tempVec4a);\n }\n }\n }\n }\n }\n\n _createKDTree() {\n\n let aabb;\n if (this.modelAABB) {\n aabb = this.modelAABB; // Pre-known uber AABB\n } else {\n aabb = math.collapseAABB3();\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n math.expandAABB3(aabb, entity.aabb);\n }\n }\n\n const rootKDNode = new KDNode(aabb);\n\n for (let i = 0, len = this.entitiesList.length; i < len; i++) {\n const entity = this.entitiesList[i];\n this._insertEntityIntoKDTree(rootKDNode, entity);\n }\n\n return rootKDNode;\n }\n\n _insertEntityIntoKDTree(kdNode, entity) {\n\n const nodeAABB = kdNode.aabb;\n const entityAABB = entity.aabb;\n\n const nodeAABBDiag = math.getAABB3Diag(nodeAABB);\n\n if (nodeAABBDiag < this.minTileSize) {\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n math.expandAABB3(nodeAABB, entityAABB);\n return;\n }\n\n if (kdNode.left) {\n if (math.containsAABB3(kdNode.left.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (kdNode.right) {\n if (math.containsAABB3(kdNode.right.aabb, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdTreeDimLength[0] = nodeAABB[3] - nodeAABB[0];\n kdTreeDimLength[1] = nodeAABB[4] - nodeAABB[1];\n kdTreeDimLength[2] = nodeAABB[5] - nodeAABB[2];\n\n let dim = 0;\n\n if (kdTreeDimLength[1] > kdTreeDimLength[dim]) {\n dim = 1;\n }\n\n if (kdTreeDimLength[2] > kdTreeDimLength[dim]) {\n dim = 2;\n }\n\n if (!kdNode.left) {\n const aabbLeft = nodeAABB.slice();\n aabbLeft[dim + 3] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.left = new KDNode(aabbLeft);\n if (math.containsAABB3(aabbLeft, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.left, entity);\n return;\n }\n }\n\n if (!kdNode.right) {\n const aabbRight = nodeAABB.slice();\n aabbRight[dim] = ((nodeAABB[dim] + nodeAABB[dim + 3]) / 2.0);\n kdNode.right = new KDNode(aabbRight);\n if (math.containsAABB3(aabbRight, entityAABB)) {\n this._insertEntityIntoKDTree(kdNode.right, entity);\n return;\n }\n }\n\n kdNode.entities = kdNode.entities || [];\n kdNode.entities.push(entity);\n\n math.expandAABB3(nodeAABB, entityAABB);\n }\n\n _createTilesFromKDTree(rootKDNode) {\n this._createTilesFromKDNode(rootKDNode);\n }\n\n _createTilesFromKDNode(kdNode) {\n if (kdNode.entities && kdNode.entities.length > 0) {\n this._createTileFromEntities(kdNode);\n }\n if (kdNode.left) {\n this._createTilesFromKDNode(kdNode.left);\n }\n if (kdNode.right) {\n this._createTilesFromKDNode(kdNode.right);\n }\n }\n\n /**\n * Creates a tile from the given entities.\n *\n * For each single-use {@link XKTGeometry}, this method centers {@link XKTGeometry#positions} to make them relative to the\n * tile's center, then quantizes the positions to unsigned 16-bit integers, relative to the tile's boundary.\n *\n * @param kdNode\n */\n _createTileFromEntities(kdNode) {\n\n const tileAABB = kdNode.aabb;\n const entities = kdNode.entities;\n\n const tileCenter = math.getAABB3Center(tileAABB);\n const tileCenterNeg = math.mulVec3Scalar(tileCenter, -1, math.vec3());\n\n const rtcAABB = math.AABB3(); // AABB centered at the RTC origin\n\n rtcAABB[0] = tileAABB[0] - tileCenter[0];\n rtcAABB[1] = tileAABB[1] - tileCenter[1];\n rtcAABB[2] = tileAABB[2] - tileCenter[2];\n rtcAABB[3] = tileAABB[3] - tileCenter[0];\n rtcAABB[4] = tileAABB[4] - tileCenter[1];\n rtcAABB[5] = tileAABB[5] - tileCenter[2];\n\n for (let i = 0; i < entities.length; i++) {\n\n const entity = entities [i];\n\n const meshes = entity.meshes;\n\n for (let j = 0, lenj = meshes.length; j < lenj; j++) {\n\n const mesh = meshes[j];\n const geometry = mesh.geometry;\n\n if (!geometry.reused) { // Batched geometry\n\n const positions = geometry.positions;\n\n // Center positions relative to their tile's World-space center\n\n for (let k = 0, lenk = positions.length; k < lenk; k += 3) {\n\n positions[k + 0] -= tileCenter[0];\n positions[k + 1] -= tileCenter[1];\n positions[k + 2] -= tileCenter[2];\n }\n\n // Quantize positions relative to tile's RTC-space boundary\n\n geometryCompression.quantizePositions(positions, positions.length, rtcAABB, geometry.positionsQuantized);\n\n } else { // Instanced geometry\n\n // Post-multiply a translation to the mesh's modeling matrix\n // to center the entity's geometry instances to the tile RTC center\n\n //////////////////////////////\n // Why do we do this?\n // Seems to break various models\n /////////////////////////////////\n\n math.translateMat4v(tileCenterNeg, mesh.matrix);\n }\n }\n\n entity.entityIndex = this.entitiesList.length;\n\n this.entitiesList.push(entity);\n }\n\n const tile = new XKTTile(tileAABB, entities);\n\n this.tilesList.push(tile);\n }\n\n _createReusedGeometriesDecodeMatrix() {\n\n const tempVec3a = math.vec3();\n const reusedGeometriesAABB = math.collapseAABB3(math.AABB3());\n let countReusedGeometries = 0;\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) { // Instanced geometry\n\n const positions = geometry.positions;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n math.expandAABB3Point3(reusedGeometriesAABB, tempVec3a);\n }\n\n countReusedGeometries++;\n }\n }\n\n if (countReusedGeometries > 0) {\n\n geometryCompression.createPositionsDecodeMatrix(reusedGeometriesAABB, this.reusedGeometriesDecodeMatrix);\n\n for (let geometryIndex = 0, numGeometries = this.geometriesList.length; geometryIndex < numGeometries; geometryIndex++) {\n\n const geometry = this.geometriesList [geometryIndex];\n\n if (geometry.reused) {\n geometryCompression.quantizePositions(geometry.positions, geometry.positions.length, reusedGeometriesAABB, geometry.positionsQuantized);\n }\n }\n\n } else {\n math.identityMat4(this.reusedGeometriesDecodeMatrix); // No need for this matrix, but we'll be tidy and set it to identity\n }\n }\n\n _flagSolidGeometries() {\n let maxNumPositions = 0;\n let maxNumIndices = 0;\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n if (geometry.positionsQuantized.length > maxNumPositions) {\n maxNumPositions = geometry.positionsQuantized.length;\n }\n if (geometry.indices.length > maxNumIndices) {\n maxNumIndices = geometry.indices.length;\n }\n }\n }\n let vertexIndexMapping = new Array(maxNumPositions / 3);\n let edges = new Array(maxNumIndices);\n for (let i = 0, len = this.geometriesList.length; i < len; i++) {\n const geometry = this.geometriesList[i];\n if (geometry.primitiveType === \"triangles\") {\n geometry.solid = isTriangleMeshSolid(geometry.indices, geometry.positionsQuantized, vertexIndexMapping, edges);\n }\n }\n }\n}\n\nexport {\n XKTModel\n}", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -4023,7 +4023,7 @@ "name": "src/XKTModel/XKTPropertySet.js", "content": "/**\n * A property set within an {@link XKTModel}.\n *\n * These are shared among {@link XKTMetaObject}s.\n *\n * * Created by {@link XKTModel#createPropertySet}\n * * Stored in {@link XKTModel#propertySets} and {@link XKTModel#propertySetsList}\n * * Has an ID, a type, and a human-readable name\n *\n * @class XKTPropertySet\n */\nclass XKTPropertySet {\n\n /**\n * @private\n */\n constructor(propertySetId, propertySetType, propertySetName, properties) {\n\n /**\n * Unique ID of this ````XKTPropertySet```` in {@link XKTModel#propertySets}.\n *\n * @type {String}\n */\n this.propertySetId = propertySetId;\n\n /**\n * Indicates the ````XKTPropertySet````'s type.\n *\n * This defaults to \"default\".\n *\n * @type {string}\n */\n this.propertySetType = propertySetType;\n\n /**\n * Indicates the XKTPropertySet meta object name.\n *\n * This defaults to {@link XKTPropertySet#propertySetId}.\n *\n * @type {string}\n */\n this.propertySetName = propertySetName;\n\n /**\n * The properties within this ````XKTPropertySet````.\n *\n * @type {*[]}\n */\n this.properties = properties;\n }\n}\n\nexport {XKTPropertySet};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTPropertySet.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTPropertySet.js", "access": "public", "description": null, "lineNumber": 1 @@ -4145,7 +4145,7 @@ "name": "src/XKTModel/XKTTexture.js", "content": "/**\n * A texture shared by {@link XKTTextureSet}s.\n *\n * * Created by {@link XKTModel#createTexture}\n * * Stored in {@link XKTTextureSet#textures}, {@link XKTModel#textures} and {@link XKTModel#texturesList}\n *\n * @class XKTTexture\n */\nimport {RepeatWrapping, LinearMipMapNearestFilter} from \"../constants\";\n\nclass XKTTexture {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTexture in {@link XKTModel#textures}.\n *\n * @type {Number}\n */\n this.textureId = cfg.textureId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureIndex = cfg.textureIndex;\n\n /**\n * Texture image data.\n *\n * @type {Buffer}\n */\n this.imageData = cfg.imageData;\n\n /**\n * Which material channel this texture is applied to, as determined by its {@link XKTTextureSet}s.\n *\n * @type {Number}\n */\n this.channel = null;\n\n /**\n * Width of this XKTTexture.\n *\n * @type {Number}\n */\n this.width = cfg.width;\n\n /**\n * Height of this XKTTexture.\n *\n * @type {Number}\n */\n this.height = cfg.height;\n\n /**\n * Texture file source.\n *\n * @type {String}\n */\n this.src = cfg.src;\n\n /**\n * Whether this XKTTexture is to be compressed.\n *\n * @type {Boolean}\n */\n this.compressed = (!!cfg.compressed);\n\n /**\n * Media type of this XKTTexture.\n *\n * Supported values are {@link GIFMediaType}, {@link PNGMediaType} and {@link JPEGMediaType}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.mediaType = cfg.mediaType;\n\n /**\n * How the texture is sampled when a texel covers less than one pixel. Supported values\n * are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter},\n * {@link NearestMipMapNearestFilter}, {@link NearestMipMapLinearFilter}\n * and {@link LinearMipMapLinearFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.minFilter = cfg.minFilter || LinearMipMapNearestFilter;\n\n /**\n * How the texture is sampled when a texel covers more than one pixel. Supported values\n * are {@link LinearFilter} and {@link NearestFilter}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.magFilter = cfg.magFilter || LinearMipMapNearestFilter;\n\n /**\n * S wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapS = cfg.wrapS || RepeatWrapping;\n\n /**\n * T wrapping mode.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * Ignored for compressed textures.\n *\n * @type {Number}\n */\n this.wrapT = cfg.wrapT || RepeatWrapping;\n\n /**\n * R wrapping mode.\n *\n * Ignored for compressed textures.\n *\n * Supported values are {@link ClampToEdgeWrapping},\n * {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.\n *\n * @type {*|number}\n */\n this.wrapR = cfg.wrapR || RepeatWrapping\n }\n}\n\nexport {XKTTexture};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTTexture.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTTexture.js", "access": "public", "description": null, "lineNumber": 1 @@ -4453,7 +4453,7 @@ "name": "src/XKTModel/XKTTextureSet.js", "content": "/**\n * A set of textures shared by {@link XKTMesh}es.\n *\n * * Created by {@link XKTModel#createTextureSet}\n * * Registered in {@link XKTMesh#material}, {@link XKTModel#materials} and {@link XKTModel#.textureSetsList}\n *\n * @class XKTMetalRoughMaterial\n */\nclass XKTTextureSet {\n\n /**\n * @private\n */\n constructor(cfg) {\n\n /**\n * Unique ID of this XKTTextureSet in {@link XKTModel#materials}.\n *\n * @type {Number}\n */\n this.textureSetId = cfg.textureSetId;\n\n /**\n * Index of this XKTTexture in {@link XKTModel#texturesList};\n *\n * @type {Number}\n */\n this.textureSetIndex = cfg.textureSetIndex;\n\n /**\n * Identifies the material type.\n *\n * @type {Number}\n */\n this.materialType = cfg.materialType;\n\n /**\n * Index of this XKTTextureSet in {@link XKTModel#meshesList};\n *\n * @type {Number}\n */\n this.materialIndex = cfg.materialIndex;\n\n /**\n * The number of {@link XKTMesh}s that reference this XKTTextureSet.\n *\n * @type {Number}\n */\n this.numInstances = 0;\n\n /**\n * RGBA {@link XKTTexture} containing base color in RGB and opacity in A.\n *\n * @type {XKTTexture}\n */\n this.colorTexture = cfg.colorTexture;\n\n /**\n * RGBA {@link XKTTexture} containing metallic and roughness factors in R and G.\n *\n * @type {XKTTexture}\n */\n this.metallicRoughnessTexture = cfg.metallicRoughnessTexture;\n\n /**\n * RGBA {@link XKTTexture} with surface normals in RGB.\n *\n * @type {XKTTexture}\n */\n this.normalsTexture = cfg.normalsTexture;\n\n /**\n * RGBA {@link XKTTexture} with emissive color in RGB.\n *\n * @type {XKTTexture}\n */\n this.emissiveTexture = cfg.emissiveTexture;\n\n /**\n * RGBA {@link XKTTexture} with ambient occlusion factors in RGB.\n *\n * @type {XKTTexture}\n */\n this.occlusionTexture = cfg.occlusionTexture;\n }\n}\n\nexport {XKTTextureSet};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTTextureSet.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTTextureSet.js", "access": "public", "description": null, "lineNumber": 1 @@ -4689,7 +4689,7 @@ "name": "src/XKTModel/XKTTile.js", "content": "/**\n * @desc A box-shaped 3D region within an {@link XKTModel} that contains {@link XKTEntity}s.\n *\n * * Created by {@link XKTModel#finalize}\n * * Stored in {@link XKTModel#tilesList}\n *\n * @class XKTTile\n */\nclass XKTTile {\n\n /**\n * Creates a new XKTTile.\n *\n * @private\n * @param aabb\n * @param entities\n */\n constructor(aabb, entities) {\n\n /**\n * Axis-aligned World-space bounding box that encloses the {@link XKTEntity}'s within this Tile.\n *\n * @type {Float64Array}\n */\n this.aabb = aabb;\n\n /**\n * The {@link XKTEntity}'s within this XKTTile.\n *\n * @type {XKTEntity[]}\n */\n this.entities = entities;\n }\n}\n\nexport {XKTTile};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/XKTTile.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/XKTTile.js", "access": "public", "description": null, "lineNumber": 1 @@ -4795,7 +4795,7 @@ "name": "src/XKTModel/lib/buildEdgeIndices.js", "content": "import {math} from \"../../lib/math.js\";\n\n/**\n * @private\n */\nconst buildEdgeIndices = (function () {\n\n const uniquePositions = [];\n const indicesLookup = [];\n const indicesReverseLookup = [];\n const weldedIndices = [];\n\n// TODO: Optimize with caching, but need to cater to both compressed and uncompressed positions\n\n const faces = [];\n let numFaces = 0;\n const compa = new Uint16Array(3);\n const compb = new Uint16Array(3);\n const compc = new Uint16Array(3);\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n const cb = math.vec3();\n const ab = math.vec3();\n const cross = math.vec3();\n const normal = math.vec3();\n const inverseNormal = math.vec3();\n\n function weldVertices(positions, indices) {\n const positionsMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique)\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = Math.pow(10, precisionPoints);\n let i;\n let len;\n let lenUniquePositions = 0;\n for (i = 0, len = positions.length; i < len; i += 3) {\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n key = Math.round(vx * precision) + '_' + Math.round(vy * precision) + '_' + Math.round(vz * precision);\n if (positionsMap[key] === undefined) {\n positionsMap[key] = lenUniquePositions / 3;\n uniquePositions[lenUniquePositions++] = vx;\n uniquePositions[lenUniquePositions++] = vy;\n uniquePositions[lenUniquePositions++] = vz;\n }\n indicesLookup[i / 3] = positionsMap[key];\n }\n for (i = 0, len = indices.length; i < len; i++) {\n weldedIndices[i] = indicesLookup[indices[i]];\n indicesReverseLookup[weldedIndices[i]] = indices[i];\n }\n }\n\n function buildFaces(numIndices, positionsDecodeMatrix) {\n numFaces = 0;\n for (let i = 0, len = numIndices; i < len; i += 3) {\n const ia = ((weldedIndices[i]) * 3);\n const ib = ((weldedIndices[i + 1]) * 3);\n const ic = ((weldedIndices[i + 2]) * 3);\n if (positionsDecodeMatrix) {\n compa[0] = uniquePositions[ia];\n compa[1] = uniquePositions[ia + 1];\n compa[2] = uniquePositions[ia + 2];\n compb[0] = uniquePositions[ib];\n compb[1] = uniquePositions[ib + 1];\n compb[2] = uniquePositions[ib + 2];\n compc[0] = uniquePositions[ic];\n compc[1] = uniquePositions[ic + 1];\n compc[2] = uniquePositions[ic + 2];\n // Decode\n math.decompressPosition(compa, positionsDecodeMatrix, a);\n math.decompressPosition(compb, positionsDecodeMatrix, b);\n math.decompressPosition(compc, positionsDecodeMatrix, c);\n } else {\n a[0] = uniquePositions[ia];\n a[1] = uniquePositions[ia + 1];\n a[2] = uniquePositions[ia + 2];\n b[0] = uniquePositions[ib];\n b[1] = uniquePositions[ib + 1];\n b[2] = uniquePositions[ib + 2];\n c[0] = uniquePositions[ic];\n c[1] = uniquePositions[ic + 1];\n c[2] = uniquePositions[ic + 2];\n }\n math.subVec3(c, b, cb);\n math.subVec3(a, b, ab);\n math.cross3Vec3(cb, ab, cross);\n math.normalizeVec3(cross, normal);\n const face = faces[numFaces] || (faces[numFaces] = {normal: math.vec3()});\n face.normal[0] = normal[0];\n face.normal[1] = normal[1];\n face.normal[2] = normal[2];\n numFaces++;\n }\n }\n\n return function (positions, indices, positionsDecodeMatrix, edgeThreshold) {\n weldVertices(positions, indices);\n buildFaces(indices.length, positionsDecodeMatrix);\n const edgeIndices = [];\n const thresholdDot = Math.cos(math.DEGTORAD * edgeThreshold);\n const edges = {};\n let edge1;\n let edge2;\n let index1;\n let index2;\n let key;\n let largeIndex = false;\n let edge;\n let normal1;\n let normal2;\n let dot;\n let ia;\n let ib;\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const faceIndex = i / 3;\n for (let j = 0; j < 3; j++) {\n edge1 = weldedIndices[i + j];\n edge2 = weldedIndices[i + ((j + 1) % 3)];\n index1 = Math.min(edge1, edge2);\n index2 = Math.max(edge1, edge2);\n key = index1 + ',' + index2;\n if (edges[key] === undefined) {\n edges[key] = {\n index1: index1,\n index2: index2,\n face1: faceIndex,\n face2: undefined,\n };\n } else {\n edges[key].face2 = faceIndex;\n }\n }\n }\n for (key in edges) {\n edge = edges[key];\n // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.\n if (edge.face2 !== undefined) {\n normal1 = faces[edge.face1].normal;\n normal2 = faces[edge.face2].normal;\n inverseNormal[0] = -normal2[0];\n inverseNormal[1] = -normal2[1];\n inverseNormal[2] = -normal2[2];\n dot = Math.abs(math.dotVec3(normal1, normal2));\n const dot2 = Math.abs(math.dotVec3(normal1, inverseNormal));\n if (dot > thresholdDot && dot2 > thresholdDot) {\n continue;\n }\n }\n ia = indicesReverseLookup[edge.index1];\n ib = indicesReverseLookup[edge.index2];\n if (!largeIndex && ia > 65535 || ib > 65535) {\n largeIndex = true;\n }\n edgeIndices.push(ia);\n edgeIndices.push(ib);\n }\n return (largeIndex) ? new Uint32Array(edgeIndices) : new Uint16Array(edgeIndices);\n };\n})();\n\n\nexport {buildEdgeIndices};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/buildEdgeIndices.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/buildEdgeIndices.js", "access": "public", "description": null, "lineNumber": 1 @@ -4826,7 +4826,7 @@ "name": "src/XKTModel/lib/buildFaceNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Builds face-aligned vertex normal vectors from positions and indices.\n *\n * @private\n */\nfunction buildFaceNormals(positions, indices, normals) {\n\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n\n const normVec = math.vec3();\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const j0 = indices[i];\n const j1 = indices[i + 1];\n const j2 = indices[i + 2];\n\n a[0] = positions[j0 * 3];\n a[1] = positions[j0 * 3 + 1];\n a[2] = positions[j0 * 3 + 2];\n\n b[0] = positions[j1 * 3];\n b[1] = positions[j1 * 3 + 1];\n b[2] = positions[j1 * 3 + 2];\n\n c[0] = positions[j2 * 3];\n c[1] = positions[j2 * 3 + 1];\n c[2] = positions[j2 * 3 + 2];\n\n triangleNormal(a,b,c, normVec);\n\n normals[j0 * 3 + 0] = normVec[0];\n normals[j0 * 3 + 1] = normVec[1];\n normals[j0 * 3 + 2] = normVec[2];\n\n normals[j1 * 3 + 0] = normVec[0];\n normals[j1 * 3 + 1] = normVec[1];\n normals[j1 * 3 + 2] = normVec[2];\n\n normals[j2 * 3 + 0] = normVec[0];\n normals[j2 * 3 + 1] = normVec[1];\n normals[j2 * 3 + 2] = normVec[2];\n }\n}\n\nfunction triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n}\n\nexport {buildFaceNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/buildFaceNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/buildFaceNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -4925,7 +4925,7 @@ "name": "src/XKTModel/lib/buildVertexNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Builds vertex normal vectors from positions and indices.\n *\n * @private\n */\nfunction buildVertexNormals(positions, indices, normals) {\n\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n const ab = math.vec3();\n const ac = math.vec3();\n const crossVec = math.vec3();\n const nvecs = new Array(positions.length / 3);\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const j0 = indices[i];\n const j1 = indices[i + 1];\n const j2 = indices[i + 2];\n\n a[0] = positions[j0 * 3];\n a[1] = positions[j0 * 3 + 1];\n a[2] = positions[j0 * 3 + 2];\n\n b[0] = positions[j1 * 3];\n b[1] = positions[j1 * 3 + 1];\n b[2] = positions[j1 * 3 + 2];\n\n c[0] = positions[j2 * 3];\n c[1] = positions[j2 * 3 + 1];\n c[2] = positions[j2 * 3 + 2];\n\n math.subVec3(b, a, ab);\n math.subVec3(c, a, ac);\n\n const normVec = math.vec3();\n\n math.normalizeVec3(math.cross3Vec3(ab, ac, crossVec), normVec);\n\n if (!nvecs[j0]) {\n nvecs[j0] = [];\n }\n if (!nvecs[j1]) {\n nvecs[j1] = [];\n }\n if (!nvecs[j2]) {\n nvecs[j2] = [];\n }\n\n nvecs[j0].push(normVec);\n nvecs[j1].push(normVec);\n nvecs[j2].push(normVec);\n }\n\n normals = (normals && normals.length === positions.length) ? normals : new Float32Array(positions.length);\n\n for (let i = 0, len = nvecs.length; i < len; i++) { // Now go through and average out everything\n\n const count = nvecs[i].length;\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n for (let j = 0; j < count; j++) {\n x += nvecs[i][j][0];\n y += nvecs[i][j][1];\n z += nvecs[i][j][2];\n }\n\n normals[i * 3] = (x / count);\n normals[i * 3 + 1] = (y / count);\n normals[i * 3 + 2] = (z / count);\n }\n\n return normals;\n}\n\nexport {buildVertexNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/buildVertexNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/buildVertexNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -4978,7 +4978,7 @@ "name": "src/XKTModel/lib/earcut.js", "content": "/** @private */\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n\n // filter collinear points around the cuts\n filterPoints(outerNode, outerNode.next);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n\nexport {earcut};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/earcut.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/earcut.js", "access": "public", "description": null, "lineNumber": 1 @@ -6426,7 +6426,7 @@ "name": "src/XKTModel/lib/faceToVertexNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Converts surface-perpendicular face normals to vertex normals. Assumes that the mesh contains disjoint triangles\n * that don't share vertex array elements. Works by finding groups of vertices that have the same location and\n * averaging their normal vectors.\n *\n * @returns {{positions: Array, normals: *}}\n * @private\n */\nfunction faceToVertexNormals(positions, normals, options = {}) {\n const smoothNormalsAngleThreshold = options.smoothNormalsAngleThreshold || 20;\n const vertexMap = {};\n const vertexNormals = [];\n const vertexNormalAccum = {};\n let acc;\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let posi;\n let i;\n let j;\n let len;\n let a;\n let b;\n let c;\n\n for (i = 0, len = positions.length; i < len; i += 3) {\n\n posi = i / 3;\n\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n\n key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n\n if (vertexMap[key] === undefined) {\n vertexMap[key] = [posi];\n } else {\n vertexMap[key].push(posi);\n }\n\n const normal = math.normalizeVec3([normals[i], normals[i + 1], normals[i + 2]]);\n\n vertexNormals[posi] = normal;\n\n acc = math.vec4([normal[0], normal[1], normal[2], 1]);\n\n vertexNormalAccum[posi] = acc;\n }\n\n for (key in vertexMap) {\n\n if (vertexMap.hasOwnProperty(key)) {\n\n const vertices = vertexMap[key];\n const numVerts = vertices.length;\n\n for (i = 0; i < numVerts; i++) {\n\n const ii = vertices[i];\n\n acc = vertexNormalAccum[ii];\n\n for (j = 0; j < numVerts; j++) {\n\n if (i === j) {\n continue;\n }\n\n const jj = vertices[j];\n\n a = vertexNormals[ii];\n b = vertexNormals[jj];\n\n const angle = Math.abs(math.angleVec3(a, b) / math.DEGTORAD);\n\n if (angle < smoothNormalsAngleThreshold) {\n\n acc[0] += b[0];\n acc[1] += b[1];\n acc[2] += b[2];\n acc[3] += 1.0;\n }\n }\n }\n }\n }\n\n for (i = 0, len = normals.length; i < len; i += 3) {\n\n acc = vertexNormalAccum[i / 3];\n\n normals[i + 0] = acc[0] / acc[3];\n normals[i + 1] = acc[1] / acc[3];\n normals[i + 2] = acc[2] / acc[3];\n\n }\n}\n\nexport {faceToVertexNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/faceToVertexNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/faceToVertexNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -6491,7 +6491,7 @@ "name": "src/XKTModel/lib/geometryCompression.js", "content": "import {math} from \"../../lib/math.js\";\n\nfunction quantizePositions (positions, lenPositions, aabb, quantizedPositions) {\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n const xMultiplier = maxInt / xwid;\n const yMultiplier = maxInt / ywid;\n const zMultiplier = maxInt / zwid;\n const verify = (num) => num >= 0 ? num : 0;\n for (let i = 0; i < lenPositions; i += 3) {\n quantizedPositions[i + 0] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 0] - xmin) * xMultiplier)));\n quantizedPositions[i + 1] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 1] - ymin) * yMultiplier)));\n quantizedPositions[i + 2] = Math.max(0, Math.min(65535,Math.floor(verify(positions[i + 2] - zmin) * zMultiplier)));\n }\n}\n\nfunction compressPosition(p, aabb, q) {\n const multiplier = new Float32Array([\n aabb[3] !== aabb[0] ? 65535 / (aabb[3] - aabb[0]) : 0,\n aabb[4] !== aabb[1] ? 65535 / (aabb[4] - aabb[1]) : 0,\n aabb[5] !== aabb[2] ? 65535 / (aabb[5] - aabb[2]) : 0\n ]);\n q[0] = Math.max(0, Math.min(65535, Math.floor((p[0] - aabb[0]) * multiplier[0])));\n q[1] = Math.max(0, Math.min(65535, Math.floor((p[1] - aabb[1]) * multiplier[1])));\n q[2] = Math.max(0, Math.min(65535, Math.floor((p[2] - aabb[2]) * multiplier[2])));\n}\n\nvar createPositionsDecodeMatrix = (function () {\n const translate = math.mat4();\n const scale = math.mat4();\n return function (aabb, positionsDecodeMatrix) {\n positionsDecodeMatrix = positionsDecodeMatrix || math.mat4();\n const xmin = aabb[0];\n const ymin = aabb[1];\n const zmin = aabb[2];\n const xwid = aabb[3] - xmin;\n const ywid = aabb[4] - ymin;\n const zwid = aabb[5] - zmin;\n const maxInt = 65535;\n math.identityMat4(translate);\n math.translationMat4v(aabb, translate);\n math.identityMat4(scale);\n math.scalingMat4v([xwid / maxInt, ywid / maxInt, zwid / maxInt], scale);\n math.mulMat4(translate, scale, positionsDecodeMatrix);\n return positionsDecodeMatrix;\n };\n})();\n\nfunction transformAndOctEncodeNormals(modelNormalMatrix, normals, lenNormals, compressedNormals, lenCompressedNormals) {\n // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n let i, ei;\n let localNormal = math.vec3();\n let worldNormal = math.vec3();\n for (i = 0; i < lenNormals; i += 3) {\n localNormal[0] = normals[i];\n localNormal[1] = normals[i + 1];\n localNormal[2] = normals[i + 2];\n\n math.transformVec3(modelNormalMatrix, localNormal, worldNormal);\n math.normalizeVec3(worldNormal, worldNormal);\n\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(worldNormal, 0, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(worldNormal, 0, dec);\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(worldNormal, 0, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(worldNormal, 0, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\nfunction octEncodeNormals(normals, lenNormals, compressedNormals, lenCompressedNormals) { // http://jcgt.org/published/0003/02/01/\n let oct, dec, best, currentCos, bestCos;\n for (let i = 0; i < lenNormals; i += 3) {\n // Test various combinations of ceil and floor to minimize rounding errors\n best = oct = octEncodeVec3(normals, i, \"floor\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = bestCos = dot(normals, i, dec);\n oct = octEncodeVec3(normals, i, \"ceil\", \"floor\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"floor\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n oct = octEncodeVec3(normals, i, \"ceil\", \"ceil\");\n dec = octDecodeVec2(oct);\n currentCos = dot(normals, i, dec);\n if (currentCos > bestCos) {\n best = oct;\n bestCos = currentCos;\n }\n compressedNormals[lenCompressedNormals + i + 0] = best[0];\n compressedNormals[lenCompressedNormals + i + 1] = best[1];\n compressedNormals[lenCompressedNormals + i + 2] = 0.0; // Unused\n }\n lenCompressedNormals += lenNormals;\n return lenCompressedNormals;\n}\n\n/**\n * @private\n */\nfunction octEncodeVec3(array, i, xfunc, yfunc) { // Oct-encode single normal vector in 2 bytes\n let x = array[i] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n let y = array[i + 1] / (Math.abs(array[i]) + Math.abs(array[i + 1]) + Math.abs(array[i + 2]));\n if (array[i + 2] < 0) {\n let tempx = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n let tempy = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n x = tempx;\n y = tempy;\n }\n return new Int8Array([\n Math[xfunc](x * 127.5 + (x < 0 ? -1 : 0)),\n Math[yfunc](y * 127.5 + (y < 0 ? -1 : 0))\n ]);\n}\n\n/**\n * Decode an oct-encoded normal\n */\nfunction octDecodeVec2(oct) {\n let x = oct[0];\n let y = oct[1];\n x /= x < 0 ? 127 : 128;\n y /= y < 0 ? 127 : 128;\n const z = 1 - Math.abs(x) - Math.abs(y);\n if (z < 0) {\n x = (1 - Math.abs(y)) * (x >= 0 ? 1 : -1);\n y = (1 - Math.abs(x)) * (y >= 0 ? 1 : -1);\n }\n const length = Math.sqrt(x * x + y * y + z * z);\n return [\n x / length,\n y / length,\n z / length\n ];\n}\n\n/**\n * Dot product of a normal in an array against a candidate decoding\n * @private\n */\nfunction dot(array, i, vec3) {\n return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2];\n}\n\n/**\n * @private\n */\nconst geometryCompression = {\n quantizePositions,\n compressPosition,\n createPositionsDecodeMatrix,\n transformAndOctEncodeNormals,\n octEncodeNormals,\n};\n\nexport {geometryCompression}", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/geometryCompression.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/geometryCompression.js", "access": "public", "description": null, "lineNumber": 1 @@ -6851,7 +6851,7 @@ "name": "src/XKTModel/lib/isTriangleMeshSolid.js", "content": "/**\n * Uses edge adjacency counts to identify if the given triangle mesh can be rendered with backface culling enabled.\n *\n * If all edges are connected to exactly two triangles, then the mesh will likely be a closed solid, and we can safely\n * render it with backface culling enabled.\n *\n * Otherwise, the mesh is a surface, and we must render it with backface culling disabled.\n *\n * @private\n */\nconst isTriangleMeshSolid = (indices, positions, vertexIndexMapping, edges) => {\n\n function compareIndexPositions(a, b)\n {\n let posA, posB;\n\n for (let i = 0; i < 3; i++) {\n posA = positions [a*3+i];\n posB = positions [b*3+i];\n\n if (posA !== posB) {\n return posB - posA;\n }\n }\n\n return 0;\n };\n\n // Group together indices corresponding to same position coordinates\n let newIndices = indices.slice ().sort (compareIndexPositions);\n\n // Calculate the mapping:\n // - from original index in indices array\n // - to indices-for-unique-positions\n let uniqueVertexIndex = null;\n\n for (let i = 0, len = newIndices.length; i < len; i++) {\n if (i == 0 || 0 != compareIndexPositions (\n newIndices[i],\n newIndices[i-1],\n )) {\n // different position\n uniqueVertexIndex = newIndices [i];\n }\n\n vertexIndexMapping [\n newIndices[i]\n ] = uniqueVertexIndex;\n }\n\n // Generate the list of edges\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const a = vertexIndexMapping[indices[i]];\n const b = vertexIndexMapping[indices[i+1]];\n const c = vertexIndexMapping[indices[i+2]];\n\n let a2 = a;\n let b2 = b;\n let c2 = c;\n\n if (a > b && a > c) {\n if (b > c) {\n a2 = a;\n b2 = b;\n c2 = c;\n } else {\n a2 = a;\n b2 = c;\n c2 = b;\n }\n } else if (b > a && b > c) {\n if (a > c) {\n a2 = b;\n b2 = a;\n c2 = c;\n } else {\n a2 = b;\n b2 = c;\n c2 = a;\n }\n } else if (c > a && c > b) {\n if (a > b) {\n a2 = c;\n b2 = a;\n c2 = b;\n } else {\n a2 = c;\n b2 = b;\n c2 = a;\n }\n }\n\n edges[i+0] = [\n a2, b2\n ];\n edges[i+1] = [\n b2, c2\n ];\n\n if (a2 > c2) {\n const temp = c2;\n c2 = a2;\n a2 = temp;\n }\n\n edges[i+2] = [\n c2, a2\n ];\n }\n\n // Group semantically equivalent edgdes together\n function compareEdges (e1, e2) {\n let a, b;\n\n for (let i = 0; i < 2; i++) {\n a = e1[i];\n b = e2[i];\n\n if (b !== a) {\n return b - a;\n }\n }\n\n return 0;\n }\n\n edges = edges.slice(0, indices.length);\n\n edges.sort (compareEdges);\n\n // Make sure each edge is used exactly twice\n let sameEdgeCount = 0;\n\n for (let i = 0; i < edges.length; i++)\n {\n if (i === 0 || 0 !== compareEdges (\n edges[i], edges[i-1]\n )) {\n // different edge\n if (0 !== i && sameEdgeCount !== 2)\n {\n return false;\n }\n\n sameEdgeCount = 1;\n }\n else\n {\n // same edge\n sameEdgeCount++;\n }\n }\n\n if (edges.length > 0 && sameEdgeCount !== 2)\n {\n return false;\n }\n\n // Each edge is used exactly twice, this is a\n // watertight surface and hence a solid geometry.\n return true;\n};\n\nexport {isTriangleMeshSolid};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/isTriangleMeshSolid.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/isTriangleMeshSolid.js", "access": "public", "description": null, "lineNumber": 1 @@ -6910,7 +6910,7 @@ "name": "src/XKTModel/lib/math.js", "content": "// Some temporary vars to help avoid garbage collection\n\nconst doublePrecision = true;\nconst FloatArrayType = doublePrecision ? Float64Array : Float32Array;\n\nconst tempMat1 = new FloatArrayType(16);\nconst tempMat2 = new FloatArrayType(16);\nconst tempVec4 = new FloatArrayType(4);\n\n/**\n * @private\n */\nconst math = {\n\n MIN_DOUBLE: -Number.MAX_SAFE_INTEGER,\n MAX_DOUBLE: Number.MAX_SAFE_INTEGER,\n\n /**\n * The number of radiians in a degree (0.0174532925).\n * @property DEGTORAD\n * @type {Number}\n */\n DEGTORAD: 0.0174532925,\n\n /**\n * The number of degrees in a radian.\n * @property RADTODEG\n * @type {Number}\n */\n RADTODEG: 57.295779513,\n\n /**\n * Returns a new, uninitialized two-element vector.\n * @method vec2\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec2(values) {\n return new FloatArrayType(values || 2);\n },\n\n /**\n * Returns a new, uninitialized three-element vector.\n * @method vec3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec3(values) {\n return new FloatArrayType(values || 3);\n },\n\n /**\n * Returns a new, uninitialized four-element vector.\n * @method vec4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec4(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3x3 matrix.\n * @method mat3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat3(values) {\n return new FloatArrayType(values || 9);\n },\n\n /**\n * Converts a 3x3 matrix to 4x4\n * @method mat3ToMat4\n * @param mat3 3x3 matrix.\n * @param mat4 4x4 matrix\n * @static\n * @returns {Number[]}\n */\n mat3ToMat4(mat3, mat4 = new FloatArrayType(16)) {\n mat4[0] = mat3[0];\n mat4[1] = mat3[1];\n mat4[2] = mat3[2];\n mat4[3] = 0;\n mat4[4] = mat3[3];\n mat4[5] = mat3[4];\n mat4[6] = mat3[5];\n mat4[7] = 0;\n mat4[8] = mat3[6];\n mat4[9] = mat3[7];\n mat4[10] = mat3[8];\n mat4[11] = 0;\n mat4[12] = 0;\n mat4[13] = 0;\n mat4[14] = 0;\n mat4[15] = 1;\n return mat4;\n },\n\n /**\n * Returns a new, uninitialized 4x4 matrix.\n * @method mat4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat4(values) {\n return new FloatArrayType(values || 16);\n },\n\n /**\n * Converts a 4x4 matrix to 3x3\n * @method mat4ToMat3\n * @param mat4 4x4 matrix.\n * @param mat3 3x3 matrix\n * @static\n * @returns {Number[]}\n */\n mat4ToMat3(mat4, mat3) { // TODO\n //return new FloatArrayType(values || 9);\n },\n\n /**\n * Returns a new UUID.\n * @method createUUID\n * @static\n * @return string The new UUID\n */\n createUUID: ((() => {\n const self = {};\n const lut = [];\n for (let i = 0; i < 256; i++) {\n lut[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n return () => {\n const d0 = Math.random() * 0xffffffff | 0;\n const d1 = Math.random() * 0xffffffff | 0;\n const d2 = Math.random() * 0xffffffff | 0;\n const d3 = Math.random() * 0xffffffff | 0;\n return `${lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]}-${lut[d1 & 0xff]}${lut[d1 >> 8 & 0xff]}-${lut[d1 >> 16 & 0x0f | 0x40]}${lut[d1 >> 24 & 0xff]}-${lut[d2 & 0x3f | 0x80]}${lut[d2 >> 8 & 0xff]}-${lut[d2 >> 16 & 0xff]}${lut[d2 >> 24 & 0xff]}${lut[d3 & 0xff]}${lut[d3 >> 8 & 0xff]}${lut[d3 >> 16 & 0xff]}${lut[d3 >> 24 & 0xff]}`;\n };\n }))(),\n\n /**\n * Clamps a value to the given range.\n * @param {Number} value Value to clamp.\n * @param {Number} min Lower bound.\n * @param {Number} max Upper bound.\n * @returns {Number} Clamped result.\n */\n clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n },\n\n /**\n * Floating-point modulus\n * @method fmod\n * @static\n * @param {Number} a\n * @param {Number} b\n * @returns {*}\n */\n fmod(a, b) {\n if (a < b) {\n console.error(\"math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring\");\n return a;\n }\n while (b <= a) {\n a -= b;\n }\n return a;\n },\n\n /**\n * Negates a four-element vector.\n * @method negateVec4\n * @static\n * @param {Array(Number)} v Vector to negate\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n negateVec4(v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = -v[0];\n dest[1] = -v[1];\n dest[2] = -v[2];\n dest[3] = -v[3];\n return dest;\n },\n\n /**\n * Adds one four-element vector to another.\n * @method addVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n dest[3] = u[3] + v[3];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a four-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n dest[3] = v[3] + s;\n return dest;\n },\n\n /**\n * Adds one three-element vector to another.\n * @method addVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a three-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n return dest;\n },\n\n /**\n * Subtracts one four-element vector from another.\n * @method subVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n dest[3] = u[3] - v[3];\n return dest;\n },\n\n /**\n * Subtracts one three-element vector from another.\n * @method subVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n return dest;\n },\n\n /**\n * Subtracts one two-element vector from another.\n * @method subVec2\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec2(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n return dest;\n },\n\n /**\n * Subtracts a scalar value from each element of a four-element vector.\n * @method subVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] - s;\n dest[1] = v[1] - s;\n dest[2] = v[2] - s;\n dest[3] = v[3] - s;\n return dest;\n },\n\n /**\n * Sets each element of a 4-element vector to a scalar value minus the value of that element.\n * @method subScalarVec4\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subScalarVec4(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s - v[0];\n dest[1] = s - v[1];\n dest[2] = s - v[2];\n dest[3] = s - v[3];\n return dest;\n },\n\n /**\n * Multiplies one three-element vector by another.\n * @method mulVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n mulVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] * v[0];\n dest[1] = u[1] * v[1];\n dest[2] = u[2] * v[2];\n dest[3] = u[3] * v[3];\n return dest;\n },\n\n /**\n * Multiplies each element of a four-element vector by a scalar.\n * @method mulVec34calar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n dest[3] = v[3] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a three-element vector by a scalar.\n * @method mulVec3Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a two-element vector by a scalar.\n * @method mulVec2Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec2Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n return dest;\n },\n\n /**\n * Divides one three-element vector by another.\n * @method divVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n return dest;\n },\n\n /**\n * Divides one four-element vector by another.\n * @method divVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n dest[3] = u[3] / v[3];\n return dest;\n },\n\n /**\n * Divides a scalar by a three-element vector, returning a new vector.\n * @method divScalarVec3\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec3(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n return dest;\n },\n\n /**\n * Divides a three-element vector by a scalar.\n * @method divVec3Scalar\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n return dest;\n },\n\n /**\n * Divides a four-element vector by a scalar.\n * @method divVec4Scalar\n * @static\n * @param v vec4\n * @param s scalar\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n dest[3] = v[3] / s;\n return dest;\n },\n\n\n /**\n * Divides a scalar by a four-element vector, returning a new vector.\n * @method divScalarVec4\n * @static\n * @param s scalar\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec4(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n dest[3] = s / v[3];\n return dest;\n },\n\n /**\n * Returns the dot product of two four-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec4(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2] + u[3] * v[3]);\n },\n\n /**\n * Returns the cross product of two four-element vectors.\n * @method cross3Vec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec4(u, v) {\n const u0 = u[0];\n const u1 = u[1];\n const u2 = u[2];\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return [\n u1 * v2 - u2 * v1,\n u2 * v0 - u0 * v2,\n u0 * v1 - u1 * v0,\n 0.0];\n },\n\n /**\n * Returns the cross product of two three-element vectors.\n * @method cross3Vec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n const x = u[0];\n const y = u[1];\n const z = u[2];\n const x2 = v[0];\n const y2 = v[1];\n const z2 = v[2];\n dest[0] = y * z2 - z * y2;\n dest[1] = z * x2 - x * z2;\n dest[2] = x * y2 - y * x2;\n return dest;\n },\n\n\n sqLenVec4(v) { // TODO\n return math.dotVec4(v, v);\n },\n\n /**\n * Returns the length of a four-element vector.\n * @method lenVec4\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec4(v) {\n return Math.sqrt(math.sqLenVec4(v));\n },\n\n /**\n * Returns the dot product of two three-element vectors.\n * @method dotVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec3(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);\n },\n\n /**\n * Returns the dot product of two two-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec2(u, v) {\n return (u[0] * v[0] + u[1] * v[1]);\n },\n\n\n sqLenVec3(v) {\n return math.dotVec3(v, v);\n },\n\n\n sqLenVec2(v) {\n return math.dotVec2(v, v);\n },\n\n /**\n * Returns the length of a three-element vector.\n * @method lenVec3\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec3(v) {\n return Math.sqrt(math.sqLenVec3(v));\n },\n\n distVec3: ((() => {\n const vec = new FloatArrayType(3);\n return (v, w) => math.lenVec3(math.subVec3(v, w, vec));\n }))(),\n\n /**\n * Returns the length of a two-element vector.\n * @method lenVec2\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec2(v) {\n return Math.sqrt(math.sqLenVec2(v));\n },\n\n distVec2: ((() => {\n const vec = new FloatArrayType(2);\n return (v, w) => math.lenVec2(math.subVec2(v, w, vec));\n }))(),\n\n /**\n * @method rcpVec3\n * @static\n * @param v vec3\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n rcpVec3(v, dest) {\n return math.divScalarVec3(1.0, v, dest);\n },\n\n /**\n * Normalizes a four-element vector\n * @method normalizeVec4\n * @static\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n normalizeVec4(v, dest) {\n const f = 1.0 / math.lenVec4(v);\n return math.mulVec4Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a three-element vector\n * @method normalizeVec4\n * @static\n */\n normalizeVec3(v, dest) {\n const f = 1.0 / math.lenVec3(v);\n return math.mulVec3Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a two-element vector\n * @method normalizeVec2\n * @static\n */\n normalizeVec2(v, dest) {\n const f = 1.0 / math.lenVec2(v);\n return math.mulVec2Scalar(v, f, dest);\n },\n\n /**\n * Gets the angle between two vectors\n * @method angleVec3\n * @param v\n * @param w\n * @returns {number}\n */\n angleVec3(v, w) {\n let theta = math.dotVec3(v, w) / (Math.sqrt(math.sqLenVec3(v) * math.sqLenVec3(w)));\n theta = theta < -1 ? -1 : (theta > 1 ? 1 : theta); // Clamp to handle numerical problems\n return Math.acos(theta);\n },\n\n /**\n * Creates a three-element vector from the rotation part of a sixteen-element matrix.\n * @param m\n * @param dest\n */\n vec3FromMat4Scale: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (m, dest) => {\n\n tempVec3[0] = m[0];\n tempVec3[1] = m[1];\n tempVec3[2] = m[2];\n\n dest[0] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[4];\n tempVec3[1] = m[5];\n tempVec3[2] = m[6];\n\n dest[1] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[8];\n tempVec3[1] = m[9];\n tempVec3[2] = m[10];\n\n dest[2] = math.lenVec3(tempVec3);\n\n return dest;\n };\n }))(),\n\n /**\n * Converts an n-element vector to a JSON-serializable\n * array with values rounded to two decimal places.\n */\n vecToArray: ((() => {\n function trunc(v) {\n return Math.round(v * 100000) / 100000\n }\n\n return v => {\n v = Array.prototype.slice.call(v);\n for (let i = 0, len = v.length; i < len; i++) {\n v[i] = trunc(v[i]);\n }\n return v;\n };\n }))(),\n\n /**\n * Converts a 3-element vector from an array to an object of the form ````{x:999, y:999, z:999}````.\n * @param arr\n * @returns {{x: *, y: *, z: *}}\n */\n xyzArrayToObject(arr) {\n return {\"x\": arr[0], \"y\": arr[1], \"z\": arr[2]};\n },\n\n /**\n * Converts a 3-element vector object of the form ````{x:999, y:999, z:999}```` to an array.\n * @param xyz\n * @param [arry]\n * @returns {*[]}\n */\n xyzObjectToArray(xyz, arry) {\n arry = arry || new FloatArrayType(3);\n arry[0] = xyz.x;\n arry[1] = xyz.y;\n arry[2] = xyz.z;\n return arry;\n },\n\n /**\n * Duplicates a 4x4 identity matrix.\n * @method dupMat4\n * @static\n */\n dupMat4(m) {\n return m.slice(0, 16);\n },\n\n /**\n * Extracts a 3x3 matrix from a 4x4 matrix.\n * @method mat4To3\n * @static\n */\n mat4To3(m) {\n return [\n m[0], m[1], m[2],\n m[4], m[5], m[6],\n m[8], m[9], m[10]\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to the given scalar value.\n * @method m4s\n * @static\n */\n m4s(s) {\n return [\n s, s, s, s,\n s, s, s, s,\n s, s, s, s,\n s, s, s, s\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to zero.\n * @method setMat4ToZeroes\n * @static\n */\n setMat4ToZeroes() {\n return math.m4s(0.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n setMat4ToOnes() {\n return math.m4s(1.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n diagonalMat4v(v) {\n return new FloatArrayType([\n v[0], 0.0, 0.0, 0.0,\n 0.0, v[1], 0.0, 0.0,\n 0.0, 0.0, v[2], 0.0,\n 0.0, 0.0, 0.0, v[3]\n ]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given vector.\n * @method diagonalMat4c\n * @static\n */\n diagonalMat4c(x, y, z, w) {\n return math.diagonalMat4v([x, y, z, w]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given scalar.\n * @method diagonalMat4s\n * @static\n */\n diagonalMat4s(s) {\n return math.diagonalMat4c(s, s, s, s);\n },\n\n /**\n * Returns a 4x4 identity matrix.\n * @method identityMat4\n * @static\n */\n identityMat4(mat = new FloatArrayType(16)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n mat[3] = 0.0;\n\n mat[4] = 0.0;\n mat[5] = 1.0;\n mat[6] = 0.0;\n mat[7] = 0.0;\n\n mat[8] = 0.0;\n mat[9] = 0.0;\n mat[10] = 1.0;\n mat[11] = 0.0;\n\n mat[12] = 0.0;\n mat[13] = 0.0;\n mat[14] = 0.0;\n mat[15] = 1.0;\n\n return mat;\n },\n\n /**\n * Returns a 3x3 identity matrix.\n * @method identityMat3\n * @static\n */\n identityMat3(mat = new FloatArrayType(9)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n\n mat[3] = 0.0;\n mat[4] = 1.0;\n mat[5] = 0.0;\n\n mat[6] = 0.0;\n mat[7] = 0.0;\n mat[8] = 1.0;\n\n return mat;\n },\n\n /**\n * Tests if the given 4x4 matrix is the identity matrix.\n * @method isIdentityMat4\n * @static\n */\n isIdentityMat4(m) {\n if (m[0] !== 1.0 || m[1] !== 0.0 || m[2] !== 0.0 || m[3] !== 0.0 ||\n m[4] !== 0.0 || m[5] !== 1.0 || m[6] !== 0.0 || m[7] !== 0.0 ||\n m[8] !== 0.0 || m[9] !== 0.0 || m[10] !== 1.0 || m[11] !== 0.0 ||\n m[12] !== 0.0 || m[13] !== 0.0 || m[14] !== 0.0 || m[15] !== 1.0) {\n return false;\n }\n return true;\n },\n\n /**\n * Negates the given 4x4 matrix.\n * @method negateMat4\n * @static\n */\n negateMat4(m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = -m[0];\n dest[1] = -m[1];\n dest[2] = -m[2];\n dest[3] = -m[3];\n dest[4] = -m[4];\n dest[5] = -m[5];\n dest[6] = -m[6];\n dest[7] = -m[7];\n dest[8] = -m[8];\n dest[9] = -m[9];\n dest[10] = -m[10];\n dest[11] = -m[11];\n dest[12] = -m[12];\n dest[13] = -m[13];\n dest[14] = -m[14];\n dest[15] = -m[15];\n return dest;\n },\n\n /**\n * Adds the given 4x4 matrices together.\n * @method addMat4\n * @static\n */\n addMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] + b[0];\n dest[1] = a[1] + b[1];\n dest[2] = a[2] + b[2];\n dest[3] = a[3] + b[3];\n dest[4] = a[4] + b[4];\n dest[5] = a[5] + b[5];\n dest[6] = a[6] + b[6];\n dest[7] = a[7] + b[7];\n dest[8] = a[8] + b[8];\n dest[9] = a[9] + b[9];\n dest[10] = a[10] + b[10];\n dest[11] = a[11] + b[11];\n dest[12] = a[12] + b[12];\n dest[13] = a[13] + b[13];\n dest[14] = a[14] + b[14];\n dest[15] = a[15] + b[15];\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addMat4Scalar\n * @static\n */\n addMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] + s;\n dest[1] = m[1] + s;\n dest[2] = m[2] + s;\n dest[3] = m[3] + s;\n dest[4] = m[4] + s;\n dest[5] = m[5] + s;\n dest[6] = m[6] + s;\n dest[7] = m[7] + s;\n dest[8] = m[8] + s;\n dest[9] = m[9] + s;\n dest[10] = m[10] + s;\n dest[11] = m[11] + s;\n dest[12] = m[12] + s;\n dest[13] = m[13] + s;\n dest[14] = m[14] + s;\n dest[15] = m[15] + s;\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addScalarMat4\n * @static\n */\n addScalarMat4(s, m, dest) {\n return math.addMat4Scalar(m, s, dest);\n },\n\n /**\n * Subtracts the second 4x4 matrix from the first.\n * @method subMat4\n * @static\n */\n subMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] - b[0];\n dest[1] = a[1] - b[1];\n dest[2] = a[2] - b[2];\n dest[3] = a[3] - b[3];\n dest[4] = a[4] - b[4];\n dest[5] = a[5] - b[5];\n dest[6] = a[6] - b[6];\n dest[7] = a[7] - b[7];\n dest[8] = a[8] - b[8];\n dest[9] = a[9] - b[9];\n dest[10] = a[10] - b[10];\n dest[11] = a[11] - b[11];\n dest[12] = a[12] - b[12];\n dest[13] = a[13] - b[13];\n dest[14] = a[14] - b[14];\n dest[15] = a[15] - b[15];\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subMat4Scalar\n * @static\n */\n subMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] - s;\n dest[1] = m[1] - s;\n dest[2] = m[2] - s;\n dest[3] = m[3] - s;\n dest[4] = m[4] - s;\n dest[5] = m[5] - s;\n dest[6] = m[6] - s;\n dest[7] = m[7] - s;\n dest[8] = m[8] - s;\n dest[9] = m[9] - s;\n dest[10] = m[10] - s;\n dest[11] = m[11] - s;\n dest[12] = m[12] - s;\n dest[13] = m[13] - s;\n dest[14] = m[14] - s;\n dest[15] = m[15] - s;\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subScalarMat4\n * @static\n */\n subScalarMat4(s, m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = s - m[0];\n dest[1] = s - m[1];\n dest[2] = s - m[2];\n dest[3] = s - m[3];\n dest[4] = s - m[4];\n dest[5] = s - m[5];\n dest[6] = s - m[6];\n dest[7] = s - m[7];\n dest[8] = s - m[8];\n dest[9] = s - m[9];\n dest[10] = s - m[10];\n dest[11] = s - m[11];\n dest[12] = s - m[12];\n dest[13] = s - m[13];\n dest[14] = s - m[14];\n dest[15] = s - m[15];\n return dest;\n },\n\n /**\n * Multiplies the two given 4x4 matrix by each other.\n * @method mulMat4\n * @static\n */\n mulMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = a[0];\n\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[4];\n const b11 = b[5];\n const b12 = b[6];\n const b13 = b[7];\n const b20 = b[8];\n const b21 = b[9];\n const b22 = b[10];\n const b23 = b[11];\n const b30 = b[12];\n const b31 = b[13];\n const b32 = b[14];\n const b33 = b[15];\n\n dest[0] = b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30;\n dest[1] = b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31;\n dest[2] = b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32;\n dest[3] = b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33;\n dest[4] = b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30;\n dest[5] = b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31;\n dest[6] = b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32;\n dest[7] = b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33;\n dest[8] = b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30;\n dest[9] = b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31;\n dest[10] = b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32;\n dest[11] = b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33;\n dest[12] = b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30;\n dest[13] = b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31;\n dest[14] = b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32;\n dest[15] = b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33;\n\n return dest;\n },\n\n /**\n * Multiplies the two given 3x3 matrices by each other.\n * @method mulMat4\n * @static\n */\n mulMat3(a, b, dest) {\n if (!dest) {\n dest = new FloatArrayType(9);\n }\n\n const a11 = a[0];\n const a12 = a[3];\n const a13 = a[6];\n const a21 = a[1];\n const a22 = a[4];\n const a23 = a[7];\n const a31 = a[2];\n const a32 = a[5];\n const a33 = a[8];\n const b11 = b[0];\n const b12 = b[3];\n const b13 = b[6];\n const b21 = b[1];\n const b22 = b[4];\n const b23 = b[7];\n const b31 = b[2];\n const b32 = b[5];\n const b33 = b[8];\n\n dest[0] = a11 * b11 + a12 * b21 + a13 * b31;\n dest[3] = a11 * b12 + a12 * b22 + a13 * b32;\n dest[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\n dest[1] = a21 * b11 + a22 * b21 + a23 * b31;\n dest[4] = a21 * b12 + a22 * b22 + a23 * b32;\n dest[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\n dest[2] = a31 * b11 + a32 * b21 + a33 * b31;\n dest[5] = a31 * b12 + a32 * b22 + a33 * b32;\n dest[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\n return dest;\n },\n\n /**\n * Multiplies each element of the given 4x4 matrix by the given scalar.\n * @method mulMat4Scalar\n * @static\n */\n mulMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] * s;\n dest[1] = m[1] * s;\n dest[2] = m[2] * s;\n dest[3] = m[3] * s;\n dest[4] = m[4] * s;\n dest[5] = m[5] * s;\n dest[6] = m[6] * s;\n dest[7] = m[7] * s;\n dest[8] = m[8] * s;\n dest[9] = m[9] * s;\n dest[10] = m[10] * s;\n dest[11] = m[11] * s;\n dest[12] = m[12] * s;\n dest[13] = m[13] * s;\n dest[14] = m[14] * s;\n dest[15] = m[15] * s;\n return dest;\n },\n\n /**\n * Multiplies the given 4x4 matrix by the given four-element vector.\n * @method mulMat4v4\n * @static\n */\n mulMat4v4(m, v, dest = math.vec4()) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Transposes the given 4x4 matrix.\n * @method transposeMat4\n * @static\n */\n transposeMat4(mat, dest) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n const m4 = mat[4];\n\n const m14 = mat[14];\n const m8 = mat[8];\n const m13 = mat[13];\n const m12 = mat[12];\n const m9 = mat[9];\n if (!dest || mat === dest) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a12 = mat[6];\n const a13 = mat[7];\n const a23 = mat[11];\n mat[1] = m4;\n mat[2] = m8;\n mat[3] = m12;\n mat[4] = a01;\n mat[6] = m9;\n mat[7] = m13;\n mat[8] = a02;\n mat[9] = a12;\n mat[11] = m14;\n mat[12] = a03;\n mat[13] = a13;\n mat[14] = a23;\n return mat;\n }\n dest[0] = mat[0];\n dest[1] = m4;\n dest[2] = m8;\n dest[3] = m12;\n dest[4] = mat[1];\n dest[5] = mat[5];\n dest[6] = m9;\n dest[7] = m13;\n dest[8] = mat[2];\n dest[9] = mat[6];\n dest[10] = mat[10];\n dest[11] = m14;\n dest[12] = mat[3];\n dest[13] = mat[7];\n dest[14] = mat[11];\n dest[15] = mat[15];\n return dest;\n },\n\n /**\n * Transposes the given 3x3 matrix.\n *\n * @method transposeMat3\n * @static\n */\n transposeMat3(mat, dest) {\n if (dest === mat) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a12 = mat[5];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = a01;\n dest[5] = mat[7];\n dest[6] = a02;\n dest[7] = a12;\n } else {\n dest[0] = mat[0];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = mat[1];\n dest[4] = mat[4];\n dest[5] = mat[7];\n dest[6] = mat[2];\n dest[7] = mat[5];\n dest[8] = mat[8];\n }\n return dest;\n },\n\n /**\n * Returns the determinant of the given 4x4 matrix.\n * @method determinantMat4\n * @static\n */\n determinantMat4(mat) {\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n return a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 +\n a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 +\n a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 +\n a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 +\n a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 +\n a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33;\n },\n\n /**\n * Returns the inverse of the given 4x4 matrix.\n * @method inverseMat4\n * @static\n */\n inverseMat4(mat, dest) {\n if (!dest) {\n dest = mat;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant (inlined to avoid double-caching)\n const invDet = 1 / (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06);\n\n dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;\n dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;\n dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;\n dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;\n dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;\n dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;\n dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;\n dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;\n dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;\n dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;\n dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;\n dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;\n dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;\n dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;\n dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;\n dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;\n\n return dest;\n },\n\n /**\n * Returns the trace of the given 4x4 matrix.\n * @method traceMat4\n * @static\n */\n traceMat4(m) {\n return (m[0] + m[5] + m[10] + m[15]);\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4\n * @static\n */\n translationMat4v(v, dest) {\n const m = dest || math.identityMat4();\n m[12] = v[0];\n m[13] = v[1];\n m[14] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 translation matrix.\n * @method translationMat3\n * @static\n */\n translationMat3v(v, dest) {\n const m = dest || math.identityMat3();\n m[6] = v[0];\n m[7] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4c\n * @static\n */\n translationMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.translationMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4s\n * @static\n */\n translationMat4s(s, dest) {\n return math.translationMat4c(s, s, s, dest);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param v\n * @param m\n */\n translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param x\n * @param y\n * @param z\n * @param m\n */\n OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n },\n\n translateMat4c(x, y, z, m) {\n\n const m3 = m[3];\n m[0] += m3 * x;\n m[1] += m3 * y;\n m[2] += m3 * z;\n\n const m7 = m[7];\n m[4] += m7 * x;\n m[5] += m7 * y;\n m[6] += m7 * z;\n\n const m11 = m[11];\n m[8] += m11 * x;\n m[9] += m11 * y;\n m[10] += m11 * z;\n\n const m15 = m[15];\n m[12] += m15 * x;\n m[13] += m15 * y;\n m[14] += m15 * z;\n\n return m;\n },\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4v\n * @static\n */\n rotationMat4v(anglerad, axis, m) {\n const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []);\n const s = Math.sin(anglerad);\n const c = Math.cos(anglerad);\n const q = 1.0 - c;\n\n const x = ax[0];\n const y = ax[1];\n const z = ax[2];\n\n let xy;\n let yz;\n let zx;\n let xs;\n let ys;\n let zs;\n\n //xx = x * x; used once\n //yy = y * y; used once\n //zz = z * z; used once\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n m = m || math.mat4();\n\n m[0] = (q * x * x) + c;\n m[1] = (q * xy) + zs;\n m[2] = (q * zx) - ys;\n m[3] = 0.0;\n\n m[4] = (q * xy) - zs;\n m[5] = (q * y * y) + c;\n m[6] = (q * yz) + xs;\n m[7] = 0.0;\n\n m[8] = (q * zx) + ys;\n m[9] = (q * yz) - xs;\n m[10] = (q * z * z) + c;\n m[11] = 0.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n\n return m;\n },\n\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4c\n * @static\n */\n rotationMat4c(anglerad, x, y, z, mat) {\n return math.rotationMat4v(anglerad, [x, y, z], mat);\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4v\n * @static\n */\n scalingMat4v(v, m = math.identityMat4()) {\n m[0] = v[0];\n m[5] = v[1];\n m[10] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 scale matrix.\n * @method scalingMat3v\n * @static\n */\n scalingMat3v(v, m = math.identityMat3()) {\n m[0] = v[0];\n m[4] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4c\n * @static\n */\n scalingMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.scalingMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param x\n * @param y\n * @param z\n * @param m\n */\n scaleMat4c(x, y, z, m) {\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n return m;\n },\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param xyz\n * @param m\n */\n scaleMat4v(xyz, m) {\n\n const x = xyz[0];\n const y = xyz[1];\n const z = xyz[2];\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4s\n * @static\n */\n scalingMat4s(s) {\n return math.scalingMat4c(s, s, s);\n },\n\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n *\n * @param {Number[]} q Rotation quaternion\n * @param {Number[]} v Translation vector\n * @param {Number[]} dest Destination matrix\n * @returns {Number[]} dest\n */\n rotationTranslationMat4(q, v, dest = math.mat4()) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n dest[0] = 1 - (yy + zz);\n dest[1] = xy + wz;\n dest[2] = xz - wy;\n dest[3] = 0;\n dest[4] = xy - wz;\n dest[5] = 1 - (xx + zz);\n dest[6] = yz + wx;\n dest[7] = 0;\n dest[8] = xz + wy;\n dest[9] = yz - wx;\n dest[10] = 1 - (xx + yy);\n dest[11] = 0;\n dest[12] = v[0];\n dest[13] = v[1];\n dest[14] = v[2];\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Gets Euler angles from a 4x4 matrix.\n *\n * @param {Number[]} mat The 4x4 matrix.\n * @param {String} order Desired Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination Euler angles, created by default.\n * @returns {Number[]} The Euler angles.\n */\n mat4ToEuler(mat, order, dest = math.vec4()) {\n const clamp = math.clamp;\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = mat[0];\n\n const m12 = mat[4];\n const m13 = mat[8];\n const m21 = mat[1];\n const m22 = mat[5];\n const m23 = mat[9];\n const m31 = mat[2];\n const m32 = mat[6];\n const m33 = mat[10];\n\n if (order === 'XYZ') {\n\n dest[1] = Math.asin(clamp(m13, -1, 1));\n\n if (Math.abs(m13) < 0.99999) {\n dest[0] = Math.atan2(-m23, m33);\n dest[2] = Math.atan2(-m12, m11);\n } else {\n dest[0] = Math.atan2(m32, m22);\n dest[2] = 0;\n\n }\n\n } else if (order === 'YXZ') {\n\n dest[0] = Math.asin(-clamp(m23, -1, 1));\n\n if (Math.abs(m23) < 0.99999) {\n dest[1] = Math.atan2(m13, m33);\n dest[2] = Math.atan2(m21, m22);\n } else {\n dest[1] = Math.atan2(-m31, m11);\n dest[2] = 0;\n }\n\n } else if (order === 'ZXY') {\n\n dest[0] = Math.asin(clamp(m32, -1, 1));\n\n if (Math.abs(m32) < 0.99999) {\n dest[1] = Math.atan2(-m31, m33);\n dest[2] = Math.atan2(-m12, m22);\n } else {\n dest[1] = 0;\n dest[2] = Math.atan2(m21, m11);\n }\n\n } else if (order === 'ZYX') {\n\n dest[1] = Math.asin(-clamp(m31, -1, 1));\n\n if (Math.abs(m31) < 0.99999) {\n dest[0] = Math.atan2(m32, m33);\n dest[2] = Math.atan2(m21, m11);\n } else {\n dest[0] = 0;\n dest[2] = Math.atan2(-m12, m22);\n }\n\n } else if (order === 'YZX') {\n\n dest[2] = Math.asin(clamp(m21, -1, 1));\n\n if (Math.abs(m21) < 0.99999) {\n dest[0] = Math.atan2(-m23, m22);\n dest[1] = Math.atan2(-m31, m11);\n } else {\n dest[0] = 0;\n dest[1] = Math.atan2(m13, m33);\n }\n\n } else if (order === 'XZY') {\n\n dest[2] = Math.asin(-clamp(m12, -1, 1));\n\n if (Math.abs(m12) < 0.99999) {\n dest[0] = Math.atan2(m32, m22);\n dest[1] = Math.atan2(m13, m11);\n } else {\n dest[0] = Math.atan2(-m23, m33);\n dest[1] = 0;\n }\n }\n\n return dest;\n },\n\n composeMat4(position, quaternion, scale, mat = math.mat4()) {\n math.quaternionToRotationMat4(quaternion, mat);\n math.scaleMat4v(scale, mat);\n math.translateMat4v(position, mat);\n\n return mat;\n },\n\n decomposeMat4: (() => {\n\n const vec = new FloatArrayType(3);\n const matrix = new FloatArrayType(16);\n\n return function decompose(mat, position, quaternion, scale) {\n\n vec[0] = mat[0];\n vec[1] = mat[1];\n vec[2] = mat[2];\n\n let sx = math.lenVec3(vec);\n\n vec[0] = mat[4];\n vec[1] = mat[5];\n vec[2] = mat[6];\n\n const sy = math.lenVec3(vec);\n\n vec[8] = mat[8];\n vec[9] = mat[9];\n vec[10] = mat[10];\n\n const sz = math.lenVec3(vec);\n\n // if determine is negative, we need to invert one scale\n const det = math.determinantMat4(mat);\n\n if (det < 0) {\n sx = -sx;\n }\n\n position[0] = mat[12];\n position[1] = mat[13];\n position[2] = mat[14];\n\n // scale the rotation part\n matrix.set(mat);\n\n const invSX = 1 / sx;\n const invSY = 1 / sy;\n const invSZ = 1 / sz;\n\n matrix[0] *= invSX;\n matrix[1] *= invSX;\n matrix[2] *= invSX;\n\n matrix[4] *= invSY;\n matrix[5] *= invSY;\n matrix[6] *= invSY;\n\n matrix[8] *= invSZ;\n matrix[9] *= invSZ;\n matrix[10] *= invSZ;\n\n math.mat4ToQuaternion(matrix, quaternion);\n\n scale[0] = sx;\n scale[1] = sy;\n scale[2] = sz;\n\n return this;\n\n };\n\n })(),\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4v\n * @param pos vec3 position of the viewer\n * @param target vec3 point the viewer is looking at\n * @param up vec3 pointing \"up\"\n * @param dest mat4 Optional, mat4 matrix will be written into\n *\n * @return {mat4} dest if specified, a new mat4 otherwise\n */\n lookAtMat4v(pos, target, up, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n\n const posx = pos[0];\n const posy = pos[1];\n const posz = pos[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const targetx = target[0];\n const targety = target[1];\n const targetz = target[2];\n\n if (posx === targetx && posy === targety && posz === targetz) {\n return math.identityMat4();\n }\n\n let z0;\n let z1;\n let z2;\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let len;\n\n //vec3.direction(eye, center, z);\n z0 = posx - targetx;\n z1 = posy - targety;\n z2 = posz - targetz;\n\n // normalize (no check needed for 0 because of early return)\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n //vec3.normalize(vec3.cross(up, z, x));\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n //vec3.normalize(vec3.cross(z, x, y));\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n dest[0] = x0;\n dest[1] = y0;\n dest[2] = z0;\n dest[3] = 0;\n dest[4] = x1;\n dest[5] = y1;\n dest[6] = z1;\n dest[7] = 0;\n dest[8] = x2;\n dest[9] = y2;\n dest[10] = z2;\n dest[11] = 0;\n dest[12] = -(x0 * posx + x1 * posy + x2 * posz);\n dest[13] = -(y0 * posx + y1 * posy + y2 * posz);\n dest[14] = -(z0 * posx + z1 * posy + z2 * posz);\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4c\n * @static\n */\n lookAtMat4c(posx, posy, posz, targetx, targety, targetz, upx, upy, upz) {\n return math.lookAtMat4v([posx, posy, posz], [targetx, targety, targetz], [upx, upy, upz], []);\n },\n\n /**\n * Returns a 4x4 orthographic projection matrix.\n * @method orthoMat4c\n * @static\n */\n orthoMat4c(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n\n dest[0] = 2.0 / rl;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 0.0;\n\n dest[4] = 0.0;\n dest[5] = 2.0 / tb;\n dest[6] = 0.0;\n dest[7] = 0.0;\n\n dest[8] = 0.0;\n dest[9] = 0.0;\n dest[10] = -2.0 / fn;\n dest[11] = 0.0;\n\n dest[12] = -(left + right) / rl;\n dest[13] = -(top + bottom) / tb;\n dest[14] = -(far + near) / fn;\n dest[15] = 1.0;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4v(fmin, fmax, m) {\n if (!m) {\n m = math.mat4();\n }\n\n const fmin4 = [fmin[0], fmin[1], fmin[2], 0.0];\n const fmax4 = [fmax[0], fmax[1], fmax[2], 0.0];\n\n math.addVec4(fmax4, fmin4, tempMat1);\n math.subVec4(fmax4, fmin4, tempMat2);\n\n const t = 2.0 * fmin4[2];\n\n const tempMat20 = tempMat2[0];\n const tempMat21 = tempMat2[1];\n const tempMat22 = tempMat2[2];\n\n m[0] = t / tempMat20;\n m[1] = 0.0;\n m[2] = 0.0;\n m[3] = 0.0;\n\n m[4] = 0.0;\n m[5] = t / tempMat21;\n m[6] = 0.0;\n m[7] = 0.0;\n\n m[8] = tempMat1[0] / tempMat20;\n m[9] = tempMat1[1] / tempMat21;\n m[10] = -tempMat1[2] / tempMat22;\n m[11] = -1.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = -t * fmax4[2] / tempMat22;\n m[15] = 0.0;\n\n return m;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n dest[0] = (near * 2) / rl;\n dest[1] = 0;\n dest[2] = 0;\n dest[3] = 0;\n dest[4] = 0;\n dest[5] = (near * 2) / tb;\n dest[6] = 0;\n dest[7] = 0;\n dest[8] = (right + left) / rl;\n dest[9] = (top + bottom) / tb;\n dest[10] = -(far + near) / fn;\n dest[11] = -1;\n dest[12] = 0;\n dest[13] = 0;\n dest[14] = -(far * near * 2) / fn;\n dest[15] = 0;\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method perspectiveMat4v\n * @static\n */\n perspectiveMat4(fovyrad, aspectratio, znear, zfar, m) {\n const pmin = [];\n const pmax = [];\n\n pmin[2] = znear;\n pmax[2] = zfar;\n\n pmax[1] = pmin[2] * Math.tan(fovyrad / 2.0);\n pmin[1] = -pmax[1];\n\n pmax[0] = pmax[1] * aspectratio;\n pmin[0] = -pmax[0];\n\n return math.frustumMat4v(pmin, pmax, m);\n },\n\n /**\n * Transforms a three-element position by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint3(m, p, dest = math.vec3()) {\n\n const x = p[0];\n const y = p[1];\n const z = p[2];\n\n dest[0] = (m[0] * x) + (m[4] * y) + (m[8] * z) + m[12];\n dest[1] = (m[1] * x) + (m[5] * y) + (m[9] * z) + m[13];\n dest[2] = (m[2] * x) + (m[6] * y) + (m[10] * z) + m[14];\n\n return dest;\n },\n\n /**\n * Transforms a homogeneous coordinate by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint4(m, v, dest = math.vec4()) {\n dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];\n dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];\n dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3];\n dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3];\n\n return dest;\n },\n\n\n /**\n * Transforms an array of three-element positions by a 4x4 matrix.\n * @method transformPoints3\n * @static\n */\n transformPoints3(m, points, points2) {\n const result = points2 || [];\n const len = points.length;\n let p0;\n let p1;\n let p2;\n let pi;\n\n // cache values\n const m0 = m[0];\n\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n let r;\n\n for (let i = 0; i < len; ++i) {\n\n // cache values\n pi = points[i];\n\n p0 = pi[0];\n p1 = pi[1];\n p2 = pi[2];\n\n r = result[i] || (result[i] = [0, 0, 0]);\n\n r[0] = (m0 * p0) + (m4 * p1) + (m8 * p2) + m12;\n r[1] = (m1 * p0) + (m5 * p1) + (m9 * p2) + m13;\n r[2] = (m2 * p0) + (m6 * p1) + (m10 * p2) + m14;\n r[3] = (m3 * p0) + (m7 * p1) + (m11 * p2) + m15;\n }\n\n result.length = len;\n\n return result;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions3\n * @static\n */\n transformPositions3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 3) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions4\n * @static\n */\n transformPositions4(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms a three-element vector by a 4x4 matrix.\n * @method transformVec3\n * @static\n */\n transformVec3(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n dest = dest || this.vec3();\n dest[0] = (m[0] * v0) + (m[4] * v1) + (m[8] * v2);\n dest[1] = (m[1] * v0) + (m[5] * v1) + (m[9] * v2);\n dest[2] = (m[2] * v0) + (m[6] * v1) + (m[10] * v2);\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 matrix.\n * @method transformVec4\n * @static\n */\n transformVec4(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest = dest || math.vec4();\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the x-axis\n *\n * @method rotateVec3X\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3X(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);\n r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the y-axis\n *\n * @method rotateVec3Y\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Y(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the z-axis\n *\n * @method rotateVec3Z\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Z(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);\n r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);\n r[2] = p[2];\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 projection matrix.\n *\n * @method projectVec4\n * @param {Number[]} p 3D View-space coordinate\n * @param {Number[]} q 2D Projected coordinate\n * @returns {Number[]} 2D Projected coordinate\n * @static\n */\n projectVec4(p, q) {\n const f = 1.0 / p[3];\n q = q || math.vec2();\n q[0] = v[0] * f;\n q[1] = v[1] * f;\n return q;\n },\n\n /**\n * Unprojects a three-element vector.\n *\n * @method unprojectVec3\n * @param {Number[]} p 3D Projected coordinate\n * @param {Number[]} viewMat View matrix\n * @returns {Number[]} projMat Projection matrix\n * @static\n */\n unprojectVec3: ((() => {\n const mat = new FloatArrayType(16);\n const mat2 = new FloatArrayType(16);\n const mat3 = new FloatArrayType(16);\n return function (p, viewMat, projMat, q) {\n return this.transformVec3(this.mulMat4(this.inverseMat4(viewMat, mat), this.inverseMat4(projMat, mat2), mat3), p, q)\n };\n }))(),\n\n /**\n * Linearly interpolates between two 3D vectors.\n * @method lerpVec3\n * @static\n */\n lerpVec3(t, t1, t2, p1, p2, dest) {\n const result = dest || math.vec3();\n const f = (t - t1) / (t2 - t1);\n result[0] = p1[0] + (f * (p2[0] - p1[0]));\n result[1] = p1[1] + (f * (p2[1] - p1[1]));\n result[2] = p1[2] + (f * (p2[2] - p1[2]));\n return result;\n },\n\n\n /**\n * Flattens a two-dimensional array into a one-dimensional array.\n *\n * @method flatten\n * @static\n * @param {Array of Arrays} a A 2D array\n * @returns Flattened 1D array\n */\n flatten(a) {\n\n const result = [];\n\n let i;\n let leni;\n let j;\n let lenj;\n let item;\n\n for (i = 0, leni = a.length; i < leni; i++) {\n item = a[i];\n for (j = 0, lenj = item.length; j < lenj; j++) {\n result.push(item[j]);\n }\n }\n\n return result;\n },\n\n\n identityQuaternion(dest = math.vec4()) {\n dest[0] = 0.0;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 1.0;\n return dest;\n },\n\n /**\n * Initializes a quaternion from Euler angles.\n *\n * @param {Number[]} euler The Euler angles.\n * @param {String} order Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination quaternion, created by default.\n * @returns {Number[]} The quaternion.\n */\n eulerToQuaternion(euler, order, dest = math.vec4()) {\n // http://www.mathworks.com/matlabcentral/fileexchange/\n // \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n //\tcontent/SpinCalc.m\n\n const a = (euler[0] * math.DEGTORAD) / 2;\n const b = (euler[1] * math.DEGTORAD) / 2;\n const c = (euler[2] * math.DEGTORAD) / 2;\n\n const c1 = Math.cos(a);\n const c2 = Math.cos(b);\n const c3 = Math.cos(c);\n const s1 = Math.sin(a);\n const s2 = Math.sin(b);\n const s3 = Math.sin(c);\n\n if (order === 'XYZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'YXZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'ZXY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'ZYX') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'YZX') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'XZY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n }\n\n return dest;\n },\n\n mat4ToQuaternion(m, dest = math.vec4()) {\n // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = m[0];\n const m12 = m[4];\n const m13 = m[8];\n const m21 = m[1];\n const m22 = m[5];\n const m23 = m[9];\n const m31 = m[2];\n const m32 = m[6];\n const m33 = m[10];\n let s;\n\n const trace = m11 + m22 + m33;\n\n if (trace > 0) {\n\n s = 0.5 / Math.sqrt(trace + 1.0);\n\n dest[3] = 0.25 / s;\n dest[0] = (m32 - m23) * s;\n dest[1] = (m13 - m31) * s;\n dest[2] = (m21 - m12) * s;\n\n } else if (m11 > m22 && m11 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n dest[3] = (m32 - m23) / s;\n dest[0] = 0.25 * s;\n dest[1] = (m12 + m21) / s;\n dest[2] = (m13 + m31) / s;\n\n } else if (m22 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n dest[3] = (m13 - m31) / s;\n dest[0] = (m12 + m21) / s;\n dest[1] = 0.25 * s;\n dest[2] = (m23 + m32) / s;\n\n } else {\n\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n dest[3] = (m21 - m12) / s;\n dest[0] = (m13 + m31) / s;\n dest[1] = (m23 + m32) / s;\n dest[2] = 0.25 * s;\n }\n\n return dest;\n },\n\n vec3PairToQuaternion(u, v, dest = math.vec4()) {\n const norm_u_norm_v = Math.sqrt(math.dotVec3(u, u) * math.dotVec3(v, v));\n let real_part = norm_u_norm_v + math.dotVec3(u, v);\n\n if (real_part < 0.00000001 * norm_u_norm_v) {\n\n // If u and v are exactly opposite, rotate 180 degrees\n // around an arbitrary orthogonal axis. Axis normalisation\n // can happen later, when we normalise the quaternion.\n\n real_part = 0.0;\n\n if (Math.abs(u[0]) > Math.abs(u[2])) {\n\n dest[0] = -u[1];\n dest[1] = u[0];\n dest[2] = 0;\n\n } else {\n dest[0] = 0;\n dest[1] = -u[2];\n dest[2] = u[1]\n }\n\n } else {\n\n // Otherwise, build quaternion the standard way.\n math.cross3Vec3(u, v, dest);\n }\n\n dest[3] = real_part;\n\n return math.normalizeQuaternion(dest);\n },\n\n angleAxisToQuaternion(angleAxis, dest = math.vec4()) {\n const halfAngle = angleAxis[3] / 2.0;\n const fsin = Math.sin(halfAngle);\n dest[0] = fsin * angleAxis[0];\n dest[1] = fsin * angleAxis[1];\n dest[2] = fsin * angleAxis[2];\n dest[3] = Math.cos(halfAngle);\n return dest;\n },\n\n quaternionToEuler: ((() => {\n const mat = new FloatArrayType(16);\n return (q, order, dest) => {\n dest = dest || math.vec3();\n math.quaternionToRotationMat4(q, mat);\n math.mat4ToEuler(mat, order, dest);\n return dest;\n };\n }))(),\n\n mulQuaternions(p, q, dest = math.vec4()) {\n const p0 = p[0];\n const p1 = p[1];\n const p2 = p[2];\n const p3 = p[3];\n const q0 = q[0];\n const q1 = q[1];\n const q2 = q[2];\n const q3 = q[3];\n dest[0] = p3 * q0 + p0 * q3 + p1 * q2 - p2 * q1;\n dest[1] = p3 * q1 + p1 * q3 + p2 * q0 - p0 * q2;\n dest[2] = p3 * q2 + p2 * q3 + p0 * q1 - p1 * q0;\n dest[3] = p3 * q3 - p0 * q0 - p1 * q1 - p2 * q2;\n return dest;\n },\n\n vec3ApplyQuaternion(q, vec, dest = math.vec3()) {\n const x = vec[0];\n const y = vec[1];\n const z = vec[2];\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n // calculate quat * vector\n\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n\n dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return dest;\n },\n\n quaternionToMat4(q, dest) {\n\n dest = math.identityMat4(dest);\n\n const q0 = q[0]; //x\n const q1 = q[1]; //y\n const q2 = q[2]; //z\n const q3 = q[3]; //w\n\n const tx = 2.0 * q0;\n const ty = 2.0 * q1;\n const tz = 2.0 * q2;\n\n const twx = tx * q3;\n const twy = ty * q3;\n const twz = tz * q3;\n\n const txx = tx * q0;\n const txy = ty * q0;\n const txz = tz * q0;\n\n const tyy = ty * q1;\n const tyz = tz * q1;\n const tzz = tz * q2;\n\n dest[0] = 1.0 - (tyy + tzz);\n dest[1] = txy + twz;\n dest[2] = txz - twy;\n\n dest[4] = txy - twz;\n dest[5] = 1.0 - (txx + tzz);\n dest[6] = tyz + twx;\n\n dest[8] = txz + twy;\n dest[9] = tyz - twx;\n\n dest[10] = 1.0 - (txx + tyy);\n\n return dest;\n },\n\n quaternionToRotationMat4(q, m) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n m[0] = 1 - (yy + zz);\n m[4] = xy - wz;\n m[8] = xz + wy;\n\n m[1] = xy + wz;\n m[5] = 1 - (xx + zz);\n m[9] = yz - wx;\n\n m[2] = xz - wy;\n m[6] = yz + wx;\n m[10] = 1 - (xx + yy);\n\n // last column\n m[3] = 0;\n m[7] = 0;\n m[11] = 0;\n\n // bottom row\n m[12] = 0;\n m[13] = 0;\n m[14] = 0;\n m[15] = 1;\n\n return m;\n },\n\n normalizeQuaternion(q, dest = q) {\n const len = math.lenVec4([q[0], q[1], q[2], q[3]]);\n dest[0] = q[0] / len;\n dest[1] = q[1] / len;\n dest[2] = q[2] / len;\n dest[3] = q[3] / len;\n return dest;\n },\n\n conjugateQuaternion(q, dest = q) {\n dest[0] = -q[0];\n dest[1] = -q[1];\n dest[2] = -q[2];\n dest[3] = q[3];\n return dest;\n },\n\n inverseQuaternion(q, dest) {\n return math.normalizeQuaternion(math.conjugateQuaternion(q, dest));\n },\n\n quaternionToAngleAxis(q, angleAxis = math.vec4()) {\n q = math.normalizeQuaternion(q, tempVec4);\n const q3 = q[3];\n const angle = 2 * Math.acos(q3);\n const s = Math.sqrt(1 - q3 * q3);\n if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt\n angleAxis[0] = q[0];\n angleAxis[1] = q[1];\n angleAxis[2] = q[2];\n } else {\n angleAxis[0] = q[0] / s;\n angleAxis[1] = q[1] / s;\n angleAxis[2] = q[2] / s;\n }\n angleAxis[3] = angle; // * 57.295779579;\n return angleAxis;\n },\n\n //------------------------------------------------------------------------------------------------------------------\n // Boundaries\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Returns a new, uninitialized 3D axis-aligned bounding box.\n *\n * @private\n */\n AABB3(values) {\n return new FloatArrayType(values || 6);\n },\n\n /**\n * Returns a new, uninitialized 2D axis-aligned bounding box.\n *\n * @private\n */\n AABB2(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3D oriented bounding box (OBB).\n *\n * @private\n */\n OBB3(values) {\n return new FloatArrayType(values || 32);\n },\n\n /**\n * Returns a new, uninitialized 2D oriented bounding box (OBB).\n *\n * @private\n */\n OBB2(values) {\n return new FloatArrayType(values || 16);\n },\n\n /** Returns a new 3D bounding sphere */\n Sphere3(x, y, z, r) {\n return new FloatArrayType([x, y, z, r]);\n },\n\n /**\n * Transforms an OBB3 by a 4x4 matrix.\n *\n * @private\n */\n transformOBB3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /** Returns true if the first AABB contains the second AABB.\n * @param aabb1\n * @param aabb2\n * @returns {boolean}\n */\n containsAABB3: function (aabb1, aabb2) {\n const result = (\n aabb1[0] <= aabb2[0] && aabb2[3] <= aabb1[3] &&\n aabb1[1] <= aabb2[1] && aabb2[4] <= aabb1[4] &&\n aabb1[2] <= aabb2[2] && aabb2[5] <= aabb1[5]);\n return result;\n },\n\n /**\n * Gets the diagonal size of an AABB3 given as minima and maxima.\n *\n * @private\n */\n getAABB3Diag: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return aabb => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n math.subVec3(max, min, tempVec3);\n\n return Math.abs(math.lenVec3(tempVec3));\n };\n }))(),\n\n /**\n * Get a diagonal boundary size that is symmetrical about the given point.\n *\n * @private\n */\n getAABB3DiagPoint: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (aabb, p) => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n const diagVec = math.subVec3(max, min, tempVec3);\n\n const xneg = p[0] - aabb[0];\n const xpos = aabb[3] - p[0];\n const yneg = p[1] - aabb[1];\n const ypos = aabb[4] - p[1];\n const zneg = p[2] - aabb[2];\n const zpos = aabb[5] - p[2];\n\n diagVec[0] += (xneg > xpos) ? xneg : xpos;\n diagVec[1] += (yneg > ypos) ? yneg : ypos;\n diagVec[2] += (zneg > zpos) ? zneg : zpos;\n\n return Math.abs(math.lenVec3(diagVec));\n };\n }))(),\n\n /**\n * Gets the center of an AABB.\n *\n * @private\n */\n getAABB3Center(aabb, dest) {\n const r = dest || math.vec3();\n\n r[0] = (aabb[0] + aabb[3]) / 2;\n r[1] = (aabb[1] + aabb[4]) / 2;\n r[2] = (aabb[2] + aabb[5]) / 2;\n\n return r;\n },\n\n /**\n * Gets the center of a 2D AABB.\n *\n * @private\n */\n getAABB2Center(aabb, dest) {\n const r = dest || math.vec2();\n\n r[0] = (aabb[2] + aabb[0]) / 2;\n r[1] = (aabb[3] + aabb[1]) / 2;\n\n return r;\n },\n\n /**\n * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points.\n * Creates new AABB if none supplied.\n *\n * @private\n */\n collapseAABB3(aabb = math.AABB3()) {\n aabb[0] = math.MAX_DOUBLE;\n aabb[1] = math.MAX_DOUBLE;\n aabb[2] = math.MAX_DOUBLE;\n aabb[3] = -math.MAX_DOUBLE;\n aabb[4] = -math.MAX_DOUBLE;\n aabb[5] = -math.MAX_DOUBLE;\n\n return aabb;\n },\n\n /**\n * Converts an axis-aligned 3D boundary into an oriented boundary consisting of\n * an array of eight 3D positions, one for each corner of the boundary.\n *\n * @private\n */\n AABB3ToOBB3(aabb, obb = math.OBB3()) {\n obb[0] = aabb[0];\n obb[1] = aabb[1];\n obb[2] = aabb[2];\n obb[3] = 1;\n\n obb[4] = aabb[3];\n obb[5] = aabb[1];\n obb[6] = aabb[2];\n obb[7] = 1;\n\n obb[8] = aabb[3];\n obb[9] = aabb[4];\n obb[10] = aabb[2];\n obb[11] = 1;\n\n obb[12] = aabb[0];\n obb[13] = aabb[4];\n obb[14] = aabb[2];\n obb[15] = 1;\n\n obb[16] = aabb[0];\n obb[17] = aabb[1];\n obb[18] = aabb[5];\n obb[19] = 1;\n\n obb[20] = aabb[3];\n obb[21] = aabb[1];\n obb[22] = aabb[5];\n obb[23] = 1;\n\n obb[24] = aabb[3];\n obb[25] = aabb[4];\n obb[26] = aabb[5];\n obb[27] = 1;\n\n obb[28] = aabb[0];\n obb[29] = aabb[4];\n obb[30] = aabb[5];\n obb[31] = 1;\n\n return obb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n positions3ToAABB3: ((() => {\n\n const p = new FloatArrayType(3);\n\n return (positions, aabb, positionsDecodeMatrix) => {\n aabb = aabb || math.AABB3();\n\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n if (positionsDecodeMatrix) {\n\n p[0] = positions[i + 0];\n p[1] = positions[i + 1];\n p[2] = positions[i + 2];\n\n math.decompressPosition(p, positionsDecodeMatrix, p);\n\n x = p[0];\n y = p[1];\n z = p[2];\n\n } else {\n x = positions[i + 0];\n y = positions[i + 1];\n z = positions[i + 2];\n }\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n };\n }))(),\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n OBB3ToAABB3(obb, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = obb.length; i < len; i += 4) {\n\n x = obb[i + 0];\n y = obb[i + 1];\n z = obb[i + 2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the given 3D points.\n *\n * @private\n */\n points3ToAABB3(points, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = points.length; i < len; i++) {\n\n x = points[i][0];\n y = points[i][1];\n z = points[i][2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n points3ToSphere3: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const numPoints = points.length;\n\n for (i = 0; i < numPoints; i++) {\n x += points[i][0];\n y += points[i][1];\n z += points[i][2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < numPoints; i++) {\n\n dist = Math.abs(math.lenVec3(math.subVec3(points[i], sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D positions.\n *\n * @private\n */\n positions3ToSphere3: ((() => {\n\n const tempVec3a = new FloatArrayType(3);\n const tempVec3b = new FloatArrayType(3);\n\n return (positions, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPositions = positions.length;\n let radius = 0;\n\n for (i = 0; i < lenPositions; i += 3) {\n x += positions[i];\n y += positions[i + 1];\n z += positions[i + 2];\n }\n\n const numPositions = lenPositions / 3;\n\n sphere[0] = x / numPositions;\n sphere[1] = y / numPositions;\n sphere[2] = z / numPositions;\n\n let dist;\n\n for (i = 0; i < lenPositions; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(tempVec3a, sphere, tempVec3b)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n OBB3ToSphere3: ((() => {\n\n const point = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPoints = points.length;\n const numPoints = lenPoints / 4;\n\n for (i = 0; i < lenPoints; i += 4) {\n x += points[i + 0];\n y += points[i + 1];\n z += points[i + 2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < lenPoints; i += 4) {\n\n point[0] = points[i + 0];\n point[1] = points[i + 1];\n point[2] = points[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(point, sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Gets the center of a bounding sphere.\n *\n * @private\n */\n getSphere3Center(sphere, dest = math.vec3()) {\n dest[0] = sphere[0];\n dest[1] = sphere[1];\n dest[2] = sphere[2];\n\n return dest;\n },\n\n /**\n * Expands the first axis-aligned 3D boundary to enclose the second, if required.\n *\n * @private\n */\n expandAABB3(aabb1, aabb2) {\n\n if (aabb1[0] > aabb2[0]) {\n aabb1[0] = aabb2[0];\n }\n\n if (aabb1[1] > aabb2[1]) {\n aabb1[1] = aabb2[1];\n }\n\n if (aabb1[2] > aabb2[2]) {\n aabb1[2] = aabb2[2];\n }\n\n if (aabb1[3] < aabb2[3]) {\n aabb1[3] = aabb2[3];\n }\n\n if (aabb1[4] < aabb2[4]) {\n aabb1[4] = aabb2[4];\n }\n\n if (aabb1[5] < aabb2[5]) {\n aabb1[5] = aabb2[5];\n }\n\n return aabb1;\n },\n\n /**\n * Expands an axis-aligned 3D boundary to enclose the given point, if needed.\n *\n * @private\n */\n expandAABB3Point3(aabb, p) {\n\n if (aabb[0] > p[0]) {\n aabb[0] = p[0];\n }\n\n if (aabb[1] > p[1]) {\n aabb[1] = p[1];\n }\n\n if (aabb[2] > p[2]) {\n aabb[2] = p[2];\n }\n\n if (aabb[3] < p[0]) {\n aabb[3] = p[0];\n }\n\n if (aabb[4] < p[1]) {\n aabb[4] = p[1];\n }\n\n if (aabb[5] < p[2]) {\n aabb[5] = p[2];\n }\n\n return aabb;\n },\n\n /**\n * Calculates the normal vector of a triangle.\n *\n * @private\n */\n triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n }\n};\n\nexport {math};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/math.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/math.js", "access": "public", "description": null, "lineNumber": 1 @@ -7046,7 +7046,7 @@ "name": "src/XKTModel/lib/mergeVertices.js", "content": "/**\n * Given geometry defined as an array of positions, optional normals, option uv and an array of indices, returns\n * modified arrays that have duplicate vertices removed.\n *\n * @private\n */\nfunction mergeVertices(positions, indices, mergedPositions, mergedIndices) {\n const positionsMap = {};\n const indicesLookup = [];\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let uvi = 0;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n const vx = positions[i];\n const vy = positions[i + 1];\n const vz = positions[i + 2];\n const key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n if (positionsMap[key] === undefined) {\n positionsMap[key] = mergedPositions.length / 3;\n mergedPositions.push(vx);\n mergedPositions.push(vy);\n mergedPositions.push(vz);\n }\n indicesLookup[i / 3] = positionsMap[key];\n uvi += 2;\n }\n for (let i = 0, len = indices.length; i < len; i++) {\n mergedIndices[i] = indicesLookup[indices[i]];\n }\n}\n\nexport {mergeVertices};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/mergeVertices.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/mergeVertices.js", "access": "public", "description": null, "lineNumber": 1 @@ -7101,7 +7101,7 @@ "name": "src/XKTModel/lib/toArraybuffer.js", "content": "/**\n * @private\n * @param buf\n * @returns {ArrayBuffer}\n */\nexport function toArrayBuffer(buf) {\n const ab = new ArrayBuffer(buf.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buf.length; ++i) {\n view[i] = buf[i];\n }\n return ab;\n}", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/toArraybuffer.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/toArraybuffer.js", "access": "public", "description": null, "lineNumber": 1 @@ -7155,7 +7155,7 @@ "name": "src/XKTModel/lib/utils.js", "content": "function isString(value) {\n return (typeof value === 'string' || value instanceof String);\n}\n\nfunction apply(o, o2) {\n for (const name in o) {\n if (o.hasOwnProperty(name)) {\n o2[name] = o[name];\n }\n }\n return o2;\n}\n\n/**\n * @private\n */\nconst utils = {\n isString,\n apply\n};\n\nexport {utils};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/lib/utils.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/lib/utils.js", "access": "public", "description": null, "lineNumber": 1 @@ -7254,7 +7254,7 @@ "name": "src/XKTModel/writeXKTModelToArrayBuffer.js", "content": "import {XKT_INFO} from \"../XKT_INFO.js\";\nimport * as pako from 'pako';\n\nconst XKT_VERSION = XKT_INFO.xktVersion;\nconst NUM_TEXTURE_ATTRIBUTES = 9;\nconst NUM_MATERIAL_ATTRIBUTES = 6;\n\n/**\n * Writes an {@link XKTModel} to an {@link ArrayBuffer}.\n *\n * @param {XKTModel} xktModel The {@link XKTModel}.\n * @param {String} metaModelJSON The metamodel JSON in a string.\n * @param {Object} [stats] Collects statistics.\n * @param {Object} options Options for how the XKT is written.\n * @param {Boolean} [options.zip=true] ZIP the contents?\n * @returns {ArrayBuffer} The {@link ArrayBuffer}.\n */\nfunction writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, options) {\n const data = getModelData(xktModel, metaModelJSON, stats);\n const deflatedData = deflateData(data, metaModelJSON, options);\n stats.texturesSize += deflatedData.textureData.byteLength;\n const arrayBuffer = createArrayBuffer(deflatedData);\n return arrayBuffer;\n}\n\nfunction getModelData(xktModel, metaModelDataStr, stats) {\n\n //------------------------------------------------------------------------------------------------------------------\n // Allocate data\n //------------------------------------------------------------------------------------------------------------------\n\n const propertySetsList = xktModel.propertySetsList;\n const metaObjectsList = xktModel.metaObjectsList;\n const geometriesList = xktModel.geometriesList;\n const texturesList = xktModel.texturesList;\n const textureSetsList = xktModel.textureSetsList;\n const meshesList = xktModel.meshesList;\n const entitiesList = xktModel.entitiesList;\n const tilesList = xktModel.tilesList;\n\n const numPropertySets = propertySetsList.length;\n const numMetaObjects = metaObjectsList.length;\n const numGeometries = geometriesList.length;\n const numTextures = texturesList.length;\n const numTextureSets = textureSetsList.length;\n const numMeshes = meshesList.length;\n const numEntities = entitiesList.length;\n const numTiles = tilesList.length;\n\n let lenPositions = 0;\n let lenNormals = 0;\n let lenColors = 0;\n let lenUVs = 0;\n let lenIndices = 0;\n let lenEdgeIndices = 0;\n let lenMatrices = 0;\n let lenTextures = 0;\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n if (geometry.positionsQuantized) {\n lenPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n lenNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n lenColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n lenUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n lenIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n lenEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n for (let textureIndex = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n lenTextures += imageData.byteLength;\n\n if (xktTexture.compressed) {\n stats.numCompressedTextures++;\n }\n }\n\n for (let meshIndex = 0; meshIndex < numMeshes; meshIndex++) {\n const mesh = meshesList[meshIndex];\n if (mesh.geometry.numInstances > 1) {\n lenMatrices += 16;\n }\n }\n\n const data = {\n metadata: {},\n textureData: new Uint8Array(lenTextures), // All textures\n eachTextureDataPortion: new Uint32Array(numTextures), // For each texture, an index to its first element in textureData\n eachTextureAttributes: new Uint16Array(numTextures * NUM_TEXTURE_ATTRIBUTES),\n positions: new Uint16Array(lenPositions), // All geometry arrays\n normals: new Int8Array(lenNormals),\n colors: new Uint8Array(lenColors),\n uvs: new Float32Array(lenUVs),\n indices: new Uint32Array(lenIndices),\n edgeIndices: new Uint32Array(lenEdgeIndices),\n eachTextureSetTextures: new Int32Array(numTextureSets * 5), // For each texture set, a set of five Texture indices [color, metal/roughness,normals,emissive,occlusion]; each index has value -1 if no texture\n matrices: new Float32Array(lenMatrices), // Modeling matrices for entities that share geometries. Each entity either shares all it's geometries, or owns all its geometries exclusively. Exclusively-owned geometries are pre-transformed into World-space, and so their entities don't have modeling matrices in this array.\n reusedGeometriesDecodeMatrix: new Float32Array(xktModel.reusedGeometriesDecodeMatrix), // A single, global vertex position de-quantization matrix for all reused geometries. Reused geometries are quantized to their collective Local-space AABB, and this matrix is derived from that AABB.\n eachGeometryPrimitiveType: new Uint8Array(numGeometries), // Primitive type for each geometry (0=solid triangles, 1=surface triangles, 2=lines, 3=points, 4=line-strip)\n eachGeometryPositionsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.positions. Every primitive type has positions.\n eachGeometryNormalsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.normals. If the next geometry has the same index, then this geometry has no normals.\n eachGeometryColorsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.colors. If the next geometry has the same index, then this geometry has no colors.\n eachGeometryUVsPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.uvs. If the next geometry has the same index, then this geometry has no UVs.\n eachGeometryIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.indices. If the next geometry has the same index, then this geometry has no indices.\n eachGeometryEdgeIndicesPortion: new Uint32Array(numGeometries), // For each geometry, an index to its first element in data.edgeIndices. If the next geometry has the same index, then this geometry has no edge indices.\n eachMeshGeometriesPortion: new Uint32Array(numMeshes), // For each mesh, an index into the eachGeometry* arrays\n eachMeshMatricesPortion: new Uint32Array(numMeshes), // For each mesh that shares its geometry, an index to its first element in data.matrices, to indicate the modeling matrix that transforms the shared geometry Local-space vertex positions. This is ignored for meshes that don't share geometries, because the vertex positions of non-shared geometries are pre-transformed into World-space.\n eachMeshTextureSet: new Int32Array(numMeshes), // For each mesh, the index of its texture set in data.eachTextureSetTextures; this array contains signed integers so that we can use -1 to indicate when a mesh has no texture set\n eachMeshMaterialAttributes: new Uint8Array(numMeshes * NUM_MATERIAL_ATTRIBUTES), // For each mesh, an RGBA integer color of format [0..255, 0..255, 0..255, 0..255], and PBR metallic and roughness factors, of format [0..255, 0..255]\n eachEntityId: [], // For each entity, an ID string\n eachEntityMeshesPortion: new Uint32Array(numEntities), // For each entity, the index of the first element of meshes used by the entity\n eachTileAABB: new Float64Array(numTiles * 6), // For each tile, an axis-aligned bounding box\n eachTileEntitiesPortion: new Uint32Array(numTiles) // For each tile, the index of the first element of eachEntityId, eachEntityMeshesPortion and eachEntityMatricesPortion used by the tile\n };\n\n let countPositions = 0;\n let countNormals = 0;\n let countColors = 0;\n let countUVs = 0;\n let countIndices = 0;\n let countEdgeIndices = 0;\n\n // Metadata\n\n data.metadata = {\n id: xktModel.modelId,\n projectId: xktModel.projectId,\n revisionId: xktModel.revisionId,\n author: xktModel.author,\n createdAt: xktModel.createdAt,\n creatingApplication: xktModel.creatingApplication,\n schema: xktModel.schema,\n propertySets: [],\n metaObjects: []\n };\n\n // Property sets\n\n for (let propertySetsIndex = 0; propertySetsIndex < numPropertySets; propertySetsIndex++) {\n const propertySet = propertySetsList[propertySetsIndex];\n const propertySetJSON = {\n id: \"\" + propertySet.propertySetId,\n name: propertySet.propertySetName,\n type: propertySet.propertySetType,\n properties: propertySet.properties\n };\n data.metadata.propertySets.push(propertySetJSON);\n }\n\n // Metaobjects\n\n if (!metaModelDataStr) {\n for (let metaObjectsIndex = 0; metaObjectsIndex < numMetaObjects; metaObjectsIndex++) {\n const metaObject = metaObjectsList[metaObjectsIndex];\n const metaObjectJSON = {\n name: metaObject.metaObjectName,\n type: metaObject.metaObjectType,\n id: \"\" + metaObject.metaObjectId\n };\n if (metaObject.parentMetaObjectId !== undefined && metaObject.parentMetaObjectId !== null) {\n metaObjectJSON.parent = \"\" + metaObject.parentMetaObjectId;\n }\n if (metaObject.propertySetIds && metaObject.propertySetIds.length > 0) {\n metaObjectJSON.propertySetIds = metaObject.propertySetIds;\n }\n if (metaObject.external) {\n metaObjectJSON.external = metaObject.external;\n }\n data.metadata.metaObjects.push(metaObjectJSON);\n }\n }\n\n // Geometries\n\n for (let geometryIndex = 0; geometryIndex < numGeometries; geometryIndex++) {\n const geometry = geometriesList [geometryIndex];\n let primitiveType = 1;\n switch (geometry.primitiveType) {\n case \"triangles\":\n primitiveType = geometry.solid ? 0 : 1;\n break;\n case \"points\":\n primitiveType = 2;\n break;\n case \"lines\":\n primitiveType = 3;\n break;\n case \"line-strip\":\n primitiveType = 4;\n break;\n case \"triangle-strip\":\n primitiveType = 5;\n break;\n case \"triangle-fan\":\n primitiveType = 6;\n break;\n default:\n primitiveType = 1\n }\n data.eachGeometryPrimitiveType [geometryIndex] = primitiveType;\n data.eachGeometryPositionsPortion [geometryIndex] = countPositions;\n data.eachGeometryNormalsPortion [geometryIndex] = countNormals;\n data.eachGeometryColorsPortion [geometryIndex] = countColors;\n data.eachGeometryUVsPortion [geometryIndex] = countUVs;\n data.eachGeometryIndicesPortion [geometryIndex] = countIndices;\n data.eachGeometryEdgeIndicesPortion [geometryIndex] = countEdgeIndices;\n if (geometry.positionsQuantized) {\n data.positions.set(geometry.positionsQuantized, countPositions);\n countPositions += geometry.positionsQuantized.length;\n }\n if (geometry.normalsOctEncoded) {\n data.normals.set(geometry.normalsOctEncoded, countNormals);\n countNormals += geometry.normalsOctEncoded.length;\n }\n if (geometry.colorsCompressed) {\n data.colors.set(geometry.colorsCompressed, countColors);\n countColors += geometry.colorsCompressed.length;\n }\n if (geometry.uvs) {\n data.uvs.set(geometry.uvs, countUVs);\n countUVs += geometry.uvs.length;\n }\n if (geometry.indices) {\n data.indices.set(geometry.indices, countIndices);\n countIndices += geometry.indices.length;\n }\n if (geometry.edgeIndices) {\n data.edgeIndices.set(geometry.edgeIndices, countEdgeIndices);\n countEdgeIndices += geometry.edgeIndices.length;\n }\n }\n\n // Textures\n\n for (let textureIndex = 0, numTextures = xktModel.texturesList.length, portionIdx = 0; textureIndex < numTextures; textureIndex++) {\n const xktTexture = xktModel.texturesList[textureIndex];\n const imageData = xktTexture.imageData;\n data.textureData.set(imageData, portionIdx);\n data.eachTextureDataPortion[textureIndex] = portionIdx;\n\n portionIdx += imageData.byteLength;\n\n let textureAttrIdx = textureIndex * NUM_TEXTURE_ATTRIBUTES;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.compressed ? 1 : 0;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.mediaType; // GIFMediaType | PNGMediaType | JPEGMediaType\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.width;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.height;\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.minFilter; // LinearMipmapLinearFilter | LinearMipMapNearestFilter | NearestMipMapNearestFilter | NearestMipMapLinearFilter | LinearMipMapLinearFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.magFilter; // LinearFilter | NearestFilter\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapS; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapT; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n data.eachTextureAttributes[textureAttrIdx++] = xktTexture.wrapR; // ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping\n }\n\n // Texture sets\n\n for (let textureSetIndex = 0, numTextureSets = xktModel.textureSetsList.length, eachTextureSetTexturesIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {\n const textureSet = textureSetsList[textureSetIndex];\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.colorTexture ? textureSet.colorTexture.textureIndex : -1; // Color map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.metallicRoughnessTexture ? textureSet.metallicRoughnessTexture.textureIndex : -1; // Metal/rough map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.normalsTexture ? textureSet.normalsTexture.textureIndex : -1; // Normal map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.emissiveTexture ? textureSet.emissiveTexture.textureIndex : -1; // Emissive map\n data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.occlusionTexture ? textureSet.occlusionTexture.textureIndex : -1; // Occlusion map\n }\n\n // Tiles -> Entities -> Meshes\n\n let entityIndex = 0;\n let countEntityMeshesPortion = 0;\n let eachMeshMaterialAttributesIndex = 0;\n let matricesIndex = 0;\n let meshIndex = 0;\n\n for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) {\n\n const tile = tilesList [tileIndex];\n const tileEntities = tile.entities;\n const numTileEntities = tileEntities.length;\n\n if (numTileEntities === 0) {\n continue;\n }\n\n data.eachTileEntitiesPortion[tileIndex] = entityIndex;\n\n const tileAABB = tile.aabb;\n\n for (let j = 0; j < numTileEntities; j++) {\n\n const entity = tileEntities[j];\n const entityMeshes = entity.meshes;\n const numEntityMeshes = entityMeshes.length;\n\n for (let k = 0; k < numEntityMeshes; k++) {\n\n const mesh = entityMeshes[k];\n const geometry = mesh.geometry;\n const geometryIndex = geometry.geometryIndex;\n\n data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex;\n\n if (mesh.geometry.numInstances > 1) {\n data.matrices.set(mesh.matrix, matricesIndex);\n data.eachMeshMatricesPortion [meshIndex] = matricesIndex;\n matricesIndex += 16;\n }\n\n data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;\n\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic\n data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness\n\n meshIndex++;\n }\n\n data.eachEntityId [entityIndex] = entity.entityId;\n data.eachEntityMeshesPortion[entityIndex] = countEntityMeshesPortion; // <<<<<<<<<<<<<<<<<<<< Error here? Order/value of countEntityMeshesPortion correct?\n\n entityIndex++;\n countEntityMeshesPortion += numEntityMeshes;\n }\n\n const tileAABBIndex = tileIndex * 6;\n\n data.eachTileAABB.set(tileAABB, tileAABBIndex);\n }\n\n return data;\n}\n\nfunction deflateData(data, metaModelJSON, options) {\n\n function deflate(buffer) {\n return (options.zip !== false) ? pako.deflate(buffer) : buffer;\n }\n\n let metaModelBytes;\n if (metaModelJSON) {\n const deflatedJSON = deflateJSON(metaModelJSON);\n metaModelBytes = deflate(deflatedJSON)\n } else {\n const deflatedJSON = deflateJSON(data.metadata);\n metaModelBytes = deflate(deflatedJSON)\n }\n\n return {\n metadata: metaModelBytes,\n textureData: deflate(data.textureData.buffer),\n eachTextureDataPortion: deflate(data.eachTextureDataPortion.buffer),\n eachTextureAttributes: deflate(data.eachTextureAttributes.buffer),\n positions: deflate(data.positions.buffer),\n normals: deflate(data.normals.buffer),\n colors: deflate(data.colors.buffer),\n uvs: deflate(data.uvs.buffer),\n indices: deflate(data.indices.buffer),\n edgeIndices: deflate(data.edgeIndices.buffer),\n eachTextureSetTextures: deflate(data.eachTextureSetTextures.buffer),\n matrices: deflate(data.matrices.buffer),\n reusedGeometriesDecodeMatrix: deflate(data.reusedGeometriesDecodeMatrix.buffer),\n eachGeometryPrimitiveType: deflate(data.eachGeometryPrimitiveType.buffer),\n eachGeometryPositionsPortion: deflate(data.eachGeometryPositionsPortion.buffer),\n eachGeometryNormalsPortion: deflate(data.eachGeometryNormalsPortion.buffer),\n eachGeometryColorsPortion: deflate(data.eachGeometryColorsPortion.buffer),\n eachGeometryUVsPortion: deflate(data.eachGeometryUVsPortion.buffer),\n eachGeometryIndicesPortion: deflate(data.eachGeometryIndicesPortion.buffer),\n eachGeometryEdgeIndicesPortion: deflate(data.eachGeometryEdgeIndicesPortion.buffer),\n eachMeshGeometriesPortion: deflate(data.eachMeshGeometriesPortion.buffer),\n eachMeshMatricesPortion: deflate(data.eachMeshMatricesPortion.buffer),\n eachMeshTextureSet: deflate(data.eachMeshTextureSet.buffer),\n eachMeshMaterialAttributes: deflate(data.eachMeshMaterialAttributes.buffer),\n eachEntityId: deflate(JSON.stringify(data.eachEntityId)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n })),\n eachEntityMeshesPortion: deflate(data.eachEntityMeshesPortion.buffer),\n eachTileAABB: deflate(data.eachTileAABB.buffer),\n eachTileEntitiesPortion: deflate(data.eachTileEntitiesPortion.buffer)\n };\n}\n\nfunction deflateJSON(strings) {\n return JSON.stringify(strings)\n .replace(/[\\u007F-\\uFFFF]/g, function (chr) { // Produce only ASCII-chars, so that the data can be inflated later\n return \"\\\\u\" + (\"0000\" + chr.charCodeAt(0).toString(16)).substr(-4)\n });\n}\n\nfunction createArrayBuffer(deflatedData) {\n return toArrayBuffer([\n deflatedData.metadata,\n deflatedData.textureData,\n deflatedData.eachTextureDataPortion,\n deflatedData.eachTextureAttributes,\n deflatedData.positions,\n deflatedData.normals,\n deflatedData.colors,\n deflatedData.uvs,\n deflatedData.indices,\n deflatedData.edgeIndices,\n deflatedData.eachTextureSetTextures,\n deflatedData.matrices,\n deflatedData.reusedGeometriesDecodeMatrix,\n deflatedData.eachGeometryPrimitiveType,\n deflatedData.eachGeometryPositionsPortion,\n deflatedData.eachGeometryNormalsPortion,\n deflatedData.eachGeometryColorsPortion,\n deflatedData.eachGeometryUVsPortion,\n deflatedData.eachGeometryIndicesPortion,\n deflatedData.eachGeometryEdgeIndicesPortion,\n deflatedData.eachMeshGeometriesPortion,\n deflatedData.eachMeshMatricesPortion,\n deflatedData.eachMeshTextureSet,\n deflatedData.eachMeshMaterialAttributes,\n deflatedData.eachEntityId,\n deflatedData.eachEntityMeshesPortion,\n deflatedData.eachTileAABB,\n deflatedData.eachTileEntitiesPortion\n ]);\n}\n\nfunction toArrayBuffer(elements) {\n const indexData = new Uint32Array(elements.length + 2);\n indexData[0] = XKT_VERSION;\n indexData [1] = elements.length; // Stored Data 1.1: number of stored elements\n let dataLen = 0; // Stored Data 1.2: length of stored elements\n for (let i = 0, len = elements.length; i < len; i++) {\n const element = elements[i];\n const elementsize = element.length;\n indexData[i + 2] = elementsize;\n dataLen += elementsize;\n }\n const indexBuf = new Uint8Array(indexData.buffer);\n const dataArray = new Uint8Array(indexBuf.length + dataLen);\n dataArray.set(indexBuf);\n let offset = indexBuf.length;\n for (let i = 0, len = elements.length; i < len; i++) { // Stored Data 2: the elements themselves\n const element = elements[i];\n dataArray.set(element, offset);\n offset += element.length;\n }\n return dataArray.buffer;\n}\n\nexport {writeXKTModelToArrayBuffer};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKTModel/writeXKTModelToArrayBuffer.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKTModel/writeXKTModelToArrayBuffer.js", "access": "public", "description": null, "lineNumber": 1 @@ -7591,7 +7591,7 @@ "name": "src/XKT_INFO.js", "content": "/**\n * @desc Provides info on the XKT generated by xeokit-convert.\n */\nconst XKT_INFO = {\n\n /**\n * The XKT version generated by xeokit-convert.\n *\n * This is the XKT version that's modeled by {@link XKTModel}, serialized\n * by {@link writeXKTModelToArrayBuffer}, and written by {@link convert2xkt}.\n *\n * * Current XKT version: **10**\n * * [XKT format specs](https://github.com/xeokit/xeokit-convert/blob/main/specs/index.md)\n *\n * @property xktVersion\n * @type {number}\n */\n xktVersion: 10\n};\n\nexport {XKT_INFO};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/XKT_INFO.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/XKT_INFO.js", "access": "public", "description": null, "lineNumber": 1 @@ -7621,7 +7621,7 @@ "name": "src/constants.js", "content": "/*----------------------------------------------------------------------------------------------------------------------\n * NOTE: The values of these constants must match those within xeokit-sdk\n *--------------------------------------------------------------------------------------------------------------------*/\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity.\n */\nexport const RepeatWrapping = 1000;\n\n/**\n * Texture wrapping mode in which the last pixel of the texture stretches to the edge of the mesh.\n */\nexport const ClampToEdgeWrapping = 1001;\n\n/**\n * Texture wrapping mode in which the texture repeats to infinity, mirroring on each repeat.\n */\nexport const MirroredRepeatWrapping = 1002;\n\n/**\n * Texture magnification and minification filter that returns the nearest texel to the given sample coordinates.\n */\nexport const NearestFilter = 1003;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipMapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured\n * and returns the nearest texel to the given sample coordinates.\n */\nexport const NearestMipmapNearestFilter = 1004;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipmapLinearFilter = 1005;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured\n * and returns the nearest texel to the center of the pixel at the given sample coordinates.\n */\nexport const NearestMipMapLinearFilter = 1005;\n\n/**\n * Texture magnification and minification filter that returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearFilter = 1006;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipmapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses the mipmap that most closely matches the size of the pixel being textured and\n * returns the weighted average of the four nearest texels to the given sample coordinates.\n */\nexport const LinearMipMapNearestFilter = 1007;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipmapLinearFilter = 1008;\n\n/**\n * Texture minification filter that chooses two mipmaps that most closely match the size of the pixel being textured,\n * finds within each mipmap the weighted average of the nearest texel to the center of the pixel, then returns the\n * weighted average of those two values.\n */\nexport const LinearMipMapLinearFilter = 1008;\n\n/**\n * Media type for GIF images.\n */\nexport const GIFMediaType = 10000;\n\n/**\n * Media type for JPEG images.\n */\nexport const JPEGMediaType = 10001;\n\n/**\n * Media type for PNG images.\n */\nexport const PNGMediaType = 10002;", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/constants.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/constants.js", "access": "public", "description": null, "lineNumber": 1 @@ -7934,9 +7934,9 @@ "__docId__": 328, "kind": "file", "name": "src/convert2xkt.js", - "content": "import {XKT_INFO} from \"./XKT_INFO.js\";\nimport {XKTModel} from \"./XKTModel/XKTModel.js\";\nimport {parseCityJSONIntoXKTModel} from \"./parsers/parseCityJSONIntoXKTModel.js\";\nimport {parseGLTFIntoXKTModel} from \"./parsers/parseGLTFIntoXKTModel.js\";\nimport {parseIFCIntoXKTModel} from \"./parsers/parseIFCIntoXKTModel.js\";\nimport {parseLASIntoXKTModel} from \"./parsers/parseLASIntoXKTModel.js\";\nimport {parsePCDIntoXKTModel} from \"./parsers/parsePCDIntoXKTModel.js\";\nimport {parsePLYIntoXKTModel} from \"./parsers/parsePLYIntoXKTModel.js\";\nimport {parseSTLIntoXKTModel} from \"./parsers/parseSTLIntoXKTModel.js\";\nimport {writeXKTModelToArrayBuffer} from \"./XKTModel/writeXKTModelToArrayBuffer.js\";\n\nimport {toArrayBuffer} from \"./XKTModel/lib/toArraybuffer\";\n\nconst fs = require('fs');\nconst path = require(\"path\");\n\n/**\n * Converts model files into xeokit's native XKT format.\n *\n * Supported source formats are: IFC, CityJSON, glTF, LAZ and LAS.\n *\n * **Only bundled in xeokit-convert.cjs.js.**\n *\n * ## Usage\n *\n * ````javascript\n * const convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\n * const fs = require('fs');\n *\n * convert2xkt({\n * sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n * outputXKT: (xtkArrayBuffer) => {\n * fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n * }\n * }).then(() => {\n * console.log(\"Converted.\");\n * }, (errMsg) => {\n * console.error(\"Conversion failed: \" + errMsg)\n * });\n ````\n * @param {Object} params Conversion parameters.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {*} [params.configs] Configurations.\n * @param {String} [params.source] Path to source file. Alternative to ````sourceData````.\n * @param {ArrayBuffer|JSON} [params.sourceData] Source file data. Alternative to ````source````.\n * @param {String} [params.sourceFormat] Format of source file/data. Always needed with ````sourceData````, but not normally needed with ````source````, because convert2xkt will determine the format automatically from the file extension of ````source````.\n * @param {String} [params.metaModelDataStr] Source file data. Overrides metadata from ````metaModelSource````, ````sourceData```` and ````source````.\n * @param {String} [params.metaModelSource] Path to source metaModel file. Overrides metadata from ````sourceData```` and ````source````. Overridden by ````metaModelData````.\n * @param {String} [params.output] Path to destination XKT file. Directories on this path are automatically created if not existing.\n * @param {Function} [params.outputXKTModel] Callback to collect the ````XKTModel```` that is internally build by this method.\n * @param {Function} [params.outputXKT] Callback to collect XKT file data.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {Object} [stats] Collects conversion statistics. Statistics are attached to this object if provided.\n * @param {Function} [params.outputStats] Callback to collect statistics.\n * @param {Boolean} [params.rotateX=false] Whether to rotate the model 90 degrees about the X axis to make the Y axis \"up\", if necessary. Applies to CityJSON and LAS/LAZ models.\n * @param {Boolean} [params.reuseGeometries=true] When true, will enable geometry reuse within the XKT. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be when a model (eg. glTF) has 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {Boolean} [params.includeTextures=true] Whether to convert textures. Only works for ````glTF```` models.\n * @param {Boolean} [params.includeNormals=true] Whether to convert normals. When false, the parser will ignore\n * geometry normals, and the modelwill rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the model.\n * @param {Number} [params.minTileSize=200] Minimum RTC coordinate tile size. Set this to a value between 100 and 10000,\n * depending on how far from the coordinate origin the model's vertex positions are; specify larger tile sizes when close\n * to the origin, and smaller sizes when distant. This compensates for decreasing precision as floats get bigger.\n * @param {Function} [params.log] Logging callback.\n * @return {Promise}\n */\nfunction convert2xkt({\n WebIFC,\n configs,\n source,\n sourceData,\n sourceFormat,\n metaModelSource,\n metaModelDataStr,\n modelAABB,\n output,\n outputXKTModel,\n outputXKT,\n includeTypes,\n excludeTypes,\n reuseGeometries = true,\n minTileSize = 200,\n stats = {},\n outputStats,\n rotateX = false,\n includeTextures = true,\n includeNormals = true,\n log = function (msg) {\n }\n }) {\n\n stats.sourceFormat = \"\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numTextureSets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.sourceSize = 0;\n stats.xktSize = 0;\n stats.texturesSize = 0;\n stats.xktVersion = \"\";\n stats.compressionRatio = 0;\n stats.conversionTime = 0;\n stats.aabb = null;\n\n return new Promise(function (resolve, reject) {\n const _log = log;\n log = (msg) => {\n _log(`[convert2xkt] ${msg}`)\n }\n\n if (!source && !sourceData) {\n reject(\"Argument expected: source or sourceData\");\n return;\n }\n\n if (!sourceFormat && sourceData) {\n reject(\"Argument expected: sourceFormat is required with sourceData\");\n return;\n }\n\n if (!output && !outputXKTModel && !outputXKT) {\n reject(\"Argument expected: output, outputXKTModel or outputXKT\");\n return;\n }\n\n if (source) {\n log('Reading input file: ' + source);\n }\n\n const startTime = new Date();\n\n const sourceConfigs = configs.sourceConfigs || {};\n const ext = sourceFormat || path.extname(source);\n let fileTypeConfigs = sourceConfigs[ext];\n\n if (!fileTypeConfigs) {\n log(`[WARNING] Could not find configs sourceConfigs entry for source format \"${ext}\". This is derived from the source file name extension. Will use internal default configs.`);\n fileTypeConfigs = {};\n }\n function overrideOption(option1, option2) {\n if (option1 !== undefined) {\n return option1;\n }\n return option2;\n }\n\n if (!sourceData) {\n try {\n sourceData = fs.readFileSync(source);\n } catch (err) {\n reject(err);\n return;\n }\n }\n\n const sourceFileSizeBytes = sourceData.byteLength;\n\n log(\"Input file size: \" + (sourceFileSizeBytes / 1000).toFixed(2) + \" kB\");\n\n if (!metaModelDataStr && metaModelSource) {\n log('Reading input metadata file: ' + metaModelSource);\n try {\n metaModelDataStr = fs.readFileSync(metaModelSource);\n } catch (err) {\n reject(err);\n return;\n }\n } else {\n log(`Not embedding metadata in XKT`);\n }\n\n let metaModelJSON;\n\n if (metaModelDataStr) {\n try {\n metaModelJSON = JSON.parse(metaModelDataStr);\n } catch (e) {\n metaModelJSON = {};\n log(`Error parsing metadata JSON: ${e}`);\n }\n }\n\n minTileSize = overrideOption(fileTypeConfigs.minTileSize, minTileSize);\n rotateX = overrideOption(fileTypeConfigs.rotateX, rotateX);\n reuseGeometries = overrideOption(fileTypeConfigs.reuseGeometries, reuseGeometries);\n includeTextures = overrideOption(fileTypeConfigs.includeTextures, includeTextures);\n includeNormals = overrideOption(fileTypeConfigs.includeNormals, includeNormals);\n includeTypes = overrideOption(fileTypeConfigs.includeTypes, includeTypes);\n excludeTypes = overrideOption(fileTypeConfigs.excludeTypes, excludeTypes);\n\n if (reuseGeometries === false) {\n log(\"Geometry reuse is disabled\");\n }\n\n const xktModel = new XKTModel({\n minTileSize,\n modelAABB\n });\n\n switch (ext) {\n case \"json\":\n convert(parseCityJSONIntoXKTModel, {\n data: JSON.parse(sourceData),\n xktModel,\n stats,\n rotateX,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n log\n });\n break;\n\n case \"glb\":\n sourceData = toArrayBuffer(sourceData);\n convert(parseGLTFIntoXKTModel, {\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"gltf\":\n sourceData = toArrayBuffer(sourceData);\n const gltfBasePath = source ? path.dirname(source) : \"\";\n convert(parseGLTFIntoXKTModel, {\n baseUri: gltfBasePath,\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n // case \"gltf\":\n // const gltfJSON = JSON.parse(sourceData);\n // const gltfBasePath = source ? getBasePath(source) : \"\";\n // convert(parseGLTFIntoXKTModel, {\n // baseUri: gltfBasePath,\n // data: gltfJSON,\n // reuseGeometries,\n // includeTextures,\n // includeNormals,\n // metaModelData: metaModelJSON,\n // xktModel,\n // getAttachment: async (name) => {\n // const filePath = gltfBasePath + name;\n // log(`Reading attachment file: ${filePath}`);\n // const buffer = fs.readFileSync(filePath);\n // const arrayBuf = toArrayBuffer(buffer);\n // return arrayBuf;\n // },\n // stats,\n // log\n // });\n // break;\n\n case \"ifc\":\n convert(parseIFCIntoXKTModel, {\n WebIFC,\n data: sourceData,\n xktModel,\n wasmPath: \"./\",\n includeTypes,\n excludeTypes,\n stats,\n log\n });\n break;\n\n case \"laz\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"las\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"pcd\":\n convert(parsePCDIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"ply\":\n convert(parsePLYIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"stl\":\n convert(parseSTLIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n default:\n reject(`Error: unsupported source format: \"${ext}\".`);\n return;\n }\n\n function convert(parser, converterParams) {\n\n parser(converterParams).then(() => {\n\n if (!metaModelJSON) {\n log(\"Creating default metamodel in XKT\");\n xktModel.createDefaultMetaObjects();\n }\n\n log(\"Input file parsed OK. Building XKT document...\");\n\n xktModel.finalize().then(() => {\n\n log(\"XKT document built OK. Writing to XKT file...\");\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, {zip: true});\n\n const xktContent = Buffer.from(xktArrayBuffer);\n\n const targetFileSizeBytes = xktArrayBuffer.byteLength;\n\n stats.minTileSize = minTileSize || 200;\n stats.sourceSize = (sourceFileSizeBytes / 1000).toFixed(2);\n stats.xktSize = (targetFileSizeBytes / 1000).toFixed(2);\n stats.xktVersion = XKT_INFO.xktVersion;\n stats.compressionRatio = (sourceFileSizeBytes / targetFileSizeBytes).toFixed(2);\n stats.conversionTime = ((new Date() - startTime) / 1000.0).toFixed(2);\n stats.aabb = xktModel.aabb;\n log(`Converted to: XKT v${stats.xktVersion}`);\n if (includeTypes) {\n log(\"Include types: \" + (includeTypes ? includeTypes : \"(include all)\"));\n }\n if (excludeTypes) {\n log(\"Exclude types: \" + (excludeTypes ? excludeTypes : \"(exclude none)\"));\n }\n log(\"XKT size: \" + stats.xktSize + \" kB\");\n log(\"XKT textures size: \" + (stats.texturesSize / 1000).toFixed(2) + \"kB\");\n log(\"Compression ratio: \" + stats.compressionRatio);\n log(\"Conversion time: \" + stats.conversionTime + \" s\");\n log(\"Converted metaobjects: \" + stats.numMetaObjects);\n log(\"Converted property sets: \" + stats.numPropertySets);\n log(\"Converted drawable objects: \" + stats.numObjects);\n log(\"Converted geometries: \" + stats.numGeometries);\n log(\"Converted textures: \" + stats.numTextures);\n log(\"Converted textureSets: \" + stats.numTextureSets);\n log(\"Converted triangles: \" + stats.numTriangles);\n log(\"Converted vertices: \" + stats.numVertices);\n log(\"Converted UVs: \" + stats.numUVs);\n log(\"Converted normals: \" + stats.numNormals);\n log(\"Converted tiles: \" + xktModel.tilesList.length);\n log(\"minTileSize: \" + stats.minTileSize);\n\n if (output) {\n const outputDir = path.dirname(output);\n if (outputDir !== \"\" && !fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {recursive: true});\n }\n log('Writing XKT file: ' + output);\n fs.writeFileSync(output, xktContent);\n }\n\n if (outputXKTModel) {\n outputXKTModel(xktModel);\n }\n\n if (outputXKT) {\n outputXKT(xktContent);\n }\n\n if (outputStats) {\n outputStats(stats);\n }\n\n resolve();\n });\n }, (err) => {\n reject(err);\n });\n }\n });\n}\n\nexport {convert2xkt};", + "content": "import {XKT_INFO} from \"./XKT_INFO.js\";\nimport {XKTModel} from \"./XKTModel/XKTModel.js\";\nimport {parseCityJSONIntoXKTModel} from \"./parsers/parseCityJSONIntoXKTModel.js\";\nimport {parseGLTFIntoXKTModel} from \"./parsers/parseGLTFIntoXKTModel.js\";\nimport {parseIFCIntoXKTModel} from \"./parsers/parseIFCIntoXKTModel.js\";\nimport {parseLASIntoXKTModel} from \"./parsers/parseLASIntoXKTModel.js\";\nimport {parsePCDIntoXKTModel} from \"./parsers/parsePCDIntoXKTModel.js\";\nimport {parsePLYIntoXKTModel} from \"./parsers/parsePLYIntoXKTModel.js\";\nimport {parseSTLIntoXKTModel} from \"./parsers/parseSTLIntoXKTModel.js\";\nimport {writeXKTModelToArrayBuffer} from \"./XKTModel/writeXKTModelToArrayBuffer.js\";\n\nimport {toArrayBuffer} from \"./XKTModel/lib/toArraybuffer\";\n\nconst fs = require('fs');\nconst path = require(\"path\");\n\n/**\n * Converts model files into xeokit's native XKT format.\n *\n * Supported source formats are: IFC, CityJSON, glTF, LAZ and LAS.\n *\n * **Only bundled in xeokit-convert.cjs.js.**\n *\n * ## Usage\n *\n * ````javascript\n * const convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\n * const fs = require('fs');\n *\n * convert2xkt({\n * sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n * outputXKT: (xtkArrayBuffer) => {\n * fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n * }\n * }).then(() => {\n * console.log(\"Converted.\");\n * }, (errMsg) => {\n * console.error(\"Conversion failed: \" + errMsg)\n * });\n ````\n * @param {Object} params Conversion parameters.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {*} [params.configs] Configurations.\n * @param {String} [params.source] Path to source file. Alternative to ````sourceData````.\n * @param {ArrayBuffer|JSON} [params.sourceData] Source file data. Alternative to ````source````.\n * @param {String} [params.sourceFormat] Format of source file/data. Always needed with ````sourceData````, but not normally needed with ````source````, because convert2xkt will determine the format automatically from the file extension of ````source````.\n * @param {String} [params.metaModelDataStr] Source file data. Overrides metadata from ````metaModelSource````, ````sourceData```` and ````source````.\n * @param {String} [params.metaModelSource] Path to source metaModel file. Overrides metadata from ````sourceData```` and ````source````. Overridden by ````metaModelData````.\n * @param {String} [params.output] Path to destination XKT file. Directories on this path are automatically created if not existing.\n * @param {Function} [params.outputXKTModel] Callback to collect the ````XKTModel```` that is internally build by this method.\n * @param {Function} [params.outputXKT] Callback to collect XKT file data.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {Object} [stats] Collects conversion statistics. Statistics are attached to this object if provided.\n * @param {Function} [params.outputStats] Callback to collect statistics.\n * @param {Boolean} [params.rotateX=false] Whether to rotate the model 90 degrees about the X axis to make the Y axis \"up\", if necessary. Applies to CityJSON and LAS/LAZ models.\n * @param {Boolean} [params.reuseGeometries=true] When true, will enable geometry reuse within the XKT. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be when a model (eg. glTF) has 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {Boolean} [params.includeTextures=true] Whether to convert textures. Only works for ````glTF```` models.\n * @param {Boolean} [params.includeNormals=true] Whether to convert normals. When false, the parser will ignore\n * geometry normals, and the modelwill rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the model.\n * @param {Number} [params.minTileSize=200] Minimum RTC coordinate tile size. Set this to a value between 100 and 10000,\n * depending on how far from the coordinate origin the model's vertex positions are; specify larger tile sizes when close\n * to the origin, and smaller sizes when distant. This compensates for decreasing precision as floats get bigger.\n * @param {Function} [params.log] Logging callback.\n * @return {Promise}\n */\nfunction convert2xkt({\n WebIFC,\n configs,\n source,\n sourceData,\n sourceFormat,\n metaModelSource,\n metaModelDataStr,\n modelAABB,\n output,\n outputXKTModel,\n outputXKT,\n includeTypes,\n excludeTypes,\n reuseGeometries = true,\n minTileSize = 200,\n stats = {},\n outputStats,\n rotateX = false,\n includeTextures = true,\n includeNormals = true,\n log = function (msg) {\n }\n }) {\n\n stats.sourceFormat = \"\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numTextureSets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.sourceSize = 0;\n stats.xktSize = 0;\n stats.texturesSize = 0;\n stats.xktVersion = \"\";\n stats.compressionRatio = 0;\n stats.conversionTime = 0;\n stats.aabb = null;\n\n function getFileExtension(fileName) {\n let ext = path.extname(source);\n if (ext.charAt(0) === \".\") {\n ext = ext.substring(1);\n }\n return ext;\n }\n\n return new Promise(function (resolve, reject) {\n const _log = log;\n log = (msg) => {\n _log(`[convert2xkt] ${msg}`)\n }\n\n if (!source && !sourceData) {\n reject(\"Argument expected: source or sourceData\");\n return;\n }\n\n if (!sourceFormat && sourceData) {\n reject(\"Argument expected: sourceFormat is required with sourceData\");\n return;\n }\n\n if (!output && !outputXKTModel && !outputXKT) {\n reject(\"Argument expected: output, outputXKTModel or outputXKT\");\n return;\n }\n\n if (source) {\n log('Reading input file: ' + source);\n }\n\n const startTime = new Date();\n\n const sourceConfigs = configs.sourceConfigs || {};\n const ext = sourceFormat || getFileExtension(source);\n\n log(`Input file extension: \"${ext}\"`);\n\n let fileTypeConfigs = sourceConfigs[ext];\n\n if (!fileTypeConfigs) {\n log(`[WARNING] Could not find configs sourceConfigs entry for source format \"${ext}\". This is derived from the source file name extension. Will use internal default configs.`);\n fileTypeConfigs = {};\n }\n function overrideOption(option1, option2) {\n if (option1 !== undefined) {\n return option1;\n }\n return option2;\n }\n\n if (!sourceData) {\n try {\n sourceData = fs.readFileSync(source);\n } catch (err) {\n reject(err);\n return;\n }\n }\n\n const sourceFileSizeBytes = sourceData.byteLength;\n\n log(\"Input file size: \" + (sourceFileSizeBytes / 1000).toFixed(2) + \" kB\");\n\n if (!metaModelDataStr && metaModelSource) {\n log('Reading input metadata file: ' + metaModelSource);\n try {\n metaModelDataStr = fs.readFileSync(metaModelSource);\n } catch (err) {\n reject(err);\n return;\n }\n } else {\n log(`Not embedding metadata in XKT`);\n }\n\n let metaModelJSON;\n\n if (metaModelDataStr) {\n try {\n metaModelJSON = JSON.parse(metaModelDataStr);\n } catch (e) {\n metaModelJSON = {};\n log(`Error parsing metadata JSON: ${e}`);\n }\n }\n\n minTileSize = overrideOption(fileTypeConfigs.minTileSize, minTileSize);\n rotateX = overrideOption(fileTypeConfigs.rotateX, rotateX);\n reuseGeometries = overrideOption(fileTypeConfigs.reuseGeometries, reuseGeometries);\n includeTextures = overrideOption(fileTypeConfigs.includeTextures, includeTextures);\n includeNormals = overrideOption(fileTypeConfigs.includeNormals, includeNormals);\n includeTypes = overrideOption(fileTypeConfigs.includeTypes, includeTypes);\n excludeTypes = overrideOption(fileTypeConfigs.excludeTypes, excludeTypes);\n\n if (reuseGeometries === false) {\n log(\"Geometry reuse is disabled\");\n }\n\n const xktModel = new XKTModel({\n minTileSize,\n modelAABB\n });\n\n switch (ext) {\n case \"json\":\n convert(parseCityJSONIntoXKTModel, {\n data: JSON.parse(sourceData),\n xktModel,\n stats,\n rotateX,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n log\n });\n break;\n\n case \"glb\":\n sourceData = toArrayBuffer(sourceData);\n convert(parseGLTFIntoXKTModel, {\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"gltf\":\n sourceData = toArrayBuffer(sourceData);\n const gltfBasePath = source ? path.dirname(source) : \"\";\n convert(parseGLTFIntoXKTModel, {\n baseUri: gltfBasePath,\n data: sourceData,\n reuseGeometries,\n includeTextures: true,\n includeNormals,\n metaModelData: metaModelJSON,\n xktModel,\n stats,\n log\n });\n break;\n\n // case \"gltf\":\n // const gltfJSON = JSON.parse(sourceData);\n // const gltfBasePath = source ? getBasePath(source) : \"\";\n // convert(parseGLTFIntoXKTModel, {\n // baseUri: gltfBasePath,\n // data: gltfJSON,\n // reuseGeometries,\n // includeTextures,\n // includeNormals,\n // metaModelData: metaModelJSON,\n // xktModel,\n // getAttachment: async (name) => {\n // const filePath = gltfBasePath + name;\n // log(`Reading attachment file: ${filePath}`);\n // const buffer = fs.readFileSync(filePath);\n // const arrayBuf = toArrayBuffer(buffer);\n // return arrayBuf;\n // },\n // stats,\n // log\n // });\n // break;\n\n case \"ifc\":\n convert(parseIFCIntoXKTModel, {\n WebIFC,\n data: sourceData,\n xktModel,\n wasmPath: \"./\",\n includeTypes,\n excludeTypes,\n stats,\n log\n });\n break;\n\n case \"laz\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"las\":\n convert(parseLASIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n fp64: fileTypeConfigs.fp64,\n colorDepth: fileTypeConfigs.colorDepth,\n center: fileTypeConfigs.center,\n transform: fileTypeConfigs.transform,\n skip: overrideOption(fileTypeConfigs.skip, 1),\n log\n });\n break;\n\n case \"pcd\":\n convert(parsePCDIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"ply\":\n convert(parsePLYIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n case \"stl\":\n convert(parseSTLIntoXKTModel, {\n data: sourceData,\n xktModel,\n stats,\n log\n });\n break;\n\n default:\n reject(`Error: unsupported source format: \"${ext}\".`);\n return;\n }\n\n function convert(parser, converterParams) {\n\n parser(converterParams).then(() => {\n\n if (!metaModelJSON) {\n log(\"Creating default metamodel in XKT\");\n xktModel.createDefaultMetaObjects();\n }\n\n log(\"Input file parsed OK. Building XKT document...\");\n\n xktModel.finalize().then(() => {\n\n log(\"XKT document built OK. Writing to XKT file...\");\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel, metaModelJSON, stats, {zip: true});\n\n const xktContent = Buffer.from(xktArrayBuffer);\n\n const targetFileSizeBytes = xktArrayBuffer.byteLength;\n\n stats.minTileSize = minTileSize || 200;\n stats.sourceSize = (sourceFileSizeBytes / 1000).toFixed(2);\n stats.xktSize = (targetFileSizeBytes / 1000).toFixed(2);\n stats.xktVersion = XKT_INFO.xktVersion;\n stats.compressionRatio = (sourceFileSizeBytes / targetFileSizeBytes).toFixed(2);\n stats.conversionTime = ((new Date() - startTime) / 1000.0).toFixed(2);\n stats.aabb = xktModel.aabb;\n log(`Converted to: XKT v${stats.xktVersion}`);\n if (includeTypes) {\n log(\"Include types: \" + (includeTypes ? includeTypes : \"(include all)\"));\n }\n if (excludeTypes) {\n log(\"Exclude types: \" + (excludeTypes ? excludeTypes : \"(exclude none)\"));\n }\n log(\"XKT size: \" + stats.xktSize + \" kB\");\n log(\"XKT textures size: \" + (stats.texturesSize / 1000).toFixed(2) + \"kB\");\n log(\"Compression ratio: \" + stats.compressionRatio);\n log(\"Conversion time: \" + stats.conversionTime + \" s\");\n log(\"Converted metaobjects: \" + stats.numMetaObjects);\n log(\"Converted property sets: \" + stats.numPropertySets);\n log(\"Converted drawable objects: \" + stats.numObjects);\n log(\"Converted geometries: \" + stats.numGeometries);\n log(\"Converted textures: \" + stats.numTextures);\n log(\"Converted textureSets: \" + stats.numTextureSets);\n log(\"Converted triangles: \" + stats.numTriangles);\n log(\"Converted vertices: \" + stats.numVertices);\n log(\"Converted UVs: \" + stats.numUVs);\n log(\"Converted normals: \" + stats.numNormals);\n log(\"Converted tiles: \" + xktModel.tilesList.length);\n log(\"minTileSize: \" + stats.minTileSize);\n\n if (output) {\n const outputDir = path.dirname(output);\n if (outputDir !== \"\" && !fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, {recursive: true});\n }\n log('Writing XKT file: ' + output);\n fs.writeFileSync(output, xktContent);\n }\n\n if (outputXKTModel) {\n outputXKTModel(xktModel);\n }\n\n if (outputXKT) {\n outputXKT(xktContent);\n }\n\n if (outputStats) {\n outputStats(stats);\n }\n\n resolve();\n });\n }, (err) => {\n reject(err);\n });\n }\n });\n}\n\nexport {convert2xkt};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/convert2xkt.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/convert2xkt.js", "access": "public", "description": null, "lineNumber": 1 @@ -8194,7 +8194,7 @@ "name": "src/geometryBuilders/buildBoxGeometry.js", "content": "/**\n * @desc Creates box-shaped triangle mesh geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxGeometry({\n * primitiveType: \"triangles\" // or \"lines\"\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType,\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n\n primitiveType: \"triangles\",\n\n // The vertices - eight for our cube, each\n // one spanning three array elements for X,Y and Z\n\n positions: [\n\n // v0-v1-v2-v3 front\n xmax, ymax, zmax,\n xmin, ymax, zmax,\n xmin, ymin, zmax,\n xmax, ymin, zmax,\n\n // v0-v3-v4-v1 right\n xmax, ymax, zmax,\n xmax, ymin, zmax,\n xmax, ymin, zmin,\n xmax, ymax, zmin,\n\n // v0-v1-v6-v1 top\n xmax, ymax, zmax,\n xmax, ymax, zmin,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n\n // v1-v6-v7-v2 left\n xmin, ymax, zmax,\n xmin, ymax, zmin,\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n\n // v7-v4-v3-v2 bottom\n xmin, ymin, zmin,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmin, ymin, zmax,\n\n // v4-v7-v6-v1 back\n xmax, ymin, zmin,\n xmin, ymin, zmin,\n xmin, ymax, zmin,\n xmax, ymax, zmin\n ],\n\n // Normal vectors, one for each vertex\n normals: [\n\n // v0-v1-v2-v3 front\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n\n // v0-v3-v4-v5 right\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n 1, 0, 0,\n\n // v0-v5-v6-v1 top\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n 0, 1, 0,\n\n // v1-v6-v7-v2 left\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n -1, 0, 0,\n\n // v7-v4-v3-v2 bottom\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n 0, -1, 0,\n\n // v4-v7-v6-v5 back\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1,\n 0, 0, -1\n ],\n\n // UV coords\n uv: [\n\n // v0-v1-v2-v3 front\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v0-v3-v4-v1 right\n 0, 0,\n 0, 1,\n 1, 1,\n 1, 0,\n\n // v0-v1-v6-v1 top\n 1, 1,\n 1, 0,\n 0, 0,\n 0, 1,\n\n // v1-v6-v7-v2 left\n 1, 0,\n 0, 0,\n 0, 1,\n 1, 1,\n\n // v7-v4-v3-v2 bottom\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0,\n\n // v4-v7-v6-v1 back\n 0, 1,\n 1, 1,\n 1, 0,\n 0, 0\n ],\n\n // Indices - these organise the\n // positions and uv texture coordinates\n // into geometric primitives in accordance\n // with the \"primitive\" parameter,\n // in this case a set of three indices\n // for each triangle.\n //\n // Note that each triangle is specified\n // in counter-clockwise winding order.\n //\n // You can specify them in clockwise\n // order if you configure the Modes\n // node's frontFace flag as \"cw\", instead of\n // the default \"ccw\".\n indices: [\n 0, 1, 2,\n 0, 2, 3,\n // front\n 4, 5, 6,\n 4, 6, 7,\n // right\n 8, 9, 10,\n 8, 10, 11,\n // top\n 12, 13, 14,\n 12, 14, 15,\n // left\n 16, 17, 18,\n 16, 18, 19,\n // bottom\n 20, 21, 22,\n 20, 22, 23\n ]\n };\n}\n\nexport {buildBoxGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildBoxGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildBoxGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8297,7 +8297,7 @@ "name": "src/geometryBuilders/buildBoxLinesGeometry.js", "content": "/**\n * @desc Creates box-shaped line segment geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a box-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildBoxLinesGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const box = buildBoxLinesGeometry({\n * center: [0,0,0],\n * xSize: 1, // Half-size on each axis\n * ySize: 1,\n * zSize: 1\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"boxGeometry\",\n * primitiveType: box.primitiveType, // \"lines\"\n * positions: box.positions,\n * normals: box.normals,\n * indices: box.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redBoxMesh\",\n * geometryId: \"boxGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redBox\",\n * meshIds: [\"redBoxMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildBoxLinesGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1.0] Half-size on the X-axis.\n * @param {Number} [cfg.ySize=1.0] Half-size on the Y-axis.\n * @param {Number} [cfg.zSize=1.0] Half-size on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildBoxLinesGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let ySize = cfg.ySize || 1;\n if (ySize < 0) {\n console.error(\"negative ySize not allowed - will invert\");\n ySize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const xmin = -xSize + centerX;\n const ymin = -ySize + centerY;\n const zmin = -zSize + centerZ;\n const xmax = xSize + centerX;\n const ymax = ySize + centerY;\n const zmax = zSize + centerZ;\n\n return {\n primitiveType: \"lines\",\n positions: [\n xmin, ymin, zmin,\n xmin, ymin, zmax,\n xmin, ymax, zmin,\n xmin, ymax, zmax,\n xmax, ymin, zmin,\n xmax, ymin, zmax,\n xmax, ymax, zmin,\n xmax, ymax, zmax\n ],\n indices: [\n 0, 1,\n 1, 3,\n 3, 2,\n 2, 0,\n 4, 5,\n 5, 7,\n 7, 6,\n 6, 4,\n 0, 4,\n 1, 5,\n 2, 6,\n 3, 7\n ]\n }\n}\n\nexport {buildBoxLinesGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildBoxLinesGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildBoxLinesGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8400,7 +8400,7 @@ "name": "src/geometryBuilders/buildCylinderGeometry.js", "content": "/**\n * @desc Creates cylinder-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a cylinder-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildCylinderGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const cylinder = buildCylinderGeometry({\n * center: [0,0,0],\n * radiusTop: 2.0,\n * radiusBottom: 2.0,\n * height: 5.0,\n * radialSegments: 20,\n * heightSegments: 1,\n * openEnded: false\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"cylinderGeometry\",\n * primitiveType: cylinder.primitiveType,\n * positions: cylinder.positions,\n * normals: cylinder.normals,\n * indices: cylinder.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redCylinderMesh\",\n * geometryId: \"cylinderGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redCylinder\",\n * meshIds: [\"redCylinderMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildCylinderGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radiusTop=1] Radius of top.\n * @param {Number} [cfg.radiusBottom=1] Radius of bottom.\n * @param {Number} [cfg.height=1] Height.\n * @param {Number} [cfg.radialSegments=60] Number of horizontal segments.\n * @param {Number} [cfg.heightSegments=1] Number of vertical segments.\n * @param {Boolean} [cfg.openEnded=false] Whether or not the cylinder has solid caps on the ends.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildCylinderGeometry(cfg = {}) {\n\n let radiusTop = cfg.radiusTop || 1;\n if (radiusTop < 0) {\n console.error(\"negative radiusTop not allowed - will invert\");\n radiusTop *= -1;\n }\n\n let radiusBottom = cfg.radiusBottom || 1;\n if (radiusBottom < 0) {\n console.error(\"negative radiusBottom not allowed - will invert\");\n radiusBottom *= -1;\n }\n\n let height = cfg.height || 1;\n if (height < 0) {\n console.error(\"negative height not allowed - will invert\");\n height *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 3) {\n radialSegments = 3;\n }\n\n let heightSegments = cfg.heightSegments || 1;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n if (heightSegments < 1) {\n heightSegments = 1;\n }\n\n const openEnded = !!cfg.openEnded;\n\n let center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const heightHalf = height / 2;\n const heightLength = height / heightSegments;\n const radialAngle = (2.0 * Math.PI / radialSegments);\n const radialLength = 1.0 / radialSegments;\n //var nextRadius = this._radiusBottom;\n const radiusChange = (radiusTop - radiusBottom) / heightSegments;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let h;\n let i;\n\n let x;\n let z;\n\n let currentRadius;\n let currentHeight;\n\n let first;\n let second;\n\n let startIndex;\n let tu;\n let tv;\n\n // create vertices\n const normalY = (90.0 - (Math.atan(height / (radiusBottom - radiusTop))) * 180 / Math.PI) / 90.0;\n\n for (h = 0; h <= heightSegments; h++) {\n currentRadius = radiusTop - h * radiusChange;\n currentHeight = heightHalf - h * heightLength;\n\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n normals.push(currentRadius * x);\n normals.push(normalY); //todo\n normals.push(currentRadius * z);\n\n uvs.push((i * radialLength));\n uvs.push(h * 1 / heightSegments);\n\n positions.push((currentRadius * x) + centerX);\n positions.push((currentHeight) + centerY);\n positions.push((currentRadius * z) + centerZ);\n }\n }\n\n // create faces\n for (h = 0; h < heightSegments; h++) {\n for (i = 0; i <= radialSegments; i++) {\n\n first = h * (radialSegments + 1) + i;\n second = first + radialSegments;\n\n indices.push(first);\n indices.push(second);\n indices.push(second + 1);\n\n indices.push(first);\n indices.push(second + 1);\n indices.push(first + 1);\n }\n }\n\n // create top cap\n if (!openEnded && radiusTop > 0) {\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusTop * x);\n normals.push(1.0);\n normals.push(radiusTop * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusTop * x) + centerX);\n positions.push((heightHalf) + centerY);\n positions.push((radiusTop * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(first);\n indices.push(first + 1);\n indices.push(center);\n }\n }\n\n // create bottom cap\n if (!openEnded && radiusBottom > 0) {\n\n startIndex = (positions.length / 3);\n\n // top center\n normals.push(0.0);\n normals.push(-1.0);\n normals.push(0.0);\n\n uvs.push(0.5);\n uvs.push(0.5);\n\n positions.push(0 + centerX);\n positions.push(0 - heightHalf + centerY);\n positions.push(0 + centerZ);\n\n // top triangle fan\n for (i = 0; i <= radialSegments; i++) {\n\n x = Math.sin(i * radialAngle);\n z = Math.cos(i * radialAngle);\n\n tu = (0.5 * Math.sin(i * radialAngle)) + 0.5;\n tv = (0.5 * Math.cos(i * radialAngle)) + 0.5;\n\n normals.push(radiusBottom * x);\n normals.push(-1.0);\n normals.push(radiusBottom * z);\n\n uvs.push(tu);\n uvs.push(tv);\n\n positions.push((radiusBottom * x) + centerX);\n positions.push((0 - heightHalf) + centerY);\n positions.push((radiusBottom * z) + centerZ);\n }\n\n for (i = 0; i < radialSegments; i++) {\n\n center = startIndex;\n first = startIndex + 1 + i;\n\n indices.push(center);\n indices.push(first + 1);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\n\nexport {buildCylinderGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildCylinderGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildCylinderGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8539,7 +8539,7 @@ "name": "src/geometryBuilders/buildGridGeometry.js", "content": "/**\n * @desc Creates grid-shaped geometry arrays..\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a grid-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildGridGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const grid = buildGridGeometry({\n * size: 1000,\n * divisions: 500\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"gridGeometry\",\n * primitiveType: grid.primitiveType, // Will be \"lines\"\n * positions: grid.positions,\n * indices: grid.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redGridMesh\",\n * geometryId: \"gridGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redGrid\",\n * meshIds: [\"redGridMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildGridGeometry\n * @param {*} [cfg] Configs\n * @param {Number} [cfg.size=1] Dimension on the X and Z-axis.\n * @param {Number} [cfg.divisions=1] Number of divisions on X and Z axis..\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildGridGeometry(cfg = {}) {\n\n let size = cfg.size || 1;\n if (size < 0) {\n console.error(\"negative size not allowed - will invert\");\n size *= -1;\n }\n\n let divisions = cfg.divisions || 1;\n if (divisions < 0) {\n console.error(\"negative divisions not allowed - will invert\");\n divisions *= -1;\n }\n if (divisions < 1) {\n divisions = 1;\n }\n\n size = size || 10;\n divisions = divisions || 10;\n\n const step = size / divisions;\n const halfSize = size / 2;\n\n const positions = [];\n const indices = [];\n let l = 0;\n\n for (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) {\n\n positions.push(-halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(halfSize);\n positions.push(0);\n positions.push(k);\n\n positions.push(k);\n positions.push(0);\n positions.push(-halfSize);\n\n positions.push(k);\n positions.push(0);\n positions.push(halfSize);\n\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n indices.push(l++);\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildGridGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildGridGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildGridGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8620,7 +8620,7 @@ "name": "src/geometryBuilders/buildPlaneGeometry.js", "content": "/**\n * @desc Creates plane-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a plane-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildPlaneGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const plane = buildPlaneGeometry({\n * center: [0,0,0],\n * xSize: 2,\n * zSize: 2,\n * xSegments: 10,\n * zSegments: 10\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"planeGeometry\",\n * primitiveType: plane.primitiveType, // Will be \"triangles\"\n * positions: plane.positions,\n * normals: plane.normals,\n * indices: plane.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redPlaneMesh\",\n * geometryId: \"planeGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redPlane\",\n * meshIds: [\"redPlaneMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildPlaneGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.xSize=1] Dimension on the X-axis.\n * @param {Number} [cfg.zSize=1] Dimension on the Z-axis.\n * @param {Number} [cfg.xSegments=1] Number of segments on the X-axis.\n * @param {Number} [cfg.zSegments=1] Number of segments on the Z-axis.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildPlaneGeometry(cfg = {}) {\n\n let xSize = cfg.xSize || 1;\n if (xSize < 0) {\n console.error(\"negative xSize not allowed - will invert\");\n xSize *= -1;\n }\n\n let zSize = cfg.zSize || 1;\n if (zSize < 0) {\n console.error(\"negative zSize not allowed - will invert\");\n zSize *= -1;\n }\n\n let xSegments = cfg.xSegments || 1;\n if (xSegments < 0) {\n console.error(\"negative xSegments not allowed - will invert\");\n xSegments *= -1;\n }\n if (xSegments < 1) {\n xSegments = 1;\n }\n\n let zSegments = cfg.xSegments || 1;\n if (zSegments < 0) {\n console.error(\"negative zSegments not allowed - will invert\");\n zSegments *= -1;\n }\n if (zSegments < 1) {\n zSegments = 1;\n }\n\n const center = cfg.center;\n const centerX = center ? center[0] : 0;\n const centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const halfWidth = xSize / 2;\n const halfHeight = zSize / 2;\n\n const planeX = Math.floor(xSegments) || 1;\n const planeZ = Math.floor(zSegments) || 1;\n\n const planeX1 = planeX + 1;\n const planeZ1 = planeZ + 1;\n\n const segmentWidth = xSize / planeX;\n const segmentHeight = zSize / planeZ;\n\n const positions = new Float32Array(planeX1 * planeZ1 * 3);\n const normals = new Float32Array(planeX1 * planeZ1 * 3);\n const uvs = new Float32Array(planeX1 * planeZ1 * 2);\n\n let offset = 0;\n let offset2 = 0;\n\n let iz;\n let ix;\n let x;\n let a;\n let b;\n let c;\n let d;\n\n for (iz = 0; iz < planeZ1; iz++) {\n\n const z = iz * segmentHeight - halfHeight;\n\n for (ix = 0; ix < planeX1; ix++) {\n\n x = ix * segmentWidth - halfWidth;\n\n positions[offset] = x + centerX;\n positions[offset + 1] = centerY;\n positions[offset + 2] = -z + centerZ;\n\n normals[offset + 2] = -1;\n\n uvs[offset2] = (ix) / planeX;\n uvs[offset2 + 1] = ((planeZ - iz) / planeZ);\n\n offset += 3;\n offset2 += 2;\n }\n }\n\n offset = 0;\n\n const indices = new ((positions.length / 3) > 65535 ? Uint32Array : Uint16Array)(planeX * planeZ * 6);\n\n for (iz = 0; iz < planeZ; iz++) {\n\n for (ix = 0; ix < planeX; ix++) {\n\n a = ix + planeX1 * iz;\n b = ix + planeX1 * (iz + 1);\n c = (ix + 1) + planeX1 * (iz + 1);\n d = (ix + 1) + planeX1 * iz;\n\n indices[offset] = d;\n indices[offset + 1] = b;\n indices[offset + 2] = a;\n\n indices[offset + 3] = d;\n indices[offset + 4] = c;\n indices[offset + 5] = b;\n\n offset += 6;\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildPlaneGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildPlaneGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildPlaneGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8735,7 +8735,7 @@ "name": "src/geometryBuilders/buildSphereGeometry.js", "content": "/**\n * @desc Creates sphere-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a sphere-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildSphereGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const sphere = buildSphereGeometry({\n * center: [0,0,0],\n * radius: 1.5,\n * heightSegments: 60,\n * widthSegments: 60\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"sphereGeometry\",\n * primitiveType: sphere.primitiveType, // Will be \"triangles\"\n * positions: sphere.positions,\n * normals: sphere.normals,\n * indices: sphere.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redSphereMesh\",\n * geometryId: \"sphereGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n *const xktEntity = xktModel.createEntity({\n * entityId: \"redSphere\",\n * meshIds: [\"redSphereMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildSphereGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] Radius.\n * @param {Number} [cfg.heightSegments=24] Number of latitudinal bands.\n * @param {Number} [cfg.widthSegments=18] Number of longitudinal bands.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildSphereGeometry(cfg = {}) {\n\n const lod = cfg.lod || 1;\n\n const centerX = cfg.center ? cfg.center[0] : 0;\n const centerY = cfg.center ? cfg.center[1] : 0;\n const centerZ = cfg.center ? cfg.center[2] : 0;\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n\n let heightSegments = cfg.heightSegments || 18;\n if (heightSegments < 0) {\n console.error(\"negative heightSegments not allowed - will invert\");\n heightSegments *= -1;\n }\n heightSegments = Math.floor(lod * heightSegments);\n if (heightSegments < 18) {\n heightSegments = 18;\n }\n\n let widthSegments = cfg.widthSegments || 18;\n if (widthSegments < 0) {\n console.error(\"negative widthSegments not allowed - will invert\");\n widthSegments *= -1;\n }\n widthSegments = Math.floor(lod * widthSegments);\n if (widthSegments < 18) {\n widthSegments = 18;\n }\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let i;\n let j;\n\n let theta;\n let sinTheta;\n let cosTheta;\n\n let phi;\n let sinPhi;\n let cosPhi;\n\n let x;\n let y;\n let z;\n\n let u;\n let v;\n\n let first;\n let second;\n\n for (i = 0; i <= heightSegments; i++) {\n\n theta = i * Math.PI / heightSegments;\n sinTheta = Math.sin(theta);\n cosTheta = Math.cos(theta);\n\n for (j = 0; j <= widthSegments; j++) {\n\n phi = j * 2 * Math.PI / widthSegments;\n sinPhi = Math.sin(phi);\n cosPhi = Math.cos(phi);\n\n x = cosPhi * sinTheta;\n y = cosTheta;\n z = sinPhi * sinTheta;\n u = 1.0 - j / widthSegments;\n v = i / heightSegments;\n\n normals.push(x);\n normals.push(y);\n normals.push(z);\n\n uvs.push(u);\n uvs.push(v);\n\n positions.push(centerX + radius * x);\n positions.push(centerY + radius * y);\n positions.push(centerZ + radius * z);\n }\n }\n\n for (i = 0; i < heightSegments; i++) {\n for (j = 0; j < widthSegments; j++) {\n\n first = (i * (widthSegments + 1)) + j;\n second = first + widthSegments + 1;\n\n indices.push(first + 1);\n indices.push(second + 1);\n indices.push(second);\n indices.push(first + 1);\n indices.push(second);\n indices.push(first);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildSphereGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildSphereGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildSphereGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8838,7 +8838,7 @@ "name": "src/geometryBuilders/buildTorusGeometry.js", "content": "import {math} from '../lib/math.js';\n\n/**\n * @desc Creates torus-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a torus-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildTorusGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const torus = buildTorusGeometry({\n * center: [0,0,0],\n * radius: 1.0,\n * tube: 0.5,\n * radialSegments: 32,\n * tubeSegments: 24,\n * arc: Math.PI * 2.0\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"torusGeometry\",\n * primitiveType: torus.primitiveType, // Will be \"triangles\"\n * positions: torus.positions,\n * normals: torus.normals,\n * indices: torus.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTorusMesh\",\n * geometryId: \"torusGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redTorus\",\n * meshIds: [\"redTorusMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildTorusGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number} [cfg.radius=1] The overall radius.\n * @param {Number} [cfg.tube=0.3] The tube radius.\n * @param {Number} [cfg.radialSegments=32] The number of radial segments.\n * @param {Number} [cfg.tubeSegments=24] The number of tubular segments.\n * @param {Number} [cfg.arc=Math.PI*0.5] The length of the arc in radians, where Math.PI*2 is a closed torus.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildTorusGeometry(cfg = {}) {\n\n let radius = cfg.radius || 1;\n if (radius < 0) {\n console.error(\"negative radius not allowed - will invert\");\n radius *= -1;\n }\n radius *= 0.5;\n\n let tube = cfg.tube || 0.3;\n if (tube < 0) {\n console.error(\"negative tube not allowed - will invert\");\n tube *= -1;\n }\n\n let radialSegments = cfg.radialSegments || 32;\n if (radialSegments < 0) {\n console.error(\"negative radialSegments not allowed - will invert\");\n radialSegments *= -1;\n }\n if (radialSegments < 4) {\n radialSegments = 4;\n }\n\n let tubeSegments = cfg.tubeSegments || 24;\n if (tubeSegments < 0) {\n console.error(\"negative tubeSegments not allowed - will invert\");\n tubeSegments *= -1;\n }\n if (tubeSegments < 4) {\n tubeSegments = 4;\n }\n\n let arc = cfg.arc || Math.PI * 2;\n if (arc < 0) {\n console.warn(\"negative arc not allowed - will invert\");\n arc *= -1;\n }\n if (arc > 360) {\n arc = 360;\n }\n\n const center = cfg.center;\n let centerX = center ? center[0] : 0;\n let centerY = center ? center[1] : 0;\n const centerZ = center ? center[2] : 0;\n\n const positions = [];\n const normals = [];\n const uvs = [];\n const indices = [];\n\n let u;\n let v;\n let x;\n let y;\n let z;\n let vec;\n\n let i;\n let j;\n\n for (j = 0; j <= tubeSegments; j++) {\n for (i = 0; i <= radialSegments; i++) {\n\n u = i / radialSegments * arc;\n v = 0.785398 + (j / tubeSegments * Math.PI * 2);\n\n centerX = radius * Math.cos(u);\n centerY = radius * Math.sin(u);\n\n x = (radius + tube * Math.cos(v)) * Math.cos(u);\n y = (radius + tube * Math.cos(v)) * Math.sin(u);\n z = tube * Math.sin(v);\n\n positions.push(x + centerX);\n positions.push(y + centerY);\n positions.push(z + centerZ);\n\n uvs.push(1 - (i / radialSegments));\n uvs.push((j / tubeSegments));\n\n vec = math.normalizeVec3(math.subVec3([x, y, z], [centerX, centerY, centerZ], []), []);\n\n normals.push(vec[0]);\n normals.push(vec[1]);\n normals.push(vec[2]);\n }\n }\n\n let a;\n let b;\n let c;\n let d;\n\n for (j = 1; j <= tubeSegments; j++) {\n for (i = 1; i <= radialSegments; i++) {\n\n a = (radialSegments + 1) * j + i - 1;\n b = (radialSegments + 1) * (j - 1) + i - 1;\n c = (radialSegments + 1) * (j - 1) + i;\n d = (radialSegments + 1) * j + i;\n\n indices.push(a);\n indices.push(b);\n indices.push(c);\n\n indices.push(c);\n indices.push(d);\n indices.push(a);\n }\n }\n\n return {\n primitiveType: \"triangles\",\n positions: positions,\n normals: normals,\n uv: uvs,\n uvs: uvs,\n indices: indices\n };\n}\n\nexport {buildTorusGeometry};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildTorusGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildTorusGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -8965,7 +8965,7 @@ "name": "src/geometryBuilders/buildVectorTextGeometry.js", "content": "const letters = {\n ' ': {width: 16, points: []},\n '!': {\n width: 10, points: [\n [5, 21],\n [5, 7],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '\"': {\n width: 16, points: [\n [4, 21],\n [4, 14],\n [-1, -1],\n [12, 21],\n [12, 14]\n ]\n },\n '#': {\n width: 21, points: [\n [11, 25],\n [4, -7],\n [-1, -1],\n [17, 25],\n [10, -7],\n [-1, -1],\n [4, 12],\n [18, 12],\n [-1, -1],\n [3, 6],\n [17, 6]\n ]\n },\n '$': {\n width: 20, points: [\n [8, 25],\n [8, -4],\n [-1, -1],\n [12, 25],\n [12, -4],\n [-1, -1],\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n '%': {\n width: 24, points: [\n [21, 21],\n [3, 0],\n [-1, -1],\n [8, 21],\n [10, 19],\n [10, 17],\n [9, 15],\n [7, 14],\n [5, 14],\n [3, 16],\n [3, 18],\n [4, 20],\n [6, 21],\n [8, 21],\n [10, 20],\n [13, 19],\n [16, 19],\n [19, 20],\n [21, 21],\n [-1, -1],\n [17, 7],\n [15, 6],\n [14, 4],\n [14, 2],\n [16, 0],\n [18, 0],\n [20, 1],\n [21, 3],\n [21, 5],\n [19, 7],\n [17, 7]\n ]\n },\n '&': {\n width: 26, points: [\n [23, 12],\n [23, 13],\n [22, 14],\n [21, 14],\n [20, 13],\n [19, 11],\n [17, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [7, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 6],\n [4, 8],\n [5, 9],\n [12, 13],\n [13, 14],\n [14, 16],\n [14, 18],\n [13, 20],\n [11, 21],\n [9, 20],\n [8, 18],\n [8, 16],\n [9, 13],\n [11, 10],\n [16, 3],\n [18, 1],\n [20, 0],\n [22, 0],\n [23, 1],\n [23, 2]\n ]\n },\n '\\'': {\n width: 10, points: [\n [5, 19],\n [4, 20],\n [5, 21],\n [6, 20],\n [6, 18],\n [5, 16],\n [4, 15]\n ]\n },\n '(': {\n width: 14, points: [\n [11, 25],\n [9, 23],\n [7, 20],\n [5, 16],\n [4, 11],\n [4, 7],\n [5, 2],\n [7, -2],\n [9, -5],\n [11, -7]\n ]\n },\n ')': {\n width: 14, points: [\n [3, 25],\n [5, 23],\n [7, 20],\n [9, 16],\n [10, 11],\n [10, 7],\n [9, 2],\n [7, -2],\n [5, -5],\n [3, -7]\n ]\n },\n '*': {\n width: 16, points: [\n [8, 21],\n [8, 9],\n [-1, -1],\n [3, 18],\n [13, 12],\n [-1, -1],\n [13, 18],\n [3, 12]\n ]\n },\n '+': {\n width: 26, points: [\n [13, 18],\n [13, 0],\n [-1, -1],\n [4, 9],\n [22, 9]\n ]\n },\n ',': {\n width: 10, points: [\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '-': {\n width: 26, points: [\n [4, 9],\n [22, 9]\n ]\n },\n '.': {\n width: 10, points: [\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n '/': {\n width: 22, points: [\n [20, 25],\n [2, -7]\n ]\n },\n '0': {\n width: 20, points: [\n [9, 21],\n [6, 20],\n [4, 17],\n [3, 12],\n [3, 9],\n [4, 4],\n [6, 1],\n [9, 0],\n [11, 0],\n [14, 1],\n [16, 4],\n [17, 9],\n [17, 12],\n [16, 17],\n [14, 20],\n [11, 21],\n [9, 21]\n ]\n },\n '1': {\n width: 20, points: [\n [6, 17],\n [8, 18],\n [11, 21],\n [11, 0]\n ]\n },\n '2': {\n width: 20, points: [\n [4, 16],\n [4, 17],\n [5, 19],\n [6, 20],\n [8, 21],\n [12, 21],\n [14, 20],\n [15, 19],\n [16, 17],\n [16, 15],\n [15, 13],\n [13, 10],\n [3, 0],\n [17, 0]\n ]\n },\n '3': {\n width: 20, points: [\n [5, 21],\n [16, 21],\n [10, 13],\n [13, 13],\n [15, 12],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '4': {\n width: 20, points: [\n [13, 21],\n [3, 7],\n [18, 7],\n [-1, -1],\n [13, 21],\n [13, 0]\n ]\n },\n '5': {\n width: 20, points: [\n [15, 21],\n [5, 21],\n [4, 12],\n [5, 13],\n [8, 14],\n [11, 14],\n [14, 13],\n [16, 11],\n [17, 8],\n [17, 6],\n [16, 3],\n [14, 1],\n [11, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4]\n ]\n },\n '6': {\n width: 20, points: [\n [16, 18],\n [15, 20],\n [12, 21],\n [10, 21],\n [7, 20],\n [5, 17],\n [4, 12],\n [4, 7],\n [5, 3],\n [7, 1],\n [10, 0],\n [11, 0],\n [14, 1],\n [16, 3],\n [17, 6],\n [17, 7],\n [16, 10],\n [14, 12],\n [11, 13],\n [10, 13],\n [7, 12],\n [5, 10],\n [4, 7]\n ]\n },\n '7': {\n width: 20, points: [\n [17, 21],\n [7, 0],\n [-1, -1],\n [3, 21],\n [17, 21]\n ]\n },\n '8': {\n width: 20, points: [\n [8, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 14],\n [7, 13],\n [11, 12],\n [14, 11],\n [16, 9],\n [17, 7],\n [17, 4],\n [16, 2],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [4, 2],\n [3, 4],\n [3, 7],\n [4, 9],\n [6, 11],\n [9, 12],\n [13, 13],\n [15, 14],\n [16, 16],\n [16, 18],\n [15, 20],\n [12, 21],\n [8, 21]\n ]\n },\n '9': {\n width: 20, points: [\n [16, 14],\n [15, 11],\n [13, 9],\n [10, 8],\n [9, 8],\n [6, 9],\n [4, 11],\n [3, 14],\n [3, 15],\n [4, 18],\n [6, 20],\n [9, 21],\n [10, 21],\n [13, 20],\n [15, 18],\n [16, 14],\n [16, 9],\n [15, 4],\n [13, 1],\n [10, 0],\n [8, 0],\n [5, 1],\n [4, 3]\n ]\n },\n ':': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [5, 2],\n [4, 1],\n [5, 0],\n [6, 1],\n [5, 2]\n ]\n },\n ';': {\n width: 10, points: [\n [5, 14],\n [4, 13],\n [5, 12],\n [6, 13],\n [5, 14],\n [-1, -1],\n [6, 1],\n [5, 0],\n [4, 1],\n [5, 2],\n [6, 1],\n [6, -1],\n [5, -3],\n [4, -4]\n ]\n },\n '<': {\n width: 24, points: [\n [20, 18],\n [4, 9],\n [20, 0]\n ]\n },\n '=': {\n width: 26, points: [\n [4, 12],\n [22, 12],\n [-1, -1],\n [4, 6],\n [22, 6]\n ]\n },\n '>': {\n width: 24, points: [\n [4, 18],\n [20, 9],\n [4, 0]\n ]\n },\n '?': {\n width: 18, points: [\n [3, 16],\n [3, 17],\n [4, 19],\n [5, 20],\n [7, 21],\n [11, 21],\n [13, 20],\n [14, 19],\n [15, 17],\n [15, 15],\n [14, 13],\n [13, 12],\n [9, 10],\n [9, 7],\n [-1, -1],\n [9, 2],\n [8, 1],\n [9, 0],\n [10, 1],\n [9, 2]\n ]\n },\n '@': {\n width: 27, points: [\n [18, 13],\n [17, 15],\n [15, 16],\n [12, 16],\n [10, 15],\n [9, 14],\n [8, 11],\n [8, 8],\n [9, 6],\n [11, 5],\n [14, 5],\n [16, 6],\n [17, 8],\n [-1, -1],\n [12, 16],\n [10, 14],\n [9, 11],\n [9, 8],\n [10, 6],\n [11, 5],\n [-1, -1],\n [18, 16],\n [17, 8],\n [17, 6],\n [19, 5],\n [21, 5],\n [23, 7],\n [24, 10],\n [24, 12],\n [23, 15],\n [22, 17],\n [20, 19],\n [18, 20],\n [15, 21],\n [12, 21],\n [9, 20],\n [7, 19],\n [5, 17],\n [4, 15],\n [3, 12],\n [3, 9],\n [4, 6],\n [5, 4],\n [7, 2],\n [9, 1],\n [12, 0],\n [15, 0],\n [18, 1],\n [20, 2],\n [21, 3],\n [-1, -1],\n [19, 16],\n [18, 8],\n [18, 6],\n [19, 5]\n ]\n },\n 'A': {\n width: 18, points: [\n [9, 21],\n [1, 0],\n [-1, -1],\n [9, 21],\n [17, 0],\n [-1, -1],\n [4, 7],\n [14, 7]\n ]\n },\n 'B': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [-1, -1],\n [4, 11],\n [13, 11],\n [16, 10],\n [17, 9],\n [18, 7],\n [18, 4],\n [17, 2],\n [16, 1],\n [13, 0],\n [4, 0]\n ]\n },\n 'C': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5]\n ]\n },\n 'D': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [11, 21],\n [14, 20],\n [16, 18],\n [17, 16],\n [18, 13],\n [18, 8],\n [17, 5],\n [16, 3],\n [14, 1],\n [11, 0],\n [4, 0]\n ]\n },\n 'E': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11],\n [-1, -1],\n [4, 0],\n [17, 0]\n ]\n },\n 'F': {\n width: 18, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [17, 21],\n [-1, -1],\n [4, 11],\n [12, 11]\n ]\n },\n 'G': {\n width: 21, points: [\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [18, 8],\n [-1, -1],\n [13, 8],\n [18, 8]\n ]\n },\n 'H': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [18, 0],\n [-1, -1],\n [4, 11],\n [18, 11]\n ]\n },\n 'I': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'J': {\n width: 16, points: [\n [12, 21],\n [12, 5],\n [11, 2],\n [10, 1],\n [8, 0],\n [6, 0],\n [4, 1],\n [3, 2],\n [2, 5],\n [2, 7]\n ]\n },\n 'K': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [18, 21],\n [4, 7],\n [-1, -1],\n [9, 12],\n [18, 0]\n ]\n },\n 'L': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 0],\n [16, 0]\n ]\n },\n 'M': {\n width: 24, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [12, 0],\n [-1, -1],\n [20, 21],\n [20, 0]\n ]\n },\n 'N': {\n width: 22, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [18, 0],\n [-1, -1],\n [18, 21],\n [18, 0]\n ]\n },\n 'O': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21]\n ]\n },\n 'P': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 14],\n [17, 12],\n [16, 11],\n [13, 10],\n [4, 10]\n ]\n },\n 'Q': {\n width: 22, points: [\n [9, 21],\n [7, 20],\n [5, 18],\n [4, 16],\n [3, 13],\n [3, 8],\n [4, 5],\n [5, 3],\n [7, 1],\n [9, 0],\n [13, 0],\n [15, 1],\n [17, 3],\n [18, 5],\n [19, 8],\n [19, 13],\n [18, 16],\n [17, 18],\n [15, 20],\n [13, 21],\n [9, 21],\n [-1, -1],\n [12, 4],\n [18, -2]\n ]\n },\n 'R': {\n width: 21, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 21],\n [13, 21],\n [16, 20],\n [17, 19],\n [18, 17],\n [18, 15],\n [17, 13],\n [16, 12],\n [13, 11],\n [4, 11],\n [-1, -1],\n [11, 11],\n [18, 0]\n ]\n },\n 'S': {\n width: 20, points: [\n [17, 18],\n [15, 20],\n [12, 21],\n [8, 21],\n [5, 20],\n [3, 18],\n [3, 16],\n [4, 14],\n [5, 13],\n [7, 12],\n [13, 10],\n [15, 9],\n [16, 8],\n [17, 6],\n [17, 3],\n [15, 1],\n [12, 0],\n [8, 0],\n [5, 1],\n [3, 3]\n ]\n },\n 'T': {\n width: 16, points: [\n [8, 21],\n [8, 0],\n [-1, -1],\n [1, 21],\n [15, 21]\n ]\n },\n 'U': {\n width: 22, points: [\n [4, 21],\n [4, 6],\n [5, 3],\n [7, 1],\n [10, 0],\n [12, 0],\n [15, 1],\n [17, 3],\n [18, 6],\n [18, 21]\n ]\n },\n 'V': {\n width: 18, points: [\n [1, 21],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 0]\n ]\n },\n 'W': {\n width: 24, points: [\n [2, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [7, 0],\n [-1, -1],\n [12, 21],\n [17, 0],\n [-1, -1],\n [22, 21],\n [17, 0]\n ]\n },\n 'X': {\n width: 20, points: [\n [3, 21],\n [17, 0],\n [-1, -1],\n [17, 21],\n [3, 0]\n ]\n },\n 'Y': {\n width: 18, points: [\n [1, 21],\n [9, 11],\n [9, 0],\n [-1, -1],\n [17, 21],\n [9, 11]\n ]\n },\n 'Z': {\n width: 20, points: [\n [17, 21],\n [3, 0],\n [-1, -1],\n [3, 21],\n [17, 21],\n [-1, -1],\n [3, 0],\n [17, 0]\n ]\n },\n '[': {\n width: 14, points: [\n [4, 25],\n [4, -7],\n [-1, -1],\n [5, 25],\n [5, -7],\n [-1, -1],\n [4, 25],\n [11, 25],\n [-1, -1],\n [4, -7],\n [11, -7]\n ]\n },\n '\\\\': {\n width: 14, points: [\n [0, 21],\n [14, -3]\n ]\n },\n ']': {\n width: 14, points: [\n [9, 25],\n [9, -7],\n [-1, -1],\n [10, 25],\n [10, -7],\n [-1, -1],\n [3, 25],\n [10, 25],\n [-1, -1],\n [3, -7],\n [10, -7]\n ]\n },\n '^': {\n width: 16, points: [\n [6, 15],\n [8, 18],\n [10, 15],\n [-1, -1],\n [3, 12],\n [8, 17],\n [13, 12],\n [-1, -1],\n [8, 17],\n [8, 0]\n ]\n },\n '_': {\n width: 16, points: [\n [0, -2],\n [16, -2]\n ]\n },\n '`': {\n width: 10, points: [\n [6, 21],\n [5, 20],\n [4, 18],\n [4, 16],\n [5, 15],\n [6, 16],\n [5, 17]\n ]\n },\n 'a': {\n width: 19, points: [\n [15, 14],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'b': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'c': {\n width: 18, points: [\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'd': {\n width: 19, points: [\n [15, 21],\n [15, 0],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'e': {\n width: 18, points: [\n [3, 8],\n [15, 8],\n [15, 10],\n [14, 12],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'f': {\n width: 12, points: [\n [10, 21],\n [8, 21],\n [6, 20],\n [5, 17],\n [5, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'g': {\n width: 19, points: [\n [15, 14],\n [15, -2],\n [14, -5],\n [13, -6],\n [11, -7],\n [8, -7],\n [6, -6],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'h': {\n width: 19, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'i': {\n width: 8, points: [\n [3, 21],\n [4, 20],\n [5, 21],\n [4, 22],\n [3, 21],\n [-1, -1],\n [4, 14],\n [4, 0]\n ]\n },\n 'j': {\n width: 10, points: [\n [5, 21],\n [6, 20],\n [7, 21],\n [6, 22],\n [5, 21],\n [-1, -1],\n [6, 14],\n [6, -3],\n [5, -6],\n [3, -7],\n [1, -7]\n ]\n },\n 'k': {\n width: 17, points: [\n [4, 21],\n [4, 0],\n [-1, -1],\n [14, 14],\n [4, 4],\n [-1, -1],\n [8, 8],\n [15, 0]\n ]\n },\n 'l': {\n width: 8, points: [\n [4, 21],\n [4, 0]\n ]\n },\n 'm': {\n width: 30, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0],\n [-1, -1],\n [15, 10],\n [18, 13],\n [20, 14],\n [23, 14],\n [25, 13],\n [26, 10],\n [26, 0]\n ]\n },\n 'n': {\n width: 19, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 10],\n [7, 13],\n [9, 14],\n [12, 14],\n [14, 13],\n [15, 10],\n [15, 0]\n ]\n },\n 'o': {\n width: 19, points: [\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3],\n [16, 6],\n [16, 8],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14]\n ]\n },\n 'p': {\n width: 19, points: [\n [4, 14],\n [4, -7],\n [-1, -1],\n [4, 11],\n [6, 13],\n [8, 14],\n [11, 14],\n [13, 13],\n [15, 11],\n [16, 8],\n [16, 6],\n [15, 3],\n [13, 1],\n [11, 0],\n [8, 0],\n [6, 1],\n [4, 3]\n ]\n },\n 'q': {\n width: 19, points: [\n [15, 14],\n [15, -7],\n [-1, -1],\n [15, 11],\n [13, 13],\n [11, 14],\n [8, 14],\n [6, 13],\n [4, 11],\n [3, 8],\n [3, 6],\n [4, 3],\n [6, 1],\n [8, 0],\n [11, 0],\n [13, 1],\n [15, 3]\n ]\n },\n 'r': {\n width: 13, points: [\n [4, 14],\n [4, 0],\n [-1, -1],\n [4, 8],\n [5, 11],\n [7, 13],\n [9, 14],\n [12, 14]\n ]\n },\n 's': {\n width: 17, points: [\n [14, 11],\n [13, 13],\n [10, 14],\n [7, 14],\n [4, 13],\n [3, 11],\n [4, 9],\n [6, 8],\n [11, 7],\n [13, 6],\n [14, 4],\n [14, 3],\n [13, 1],\n [10, 0],\n [7, 0],\n [4, 1],\n [3, 3]\n ]\n },\n 't': {\n width: 12, points: [\n [5, 21],\n [5, 4],\n [6, 1],\n [8, 0],\n [10, 0],\n [-1, -1],\n [2, 14],\n [9, 14]\n ]\n },\n 'u': {\n width: 19, points: [\n [4, 14],\n [4, 4],\n [5, 1],\n [7, 0],\n [10, 0],\n [12, 1],\n [15, 4],\n [-1, -1],\n [15, 14],\n [15, 0]\n ]\n },\n 'v': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0]\n ]\n },\n 'w': {\n width: 22, points: [\n [3, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [7, 0],\n [-1, -1],\n [11, 14],\n [15, 0],\n [-1, -1],\n [19, 14],\n [15, 0]\n ]\n },\n 'x': {\n width: 17, points: [\n [3, 14],\n [14, 0],\n [-1, -1],\n [14, 14],\n [3, 0]\n ]\n },\n 'y': {\n width: 16, points: [\n [2, 14],\n [8, 0],\n [-1, -1],\n [14, 14],\n [8, 0],\n [6, -4],\n [4, -6],\n [2, -7],\n [1, -7]\n ]\n },\n 'z': {\n width: 17, points: [\n [14, 14],\n [3, 0],\n [-1, -1],\n [3, 14],\n [14, 14],\n [-1, -1],\n [3, 0],\n [14, 0]\n ]\n },\n '{': {\n width: 14, points: [\n [9, 25],\n [7, 24],\n [6, 23],\n [5, 21],\n [5, 19],\n [6, 17],\n [7, 16],\n [8, 14],\n [8, 12],\n [6, 10],\n [-1, -1],\n [7, 24],\n [6, 22],\n [6, 20],\n [7, 18],\n [8, 17],\n [9, 15],\n [9, 13],\n [8, 11],\n [4, 9],\n [8, 7],\n [9, 5],\n [9, 3],\n [8, 1],\n [7, 0],\n [6, -2],\n [6, -4],\n [7, -6],\n [-1, -1],\n [6, 8],\n [8, 6],\n [8, 4],\n [7, 2],\n [6, 1],\n [5, -1],\n [5, -3],\n [6, -5],\n [7, -6],\n [9, -7]\n ]\n },\n '|': {\n width: 8, points: [\n [4, 25],\n [4, -7]\n ]\n },\n '}': {\n width: 14, points: [\n [5, 25],\n [7, 24],\n [8, 23],\n [9, 21],\n [9, 19],\n [8, 17],\n [7, 16],\n [6, 14],\n [6, 12],\n [8, 10],\n [-1, -1],\n [7, 24],\n [8, 22],\n [8, 20],\n [7, 18],\n [6, 17],\n [5, 15],\n [5, 13],\n [6, 11],\n [10, 9],\n [6, 7],\n [5, 5],\n [5, 3],\n [6, 1],\n [7, 0],\n [8, -2],\n [8, -4],\n [7, -6],\n [-1, -1],\n [8, 8],\n [6, 6],\n [6, 4],\n [7, 2],\n [8, 1],\n [9, -1],\n [9, -3],\n [8, -5],\n [7, -6],\n [5, -7]\n ]\n },\n '~': {\n width: 24, points: [\n [3, 6],\n [3, 8],\n [4, 11],\n [6, 12],\n [8, 12],\n [10, 11],\n [14, 8],\n [16, 7],\n [18, 7],\n [20, 8],\n [21, 10],\n [-1, -1],\n [3, 8],\n [4, 10],\n [6, 11],\n [8, 11],\n [10, 10],\n [14, 7],\n [16, 6],\n [18, 6],\n [20, 7],\n [21, 10],\n [21, 12]\n ]\n }\n};\n\n/**\n * @desc Creates wireframe text-shaped geometry arrays.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then create an {@link XKTMesh} with a text-shaped {@link XKTGeometry}.\n *\n * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#geometry_builders_buildVectorTextGeometry)]\n *\n * ````javascript\n * const xktModel = new XKTModel();\n *\n * const text = buildVectorTextGeometry({\n * origin: [0,0,0],\n * text: \"On the other side of the screen, it all looked so easy\"\n * });\n *\n * const xktGeometry = xktModel.createGeometry({\n * geometryId: \"textGeometry\",\n * primitiveType: text.primitiveType, // Will be \"lines\"\n * positions: text.positions,\n * indices: text.indices\n * });\n *\n * const xktMesh = xktModel.createMesh({\n * meshId: \"redTextMesh\",\n * geometryId: \"textGeometry\",\n * position: [-4, -6, -4],\n * scale: [1, 3, 1],\n * rotation: [0, 0, 0],\n * color: [1, 0, 0],\n * opacity: 1\n * });\n *\n * const xktEntity = xktModel.createEntity({\n * entityId: \"redText\",\n * meshIds: [\"redTextMesh\"]\n * });\n *\n * xktModel.finalize();\n * ````\n *\n * @function buildVectorTextGeometry\n * @param {*} [cfg] Configs\n * @param {Number[]} [cfg.center] 3D point indicating the center position.\n * @param {Number[]} [cfg.origin] 3D point indicating the top left corner.\n * @param {Number} [cfg.size=1] Size of each character.\n * @param {String} [cfg.text=\"\"] The text.\n * @returns {Object} Geometry arrays for {@link XKTModel#createGeometry} or {@link XKTModel#createMesh}.\n */\nfunction buildVectorTextGeometry(cfg = {}) {\n\n var origin = cfg.origin || [0, 0, 0];\n var xOrigin = origin[0];\n var yOrigin = origin[1];\n var zOrigin = origin[2];\n var size = cfg.size || 1;\n\n var positions = [];\n var indices = [];\n var text = (\"\" + cfg.text).trim();\n var lines = (text || \"\").split(\"\\n\");\n var countVerts = 0;\n var y = 0;\n var x;\n var str;\n var len;\n var c;\n var mag = 1.0 / 25.0;\n var penUp;\n var p1;\n var p2;\n var needLine;\n var pointsLen;\n var a;\n\n for (var iLine = 0; iLine < lines.length; iLine++) {\n\n x = 0;\n str = lines[iLine];\n len = str.length;\n\n for (var i = 0; i < len; i++) {\n\n c = letters[str.charAt(i)];\n\n if (c === '\\n') {\n //alert(\"newline\");\n }\n\n if (!c) {\n continue;\n }\n\n penUp = 1;\n p1 = -1;\n p2 = -1;\n needLine = false;\n\n pointsLen = c.points.length;\n\n for (var j = 0; j < pointsLen; j++) {\n a = c.points[j];\n\n if (a[0] === -1 && a[1] === -1) {\n penUp = 1;\n needLine = false;\n continue;\n }\n\n positions.push((x + (a[0] * size) * mag) + xOrigin);\n positions.push((y + (a[1] * size) * mag) + yOrigin);\n positions.push(0 + zOrigin);\n\n if (p1 === -1) {\n p1 = countVerts;\n } else if (p2 === -1) {\n p2 = countVerts;\n } else {\n p1 = p2;\n p2 = countVerts;\n }\n countVerts++;\n\n if (penUp) {\n penUp = false;\n\n } else {\n indices.push(p1);\n indices.push(p2);\n }\n\n needLine = true;\n }\n x += c.width * mag * size;\n\n }\n y -= 35 * mag * size;\n }\n\n return {\n primitiveType: \"lines\",\n positions: positions,\n indices: indices\n };\n}\n\n\nexport {buildVectorTextGeometry}\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/geometryBuilders/buildVectorTextGeometry.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/geometryBuilders/buildVectorTextGeometry.js", "access": "public", "description": null, "lineNumber": 1 @@ -9087,7 +9087,7 @@ "name": "src/index.js", "content": "export {XKT_INFO} from \"./XKT_INFO.js\";\nexport * from \"./constants.js\";\nexport {XKTModel} from \"./XKTModel/XKTModel.js\";\nexport {writeXKTModelToArrayBuffer} from \"./XKTModel/writeXKTModelToArrayBuffer.js\";\n\nexport {parseCityJSONIntoXKTModel} from \"./parsers/parseCityJSONIntoXKTModel.js\";\nexport {parseGLTFIntoXKTModel} from \"./parsers/parseGLTFIntoXKTModel.js\";\nexport {parseGLTFJSONIntoXKTModel} from \"./parsers/parseGLTFJSONIntoXKTModel.js\";\nexport {parseIFCIntoXKTModel} from \"./parsers/parseIFCIntoXKTModel.js\";\nexport {parseLASIntoXKTModel} from \"./parsers/parseLASIntoXKTModel.js\";\nexport {parseMetaModelIntoXKTModel} from \"./parsers/parseMetaModelIntoXKTModel.js\";\nexport {parsePCDIntoXKTModel} from \"./parsers/parsePCDIntoXKTModel.js\";\nexport {parsePLYIntoXKTModel} from \"./parsers/parsePLYIntoXKTModel.js\";\nexport {parseSTLIntoXKTModel} from \"./parsers/parseSTLIntoXKTModel.js\";\n\nexport {buildBoxGeometry} from \"./geometryBuilders/buildBoxGeometry.js\";\nexport {buildBoxLinesGeometry} from \"./geometryBuilders/buildBoxLinesGeometry.js\";\nexport {buildCylinderGeometry} from \"./geometryBuilders/buildCylinderGeometry.js\";\nexport {buildGridGeometry} from \"./geometryBuilders/buildGridGeometry.js\";\nexport {buildPlaneGeometry} from \"./geometryBuilders/buildPlaneGeometry.js\";\nexport {buildSphereGeometry} from \"./geometryBuilders/buildSphereGeometry.js\";\nexport {buildTorusGeometry} from \"./geometryBuilders/buildTorusGeometry.js\";\nexport {buildVectorTextGeometry} from \"./geometryBuilders/buildVectorTextGeometry.js\";\n\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/index.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/index.js", "access": "public", "description": null, "lineNumber": 1 @@ -9098,7 +9098,7 @@ "name": "src/lib/buildFaceNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Builds face-aligned vertex normal vectors from positions and indices.\n *\n * @private\n */\nfunction buildFaceNormals(positions, indices, normals) {\n\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n\n const normVec = math.vec3();\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const j0 = indices[i];\n const j1 = indices[i + 1];\n const j2 = indices[i + 2];\n\n a[0] = positions[j0 * 3];\n a[1] = positions[j0 * 3 + 1];\n a[2] = positions[j0 * 3 + 2];\n\n b[0] = positions[j1 * 3];\n b[1] = positions[j1 * 3 + 1];\n b[2] = positions[j1 * 3 + 2];\n\n c[0] = positions[j2 * 3];\n c[1] = positions[j2 * 3 + 1];\n c[2] = positions[j2 * 3 + 2];\n\n triangleNormal(a,b,c, normVec);\n\n normals[j0 * 3 + 0] = normVec[0];\n normals[j0 * 3 + 1] = normVec[1];\n normals[j0 * 3 + 2] = normVec[2];\n\n normals[j1 * 3 + 0] = normVec[0];\n normals[j1 * 3 + 1] = normVec[1];\n normals[j1 * 3 + 2] = normVec[2];\n\n normals[j2 * 3 + 0] = normVec[0];\n normals[j2 * 3 + 1] = normVec[1];\n normals[j2 * 3 + 2] = normVec[2];\n }\n}\n\nfunction triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n}\n\nexport {buildFaceNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/buildFaceNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/buildFaceNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -9197,7 +9197,7 @@ "name": "src/lib/buildVertexNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Builds vertex normal vectors from positions and indices.\n *\n * @private\n */\nfunction buildVertexNormals(positions, indices, normals) {\n\n const a = math.vec3();\n const b = math.vec3();\n const c = math.vec3();\n const ab = math.vec3();\n const ac = math.vec3();\n const crossVec = math.vec3();\n const nvecs = new Array(positions.length / 3);\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n\n const j0 = indices[i];\n const j1 = indices[i + 1];\n const j2 = indices[i + 2];\n\n a[0] = positions[j0 * 3];\n a[1] = positions[j0 * 3 + 1];\n a[2] = positions[j0 * 3 + 2];\n\n b[0] = positions[j1 * 3];\n b[1] = positions[j1 * 3 + 1];\n b[2] = positions[j1 * 3 + 2];\n\n c[0] = positions[j2 * 3];\n c[1] = positions[j2 * 3 + 1];\n c[2] = positions[j2 * 3 + 2];\n\n math.subVec3(b, a, ab);\n math.subVec3(c, a, ac);\n\n const normVec = math.vec3();\n\n math.normalizeVec3(math.cross3Vec3(ab, ac, crossVec), normVec);\n\n if (!nvecs[j0]) {\n nvecs[j0] = [];\n }\n if (!nvecs[j1]) {\n nvecs[j1] = [];\n }\n if (!nvecs[j2]) {\n nvecs[j2] = [];\n }\n\n nvecs[j0].push(normVec);\n nvecs[j1].push(normVec);\n nvecs[j2].push(normVec);\n }\n\n normals = (normals && normals.length === positions.length) ? normals : new Float32Array(positions.length);\n\n for (let i = 0, len = nvecs.length; i < len; i++) { // Now go through and average out everything\n\n const count = nvecs[i].length;\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n for (let j = 0; j < count; j++) {\n x += nvecs[i][j][0];\n y += nvecs[i][j][1];\n z += nvecs[i][j][2];\n }\n\n normals[i * 3] = (x / count);\n normals[i * 3 + 1] = (y / count);\n normals[i * 3 + 2] = (z / count);\n }\n\n return normals;\n}\n\nexport {buildVertexNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/buildVertexNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/buildVertexNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -9250,7 +9250,7 @@ "name": "src/lib/earcut.js", "content": "/** @private */\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n\n // filter collinear points around the cuts\n filterPoints(outerNode, outerNode.next);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n\nexport {earcut};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/earcut.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/earcut.js", "access": "public", "description": null, "lineNumber": 1 @@ -10698,7 +10698,7 @@ "name": "src/lib/faceToVertexNormals.js", "content": "import {math} from \"./math.js\";\n\n/**\n * Converts surface-perpendicular face normals to vertex normals. Assumes that the mesh contains disjoint triangles\n * that don't share vertex array elements. Works by finding groups of vertices that have the same location and\n * averaging their normal vectors.\n *\n * @returns {{positions: Array, normals: *}}\n * @private\n */\nfunction faceToVertexNormals(positions, normals, options = {}) {\n const smoothNormalsAngleThreshold = options.smoothNormalsAngleThreshold || 20;\n const vertexMap = {};\n const vertexNormals = [];\n const vertexNormalAccum = {};\n let acc;\n let vx;\n let vy;\n let vz;\n let key;\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let posi;\n let i;\n let j;\n let len;\n let a;\n let b;\n let c;\n\n for (i = 0, len = positions.length; i < len; i += 3) {\n\n posi = i / 3;\n\n vx = positions[i];\n vy = positions[i + 1];\n vz = positions[i + 2];\n\n key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n\n if (vertexMap[key] === undefined) {\n vertexMap[key] = [posi];\n } else {\n vertexMap[key].push(posi);\n }\n\n const normal = math.normalizeVec3([normals[i], normals[i + 1], normals[i + 2]]);\n\n vertexNormals[posi] = normal;\n\n acc = math.vec4([normal[0], normal[1], normal[2], 1]);\n\n vertexNormalAccum[posi] = acc;\n }\n\n for (key in vertexMap) {\n\n if (vertexMap.hasOwnProperty(key)) {\n\n const vertices = vertexMap[key];\n const numVerts = vertices.length;\n\n for (i = 0; i < numVerts; i++) {\n\n const ii = vertices[i];\n\n acc = vertexNormalAccum[ii];\n\n for (j = 0; j < numVerts; j++) {\n\n if (i === j) {\n continue;\n }\n\n const jj = vertices[j];\n\n a = vertexNormals[ii];\n b = vertexNormals[jj];\n\n const angle = Math.abs(math.angleVec3(a, b) / math.DEGTORAD);\n\n if (angle < smoothNormalsAngleThreshold) {\n\n acc[0] += b[0];\n acc[1] += b[1];\n acc[2] += b[2];\n acc[3] += 1.0;\n }\n }\n }\n }\n }\n\n for (i = 0, len = normals.length; i < len; i += 3) {\n\n acc = vertexNormalAccum[i / 3];\n\n normals[i + 0] = acc[0] / acc[3];\n normals[i + 1] = acc[1] / acc[3];\n normals[i + 2] = acc[2] / acc[3];\n\n }\n}\n\nexport {faceToVertexNormals};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/faceToVertexNormals.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/faceToVertexNormals.js", "access": "public", "description": null, "lineNumber": 1 @@ -10763,7 +10763,7 @@ "name": "src/lib/math.js", "content": "// Some temporary vars to help avoid garbage collection\n\nconst doublePrecision = true;\nconst FloatArrayType = doublePrecision ? Float64Array : Float32Array;\n\nconst tempMat1 = new FloatArrayType(16);\nconst tempMat2 = new FloatArrayType(16);\nconst tempVec4 = new FloatArrayType(4);\n\n/**\n * @private\n */\nconst math = {\n\n MIN_DOUBLE: -Number.MAX_SAFE_INTEGER,\n MAX_DOUBLE: Number.MAX_SAFE_INTEGER,\n\n /**\n * The number of radiians in a degree (0.0174532925).\n * @property DEGTORAD\n * @type {Number}\n */\n DEGTORAD: 0.0174532925,\n\n /**\n * The number of degrees in a radian.\n * @property RADTODEG\n * @type {Number}\n */\n RADTODEG: 57.295779513,\n\n /**\n * Returns a new, uninitialized two-element vector.\n * @method vec2\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec2(values) {\n return new FloatArrayType(values || 2);\n },\n\n /**\n * Returns a new, uninitialized three-element vector.\n * @method vec3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec3(values) {\n return new FloatArrayType(values || 3);\n },\n\n /**\n * Returns a new, uninitialized four-element vector.\n * @method vec4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n vec4(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3x3 matrix.\n * @method mat3\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat3(values) {\n return new FloatArrayType(values || 9);\n },\n\n /**\n * Converts a 3x3 matrix to 4x4\n * @method mat3ToMat4\n * @param mat3 3x3 matrix.\n * @param mat4 4x4 matrix\n * @static\n * @returns {Number[]}\n */\n mat3ToMat4(mat3, mat4 = new FloatArrayType(16)) {\n mat4[0] = mat3[0];\n mat4[1] = mat3[1];\n mat4[2] = mat3[2];\n mat4[3] = 0;\n mat4[4] = mat3[3];\n mat4[5] = mat3[4];\n mat4[6] = mat3[5];\n mat4[7] = 0;\n mat4[8] = mat3[6];\n mat4[9] = mat3[7];\n mat4[10] = mat3[8];\n mat4[11] = 0;\n mat4[12] = 0;\n mat4[13] = 0;\n mat4[14] = 0;\n mat4[15] = 1;\n return mat4;\n },\n\n /**\n * Returns a new, uninitialized 4x4 matrix.\n * @method mat4\n * @param [values] Initial values.\n * @static\n * @returns {Number[]}\n */\n mat4(values) {\n return new FloatArrayType(values || 16);\n },\n\n /**\n * Converts a 4x4 matrix to 3x3\n * @method mat4ToMat3\n * @param mat4 4x4 matrix.\n * @param mat3 3x3 matrix\n * @static\n * @returns {Number[]}\n */\n mat4ToMat3(mat4, mat3) { // TODO\n //return new FloatArrayType(values || 9);\n },\n\n /**\n * Returns a new UUID.\n * @method createUUID\n * @static\n * @return string The new UUID\n */\n createUUID: ((() => {\n const self = {};\n const lut = [];\n for (let i = 0; i < 256; i++) {\n lut[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n return () => {\n const d0 = Math.random() * 0xffffffff | 0;\n const d1 = Math.random() * 0xffffffff | 0;\n const d2 = Math.random() * 0xffffffff | 0;\n const d3 = Math.random() * 0xffffffff | 0;\n return `${lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]}-${lut[d1 & 0xff]}${lut[d1 >> 8 & 0xff]}-${lut[d1 >> 16 & 0x0f | 0x40]}${lut[d1 >> 24 & 0xff]}-${lut[d2 & 0x3f | 0x80]}${lut[d2 >> 8 & 0xff]}-${lut[d2 >> 16 & 0xff]}${lut[d2 >> 24 & 0xff]}${lut[d3 & 0xff]}${lut[d3 >> 8 & 0xff]}${lut[d3 >> 16 & 0xff]}${lut[d3 >> 24 & 0xff]}`;\n };\n }))(),\n\n /**\n * Clamps a value to the given range.\n * @param {Number} value Value to clamp.\n * @param {Number} min Lower bound.\n * @param {Number} max Upper bound.\n * @returns {Number} Clamped result.\n */\n clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n },\n\n /**\n * Floating-point modulus\n * @method fmod\n * @static\n * @param {Number} a\n * @param {Number} b\n * @returns {*}\n */\n fmod(a, b) {\n if (a < b) {\n console.error(\"math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring\");\n return a;\n }\n while (b <= a) {\n a -= b;\n }\n return a;\n },\n\n /**\n * Negates a four-element vector.\n * @method negateVec4\n * @static\n * @param {Array(Number)} v Vector to negate\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n negateVec4(v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = -v[0];\n dest[1] = -v[1];\n dest[2] = -v[2];\n dest[3] = -v[3];\n return dest;\n },\n\n /**\n * Adds one four-element vector to another.\n * @method addVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n dest[3] = u[3] + v[3];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a four-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n dest[3] = v[3] + s;\n return dest;\n },\n\n /**\n * Adds one three-element vector to another.\n * @method addVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n addVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] + v[0];\n dest[1] = u[1] + v[1];\n dest[2] = u[2] + v[2];\n return dest;\n },\n\n /**\n * Adds a scalar value to each element of a three-element vector.\n * @method addVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n addVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] + s;\n dest[1] = v[1] + s;\n dest[2] = v[2] + s;\n return dest;\n },\n\n /**\n * Subtracts one four-element vector from another.\n * @method subVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n dest[3] = u[3] - v[3];\n return dest;\n },\n\n /**\n * Subtracts one three-element vector from another.\n * @method subVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n dest[2] = u[2] - v[2];\n return dest;\n },\n\n /**\n * Subtracts one two-element vector from another.\n * @method subVec2\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Vector to subtract\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n subVec2(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] - v[0];\n dest[1] = u[1] - v[1];\n return dest;\n },\n\n /**\n * Subtracts a scalar value from each element of a four-element vector.\n * @method subVec4Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] - s;\n dest[1] = v[1] - s;\n dest[2] = v[2] - s;\n dest[3] = v[3] - s;\n return dest;\n },\n\n /**\n * Sets each element of a 4-element vector to a scalar value minus the value of that element.\n * @method subScalarVec4\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n subScalarVec4(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s - v[0];\n dest[1] = s - v[1];\n dest[2] = s - v[2];\n dest[3] = s - v[3];\n return dest;\n },\n\n /**\n * Multiplies one three-element vector by another.\n * @method mulVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n mulVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] * v[0];\n dest[1] = u[1] * v[1];\n dest[2] = u[2] * v[2];\n dest[3] = u[3] * v[3];\n return dest;\n },\n\n /**\n * Multiplies each element of a four-element vector by a scalar.\n * @method mulVec34calar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n dest[3] = v[3] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a three-element vector by a scalar.\n * @method mulVec3Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n dest[2] = v[2] * s;\n return dest;\n },\n\n /**\n * Multiplies each element of a two-element vector by a scalar.\n * @method mulVec2Scalar\n * @static\n * @param {Array(Number)} v The vector\n * @param {Number} s The scalar\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, v otherwise\n */\n mulVec2Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] * s;\n dest[1] = v[1] * s;\n return dest;\n },\n\n /**\n * Divides one three-element vector by another.\n * @method divVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n return dest;\n },\n\n /**\n * Divides one four-element vector by another.\n * @method divVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @param {Array(Number)} [dest] Destination vector\n * @return {Array(Number)} dest if specified, u otherwise\n */\n divVec4(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n dest[0] = u[0] / v[0];\n dest[1] = u[1] / v[1];\n dest[2] = u[2] / v[2];\n dest[3] = u[3] / v[3];\n return dest;\n },\n\n /**\n * Divides a scalar by a three-element vector, returning a new vector.\n * @method divScalarVec3\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec3(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n return dest;\n },\n\n /**\n * Divides a three-element vector by a scalar.\n * @method divVec3Scalar\n * @static\n * @param v vec3\n * @param s scalar\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec3Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n return dest;\n },\n\n /**\n * Divides a four-element vector by a scalar.\n * @method divVec4Scalar\n * @static\n * @param v vec4\n * @param s scalar\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divVec4Scalar(v, s, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = v[0] / s;\n dest[1] = v[1] / s;\n dest[2] = v[2] / s;\n dest[3] = v[3] / s;\n return dest;\n },\n\n\n /**\n * Divides a scalar by a four-element vector, returning a new vector.\n * @method divScalarVec4\n * @static\n * @param s scalar\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n */\n divScalarVec4(s, v, dest) {\n if (!dest) {\n dest = v;\n }\n dest[0] = s / v[0];\n dest[1] = s / v[1];\n dest[2] = s / v[2];\n dest[3] = s / v[3];\n return dest;\n },\n\n /**\n * Returns the dot product of two four-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec4(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2] + u[3] * v[3]);\n },\n\n /**\n * Returns the cross product of two four-element vectors.\n * @method cross3Vec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec4(u, v) {\n const u0 = u[0];\n const u1 = u[1];\n const u2 = u[2];\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return [\n u1 * v2 - u2 * v1,\n u2 * v0 - u0 * v2,\n u0 * v1 - u1 * v0,\n 0.0];\n },\n\n /**\n * Returns the cross product of two three-element vectors.\n * @method cross3Vec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The cross product\n */\n cross3Vec3(u, v, dest) {\n if (!dest) {\n dest = u;\n }\n const x = u[0];\n const y = u[1];\n const z = u[2];\n const x2 = v[0];\n const y2 = v[1];\n const z2 = v[2];\n dest[0] = y * z2 - z * y2;\n dest[1] = z * x2 - x * z2;\n dest[2] = x * y2 - y * x2;\n return dest;\n },\n\n\n sqLenVec4(v) { // TODO\n return math.dotVec4(v, v);\n },\n\n /**\n * Returns the length of a four-element vector.\n * @method lenVec4\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec4(v) {\n return Math.sqrt(math.sqLenVec4(v));\n },\n\n /**\n * Returns the dot product of two three-element vectors.\n * @method dotVec3\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec3(u, v) {\n return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);\n },\n\n /**\n * Returns the dot product of two two-element vectors.\n * @method dotVec4\n * @static\n * @param {Array(Number)} u First vector\n * @param {Array(Number)} v Second vector\n * @return The dot product\n */\n dotVec2(u, v) {\n return (u[0] * v[0] + u[1] * v[1]);\n },\n\n\n sqLenVec3(v) {\n return math.dotVec3(v, v);\n },\n\n\n sqLenVec2(v) {\n return math.dotVec2(v, v);\n },\n\n /**\n * Returns the length of a three-element vector.\n * @method lenVec3\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec3(v) {\n return Math.sqrt(math.sqLenVec3(v));\n },\n\n distVec3: ((() => {\n const vec = new FloatArrayType(3);\n return (v, w) => math.lenVec3(math.subVec3(v, w, vec));\n }))(),\n\n /**\n * Returns the length of a two-element vector.\n * @method lenVec2\n * @static\n * @param {Array(Number)} v The vector\n * @return The length\n */\n lenVec2(v) {\n return Math.sqrt(math.sqLenVec2(v));\n },\n\n distVec2: ((() => {\n const vec = new FloatArrayType(2);\n return (v, w) => math.lenVec2(math.subVec2(v, w, vec));\n }))(),\n\n /**\n * @method rcpVec3\n * @static\n * @param v vec3\n * @param dest vec3 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n rcpVec3(v, dest) {\n return math.divScalarVec3(1.0, v, dest);\n },\n\n /**\n * Normalizes a four-element vector\n * @method normalizeVec4\n * @static\n * @param v vec4\n * @param dest vec4 - optional destination\n * @return [] dest if specified, v otherwise\n *\n */\n normalizeVec4(v, dest) {\n const f = 1.0 / math.lenVec4(v);\n return math.mulVec4Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a three-element vector\n * @method normalizeVec4\n * @static\n */\n normalizeVec3(v, dest) {\n const f = 1.0 / math.lenVec3(v);\n return math.mulVec3Scalar(v, f, dest);\n },\n\n /**\n * Normalizes a two-element vector\n * @method normalizeVec2\n * @static\n */\n normalizeVec2(v, dest) {\n const f = 1.0 / math.lenVec2(v);\n return math.mulVec2Scalar(v, f, dest);\n },\n\n /**\n * Gets the angle between two vectors\n * @method angleVec3\n * @param v\n * @param w\n * @returns {number}\n */\n angleVec3(v, w) {\n let theta = math.dotVec3(v, w) / (Math.sqrt(math.sqLenVec3(v) * math.sqLenVec3(w)));\n theta = theta < -1 ? -1 : (theta > 1 ? 1 : theta); // Clamp to handle numerical problems\n return Math.acos(theta);\n },\n\n /**\n * Creates a three-element vector from the rotation part of a sixteen-element matrix.\n * @param m\n * @param dest\n */\n vec3FromMat4Scale: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (m, dest) => {\n\n tempVec3[0] = m[0];\n tempVec3[1] = m[1];\n tempVec3[2] = m[2];\n\n dest[0] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[4];\n tempVec3[1] = m[5];\n tempVec3[2] = m[6];\n\n dest[1] = math.lenVec3(tempVec3);\n\n tempVec3[0] = m[8];\n tempVec3[1] = m[9];\n tempVec3[2] = m[10];\n\n dest[2] = math.lenVec3(tempVec3);\n\n return dest;\n };\n }))(),\n\n /**\n * Converts an n-element vector to a JSON-serializable\n * array with values rounded to two decimal places.\n */\n vecToArray: ((() => {\n function trunc(v) {\n return Math.round(v * 100000) / 100000\n }\n\n return v => {\n v = Array.prototype.slice.call(v);\n for (let i = 0, len = v.length; i < len; i++) {\n v[i] = trunc(v[i]);\n }\n return v;\n };\n }))(),\n\n /**\n * Converts a 3-element vector from an array to an object of the form ````{x:999, y:999, z:999}````.\n * @param arr\n * @returns {{x: *, y: *, z: *}}\n */\n xyzArrayToObject(arr) {\n return {\"x\": arr[0], \"y\": arr[1], \"z\": arr[2]};\n },\n\n /**\n * Converts a 3-element vector object of the form ````{x:999, y:999, z:999}```` to an array.\n * @param xyz\n * @param [arry]\n * @returns {*[]}\n */\n xyzObjectToArray(xyz, arry) {\n arry = arry || new FloatArrayType(3);\n arry[0] = xyz.x;\n arry[1] = xyz.y;\n arry[2] = xyz.z;\n return arry;\n },\n\n /**\n * Duplicates a 4x4 identity matrix.\n * @method dupMat4\n * @static\n */\n dupMat4(m) {\n return m.slice(0, 16);\n },\n\n /**\n * Extracts a 3x3 matrix from a 4x4 matrix.\n * @method mat4To3\n * @static\n */\n mat4To3(m) {\n return [\n m[0], m[1], m[2],\n m[4], m[5], m[6],\n m[8], m[9], m[10]\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to the given scalar value.\n * @method m4s\n * @static\n */\n m4s(s) {\n return [\n s, s, s, s,\n s, s, s, s,\n s, s, s, s,\n s, s, s, s\n ];\n },\n\n /**\n * Returns a 4x4 matrix with each element set to zero.\n * @method setMat4ToZeroes\n * @static\n */\n setMat4ToZeroes() {\n return math.m4s(0.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n setMat4ToOnes() {\n return math.m4s(1.0);\n },\n\n /**\n * Returns a 4x4 matrix with each element set to 1.0.\n * @method setMat4ToOnes\n * @static\n */\n diagonalMat4v(v) {\n return new FloatArrayType([\n v[0], 0.0, 0.0, 0.0,\n 0.0, v[1], 0.0, 0.0,\n 0.0, 0.0, v[2], 0.0,\n 0.0, 0.0, 0.0, v[3]\n ]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given vector.\n * @method diagonalMat4c\n * @static\n */\n diagonalMat4c(x, y, z, w) {\n return math.diagonalMat4v([x, y, z, w]);\n },\n\n /**\n * Returns a 4x4 matrix with diagonal elements set to the given scalar.\n * @method diagonalMat4s\n * @static\n */\n diagonalMat4s(s) {\n return math.diagonalMat4c(s, s, s, s);\n },\n\n /**\n * Returns a 4x4 identity matrix.\n * @method identityMat4\n * @static\n */\n identityMat4(mat = new FloatArrayType(16)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n mat[3] = 0.0;\n\n mat[4] = 0.0;\n mat[5] = 1.0;\n mat[6] = 0.0;\n mat[7] = 0.0;\n\n mat[8] = 0.0;\n mat[9] = 0.0;\n mat[10] = 1.0;\n mat[11] = 0.0;\n\n mat[12] = 0.0;\n mat[13] = 0.0;\n mat[14] = 0.0;\n mat[15] = 1.0;\n\n return mat;\n },\n\n /**\n * Returns a 3x3 identity matrix.\n * @method identityMat3\n * @static\n */\n identityMat3(mat = new FloatArrayType(9)) {\n mat[0] = 1.0;\n mat[1] = 0.0;\n mat[2] = 0.0;\n\n mat[3] = 0.0;\n mat[4] = 1.0;\n mat[5] = 0.0;\n\n mat[6] = 0.0;\n mat[7] = 0.0;\n mat[8] = 1.0;\n\n return mat;\n },\n\n /**\n * Tests if the given 4x4 matrix is the identity matrix.\n * @method isIdentityMat4\n * @static\n */\n isIdentityMat4(m) {\n if (m[0] !== 1.0 || m[1] !== 0.0 || m[2] !== 0.0 || m[3] !== 0.0 ||\n m[4] !== 0.0 || m[5] !== 1.0 || m[6] !== 0.0 || m[7] !== 0.0 ||\n m[8] !== 0.0 || m[9] !== 0.0 || m[10] !== 1.0 || m[11] !== 0.0 ||\n m[12] !== 0.0 || m[13] !== 0.0 || m[14] !== 0.0 || m[15] !== 1.0) {\n return false;\n }\n return true;\n },\n\n /**\n * Negates the given 4x4 matrix.\n * @method negateMat4\n * @static\n */\n negateMat4(m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = -m[0];\n dest[1] = -m[1];\n dest[2] = -m[2];\n dest[3] = -m[3];\n dest[4] = -m[4];\n dest[5] = -m[5];\n dest[6] = -m[6];\n dest[7] = -m[7];\n dest[8] = -m[8];\n dest[9] = -m[9];\n dest[10] = -m[10];\n dest[11] = -m[11];\n dest[12] = -m[12];\n dest[13] = -m[13];\n dest[14] = -m[14];\n dest[15] = -m[15];\n return dest;\n },\n\n /**\n * Adds the given 4x4 matrices together.\n * @method addMat4\n * @static\n */\n addMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] + b[0];\n dest[1] = a[1] + b[1];\n dest[2] = a[2] + b[2];\n dest[3] = a[3] + b[3];\n dest[4] = a[4] + b[4];\n dest[5] = a[5] + b[5];\n dest[6] = a[6] + b[6];\n dest[7] = a[7] + b[7];\n dest[8] = a[8] + b[8];\n dest[9] = a[9] + b[9];\n dest[10] = a[10] + b[10];\n dest[11] = a[11] + b[11];\n dest[12] = a[12] + b[12];\n dest[13] = a[13] + b[13];\n dest[14] = a[14] + b[14];\n dest[15] = a[15] + b[15];\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addMat4Scalar\n * @static\n */\n addMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] + s;\n dest[1] = m[1] + s;\n dest[2] = m[2] + s;\n dest[3] = m[3] + s;\n dest[4] = m[4] + s;\n dest[5] = m[5] + s;\n dest[6] = m[6] + s;\n dest[7] = m[7] + s;\n dest[8] = m[8] + s;\n dest[9] = m[9] + s;\n dest[10] = m[10] + s;\n dest[11] = m[11] + s;\n dest[12] = m[12] + s;\n dest[13] = m[13] + s;\n dest[14] = m[14] + s;\n dest[15] = m[15] + s;\n return dest;\n },\n\n /**\n * Adds the given scalar to each element of the given 4x4 matrix.\n * @method addScalarMat4\n * @static\n */\n addScalarMat4(s, m, dest) {\n return math.addMat4Scalar(m, s, dest);\n },\n\n /**\n * Subtracts the second 4x4 matrix from the first.\n * @method subMat4\n * @static\n */\n subMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] - b[0];\n dest[1] = a[1] - b[1];\n dest[2] = a[2] - b[2];\n dest[3] = a[3] - b[3];\n dest[4] = a[4] - b[4];\n dest[5] = a[5] - b[5];\n dest[6] = a[6] - b[6];\n dest[7] = a[7] - b[7];\n dest[8] = a[8] - b[8];\n dest[9] = a[9] - b[9];\n dest[10] = a[10] - b[10];\n dest[11] = a[11] - b[11];\n dest[12] = a[12] - b[12];\n dest[13] = a[13] - b[13];\n dest[14] = a[14] - b[14];\n dest[15] = a[15] - b[15];\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subMat4Scalar\n * @static\n */\n subMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] - s;\n dest[1] = m[1] - s;\n dest[2] = m[2] - s;\n dest[3] = m[3] - s;\n dest[4] = m[4] - s;\n dest[5] = m[5] - s;\n dest[6] = m[6] - s;\n dest[7] = m[7] - s;\n dest[8] = m[8] - s;\n dest[9] = m[9] - s;\n dest[10] = m[10] - s;\n dest[11] = m[11] - s;\n dest[12] = m[12] - s;\n dest[13] = m[13] - s;\n dest[14] = m[14] - s;\n dest[15] = m[15] - s;\n return dest;\n },\n\n /**\n * Subtracts the given scalar from each element of the given 4x4 matrix.\n * @method subScalarMat4\n * @static\n */\n subScalarMat4(s, m, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = s - m[0];\n dest[1] = s - m[1];\n dest[2] = s - m[2];\n dest[3] = s - m[3];\n dest[4] = s - m[4];\n dest[5] = s - m[5];\n dest[6] = s - m[6];\n dest[7] = s - m[7];\n dest[8] = s - m[8];\n dest[9] = s - m[9];\n dest[10] = s - m[10];\n dest[11] = s - m[11];\n dest[12] = s - m[12];\n dest[13] = s - m[13];\n dest[14] = s - m[14];\n dest[15] = s - m[15];\n return dest;\n },\n\n /**\n * Multiplies the two given 4x4 matrix by each other.\n * @method mulMat4\n * @static\n */\n mulMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = a[0];\n\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[4];\n const b11 = b[5];\n const b12 = b[6];\n const b13 = b[7];\n const b20 = b[8];\n const b21 = b[9];\n const b22 = b[10];\n const b23 = b[11];\n const b30 = b[12];\n const b31 = b[13];\n const b32 = b[14];\n const b33 = b[15];\n\n dest[0] = b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30;\n dest[1] = b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31;\n dest[2] = b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32;\n dest[3] = b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33;\n dest[4] = b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30;\n dest[5] = b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31;\n dest[6] = b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32;\n dest[7] = b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33;\n dest[8] = b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30;\n dest[9] = b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31;\n dest[10] = b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32;\n dest[11] = b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33;\n dest[12] = b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30;\n dest[13] = b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31;\n dest[14] = b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32;\n dest[15] = b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33;\n\n return dest;\n },\n\n /**\n * Multiplies the two given 3x3 matrices by each other.\n * @method mulMat4\n * @static\n */\n mulMat3(a, b, dest) {\n if (!dest) {\n dest = new FloatArrayType(9);\n }\n\n const a11 = a[0];\n const a12 = a[3];\n const a13 = a[6];\n const a21 = a[1];\n const a22 = a[4];\n const a23 = a[7];\n const a31 = a[2];\n const a32 = a[5];\n const a33 = a[8];\n const b11 = b[0];\n const b12 = b[3];\n const b13 = b[6];\n const b21 = b[1];\n const b22 = b[4];\n const b23 = b[7];\n const b31 = b[2];\n const b32 = b[5];\n const b33 = b[8];\n\n dest[0] = a11 * b11 + a12 * b21 + a13 * b31;\n dest[3] = a11 * b12 + a12 * b22 + a13 * b32;\n dest[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\n dest[1] = a21 * b11 + a22 * b21 + a23 * b31;\n dest[4] = a21 * b12 + a22 * b22 + a23 * b32;\n dest[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\n dest[2] = a31 * b11 + a32 * b21 + a33 * b31;\n dest[5] = a31 * b12 + a32 * b22 + a33 * b32;\n dest[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\n return dest;\n },\n\n /**\n * Multiplies each element of the given 4x4 matrix by the given scalar.\n * @method mulMat4Scalar\n * @static\n */\n mulMat4Scalar(m, s, dest) {\n if (!dest) {\n dest = m;\n }\n dest[0] = m[0] * s;\n dest[1] = m[1] * s;\n dest[2] = m[2] * s;\n dest[3] = m[3] * s;\n dest[4] = m[4] * s;\n dest[5] = m[5] * s;\n dest[6] = m[6] * s;\n dest[7] = m[7] * s;\n dest[8] = m[8] * s;\n dest[9] = m[9] * s;\n dest[10] = m[10] * s;\n dest[11] = m[11] * s;\n dest[12] = m[12] * s;\n dest[13] = m[13] * s;\n dest[14] = m[14] * s;\n dest[15] = m[15] * s;\n return dest;\n },\n\n /**\n * Multiplies the given 4x4 matrix by the given four-element vector.\n * @method mulMat4v4\n * @static\n */\n mulMat4v4(m, v, dest = math.vec4()) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Transposes the given 4x4 matrix.\n * @method transposeMat4\n * @static\n */\n transposeMat4(mat, dest) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n const m4 = mat[4];\n\n const m14 = mat[14];\n const m8 = mat[8];\n const m13 = mat[13];\n const m12 = mat[12];\n const m9 = mat[9];\n if (!dest || mat === dest) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a12 = mat[6];\n const a13 = mat[7];\n const a23 = mat[11];\n mat[1] = m4;\n mat[2] = m8;\n mat[3] = m12;\n mat[4] = a01;\n mat[6] = m9;\n mat[7] = m13;\n mat[8] = a02;\n mat[9] = a12;\n mat[11] = m14;\n mat[12] = a03;\n mat[13] = a13;\n mat[14] = a23;\n return mat;\n }\n dest[0] = mat[0];\n dest[1] = m4;\n dest[2] = m8;\n dest[3] = m12;\n dest[4] = mat[1];\n dest[5] = mat[5];\n dest[6] = m9;\n dest[7] = m13;\n dest[8] = mat[2];\n dest[9] = mat[6];\n dest[10] = mat[10];\n dest[11] = m14;\n dest[12] = mat[3];\n dest[13] = mat[7];\n dest[14] = mat[11];\n dest[15] = mat[15];\n return dest;\n },\n\n /**\n * Transposes the given 3x3 matrix.\n *\n * @method transposeMat3\n * @static\n */\n transposeMat3(mat, dest) {\n if (dest === mat) {\n const a01 = mat[1];\n const a02 = mat[2];\n const a12 = mat[5];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = a01;\n dest[5] = mat[7];\n dest[6] = a02;\n dest[7] = a12;\n } else {\n dest[0] = mat[0];\n dest[1] = mat[3];\n dest[2] = mat[6];\n dest[3] = mat[1];\n dest[4] = mat[4];\n dest[5] = mat[7];\n dest[6] = mat[2];\n dest[7] = mat[5];\n dest[8] = mat[8];\n }\n return dest;\n },\n\n /**\n * Returns the determinant of the given 4x4 matrix.\n * @method determinantMat4\n * @static\n */\n determinantMat4(mat) {\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n return a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 +\n a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 +\n a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 +\n a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 +\n a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 +\n a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33;\n },\n\n /**\n * Returns the inverse of the given 4x4 matrix.\n * @method inverseMat4\n * @static\n */\n inverseMat4(mat, dest) {\n if (!dest) {\n dest = mat;\n }\n\n // Cache the matrix values (makes for huge speed increases!)\n const a00 = mat[0];\n\n const a01 = mat[1];\n const a02 = mat[2];\n const a03 = mat[3];\n const a10 = mat[4];\n const a11 = mat[5];\n const a12 = mat[6];\n const a13 = mat[7];\n const a20 = mat[8];\n const a21 = mat[9];\n const a22 = mat[10];\n const a23 = mat[11];\n const a30 = mat[12];\n const a31 = mat[13];\n const a32 = mat[14];\n const a33 = mat[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant (inlined to avoid double-caching)\n const invDet = 1 / (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06);\n\n dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;\n dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;\n dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;\n dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;\n dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;\n dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;\n dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;\n dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;\n dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;\n dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;\n dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;\n dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;\n dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;\n dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;\n dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;\n dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;\n\n return dest;\n },\n\n /**\n * Returns the trace of the given 4x4 matrix.\n * @method traceMat4\n * @static\n */\n traceMat4(m) {\n return (m[0] + m[5] + m[10] + m[15]);\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4\n * @static\n */\n translationMat4v(v, dest) {\n const m = dest || math.identityMat4();\n m[12] = v[0];\n m[13] = v[1];\n m[14] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 translation matrix.\n * @method translationMat3\n * @static\n */\n translationMat3v(v, dest) {\n const m = dest || math.identityMat3();\n m[6] = v[0];\n m[7] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4c\n * @static\n */\n translationMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.translationMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Returns 4x4 translation matrix.\n * @method translationMat4s\n * @static\n */\n translationMat4s(s, dest) {\n return math.translationMat4c(s, s, s, dest);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param v\n * @param m\n */\n translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n },\n\n /**\n * Efficiently post-concatenates a translation to the given matrix.\n * @param x\n * @param y\n * @param z\n * @param m\n */\n OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n },\n\n translateMat4c(x, y, z, m) {\n\n const m3 = m[3];\n m[0] += m3 * x;\n m[1] += m3 * y;\n m[2] += m3 * z;\n\n const m7 = m[7];\n m[4] += m7 * x;\n m[5] += m7 * y;\n m[6] += m7 * z;\n\n const m11 = m[11];\n m[8] += m11 * x;\n m[9] += m11 * y;\n m[10] += m11 * z;\n\n const m15 = m[15];\n m[12] += m15 * x;\n m[13] += m15 * y;\n m[14] += m15 * z;\n\n return m;\n },\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4v\n * @static\n */\n rotationMat4v(anglerad, axis, m) {\n const ax = math.normalizeVec4([axis[0], axis[1], axis[2], 0.0], []);\n const s = Math.sin(anglerad);\n const c = Math.cos(anglerad);\n const q = 1.0 - c;\n\n const x = ax[0];\n const y = ax[1];\n const z = ax[2];\n\n let xy;\n let yz;\n let zx;\n let xs;\n let ys;\n let zs;\n\n //xx = x * x; used once\n //yy = y * y; used once\n //zz = z * z; used once\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n m = m || math.mat4();\n\n m[0] = (q * x * x) + c;\n m[1] = (q * xy) + zs;\n m[2] = (q * zx) - ys;\n m[3] = 0.0;\n\n m[4] = (q * xy) - zs;\n m[5] = (q * y * y) + c;\n m[6] = (q * yz) + xs;\n m[7] = 0.0;\n\n m[8] = (q * zx) + ys;\n m[9] = (q * yz) - xs;\n m[10] = (q * z * z) + c;\n m[11] = 0.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n\n return m;\n },\n\n /**\n * Returns 4x4 rotation matrix.\n * @method rotationMat4c\n * @static\n */\n rotationMat4c(anglerad, x, y, z, mat) {\n return math.rotationMat4v(anglerad, [x, y, z], mat);\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4v\n * @static\n */\n scalingMat4v(v, m = math.identityMat4()) {\n m[0] = v[0];\n m[5] = v[1];\n m[10] = v[2];\n return m;\n },\n\n /**\n * Returns 3x3 scale matrix.\n * @method scalingMat3v\n * @static\n */\n scalingMat3v(v, m = math.identityMat3()) {\n m[0] = v[0];\n m[4] = v[1];\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4c\n * @static\n */\n scalingMat4c: ((() => {\n const xyz = new FloatArrayType(3);\n return (x, y, z, dest) => {\n xyz[0] = x;\n xyz[1] = y;\n xyz[2] = z;\n return math.scalingMat4v(xyz, dest);\n };\n }))(),\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param x\n * @param y\n * @param z\n * @param m\n */\n scaleMat4c(x, y, z, m) {\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n return m;\n },\n\n /**\n * Efficiently post-concatenates a scaling to the given matrix.\n * @method scaleMat4c\n * @param xyz\n * @param m\n */\n scaleMat4v(xyz, m) {\n\n const x = xyz[0];\n const y = xyz[1];\n const z = xyz[2];\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n\n return m;\n },\n\n /**\n * Returns 4x4 scale matrix.\n * @method scalingMat4s\n * @static\n */\n scalingMat4s(s) {\n return math.scalingMat4c(s, s, s);\n },\n\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n *\n * @param {Number[]} q Rotation quaternion\n * @param {Number[]} v Translation vector\n * @param {Number[]} dest Destination matrix\n * @returns {Number[]} dest\n */\n rotationTranslationMat4(q, v, dest = math.mat4()) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n dest[0] = 1 - (yy + zz);\n dest[1] = xy + wz;\n dest[2] = xz - wy;\n dest[3] = 0;\n dest[4] = xy - wz;\n dest[5] = 1 - (xx + zz);\n dest[6] = yz + wx;\n dest[7] = 0;\n dest[8] = xz + wy;\n dest[9] = yz - wx;\n dest[10] = 1 - (xx + yy);\n dest[11] = 0;\n dest[12] = v[0];\n dest[13] = v[1];\n dest[14] = v[2];\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Gets Euler angles from a 4x4 matrix.\n *\n * @param {Number[]} mat The 4x4 matrix.\n * @param {String} order Desired Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination Euler angles, created by default.\n * @returns {Number[]} The Euler angles.\n */\n mat4ToEuler(mat, order, dest = math.vec4()) {\n const clamp = math.clamp;\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = mat[0];\n\n const m12 = mat[4];\n const m13 = mat[8];\n const m21 = mat[1];\n const m22 = mat[5];\n const m23 = mat[9];\n const m31 = mat[2];\n const m32 = mat[6];\n const m33 = mat[10];\n\n if (order === 'XYZ') {\n\n dest[1] = Math.asin(clamp(m13, -1, 1));\n\n if (Math.abs(m13) < 0.99999) {\n dest[0] = Math.atan2(-m23, m33);\n dest[2] = Math.atan2(-m12, m11);\n } else {\n dest[0] = Math.atan2(m32, m22);\n dest[2] = 0;\n\n }\n\n } else if (order === 'YXZ') {\n\n dest[0] = Math.asin(-clamp(m23, -1, 1));\n\n if (Math.abs(m23) < 0.99999) {\n dest[1] = Math.atan2(m13, m33);\n dest[2] = Math.atan2(m21, m22);\n } else {\n dest[1] = Math.atan2(-m31, m11);\n dest[2] = 0;\n }\n\n } else if (order === 'ZXY') {\n\n dest[0] = Math.asin(clamp(m32, -1, 1));\n\n if (Math.abs(m32) < 0.99999) {\n dest[1] = Math.atan2(-m31, m33);\n dest[2] = Math.atan2(-m12, m22);\n } else {\n dest[1] = 0;\n dest[2] = Math.atan2(m21, m11);\n }\n\n } else if (order === 'ZYX') {\n\n dest[1] = Math.asin(-clamp(m31, -1, 1));\n\n if (Math.abs(m31) < 0.99999) {\n dest[0] = Math.atan2(m32, m33);\n dest[2] = Math.atan2(m21, m11);\n } else {\n dest[0] = 0;\n dest[2] = Math.atan2(-m12, m22);\n }\n\n } else if (order === 'YZX') {\n\n dest[2] = Math.asin(clamp(m21, -1, 1));\n\n if (Math.abs(m21) < 0.99999) {\n dest[0] = Math.atan2(-m23, m22);\n dest[1] = Math.atan2(-m31, m11);\n } else {\n dest[0] = 0;\n dest[1] = Math.atan2(m13, m33);\n }\n\n } else if (order === 'XZY') {\n\n dest[2] = Math.asin(-clamp(m12, -1, 1));\n\n if (Math.abs(m12) < 0.99999) {\n dest[0] = Math.atan2(m32, m22);\n dest[1] = Math.atan2(m13, m11);\n } else {\n dest[0] = Math.atan2(-m23, m33);\n dest[1] = 0;\n }\n }\n\n return dest;\n },\n\n composeMat4(position, quaternion, scale, mat = math.mat4()) {\n math.quaternionToRotationMat4(quaternion, mat);\n math.scaleMat4v(scale, mat);\n math.translateMat4v(position, mat);\n\n return mat;\n },\n\n decomposeMat4: (() => {\n\n const vec = new FloatArrayType(3);\n const matrix = new FloatArrayType(16);\n\n return function decompose(mat, position, quaternion, scale) {\n\n vec[0] = mat[0];\n vec[1] = mat[1];\n vec[2] = mat[2];\n\n let sx = math.lenVec3(vec);\n\n vec[0] = mat[4];\n vec[1] = mat[5];\n vec[2] = mat[6];\n\n const sy = math.lenVec3(vec);\n\n vec[8] = mat[8];\n vec[9] = mat[9];\n vec[10] = mat[10];\n\n const sz = math.lenVec3(vec);\n\n // if determine is negative, we need to invert one scale\n const det = math.determinantMat4(mat);\n\n if (det < 0) {\n sx = -sx;\n }\n\n position[0] = mat[12];\n position[1] = mat[13];\n position[2] = mat[14];\n\n // scale the rotation part\n matrix.set(mat);\n\n const invSX = 1 / sx;\n const invSY = 1 / sy;\n const invSZ = 1 / sz;\n\n matrix[0] *= invSX;\n matrix[1] *= invSX;\n matrix[2] *= invSX;\n\n matrix[4] *= invSY;\n matrix[5] *= invSY;\n matrix[6] *= invSY;\n\n matrix[8] *= invSZ;\n matrix[9] *= invSZ;\n matrix[10] *= invSZ;\n\n math.mat4ToQuaternion(matrix, quaternion);\n\n scale[0] = sx;\n scale[1] = sy;\n scale[2] = sz;\n\n return this;\n\n };\n\n })(),\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4v\n * @param pos vec3 position of the viewer\n * @param target vec3 point the viewer is looking at\n * @param up vec3 pointing \"up\"\n * @param dest mat4 Optional, mat4 matrix will be written into\n *\n * @return {mat4} dest if specified, a new mat4 otherwise\n */\n lookAtMat4v(pos, target, up, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n\n const posx = pos[0];\n const posy = pos[1];\n const posz = pos[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const targetx = target[0];\n const targety = target[1];\n const targetz = target[2];\n\n if (posx === targetx && posy === targety && posz === targetz) {\n return math.identityMat4();\n }\n\n let z0;\n let z1;\n let z2;\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let len;\n\n //vec3.direction(eye, center, z);\n z0 = posx - targetx;\n z1 = posy - targety;\n z2 = posz - targetz;\n\n // normalize (no check needed for 0 because of early return)\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n //vec3.normalize(vec3.cross(up, z, x));\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n //vec3.normalize(vec3.cross(z, x, y));\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n dest[0] = x0;\n dest[1] = y0;\n dest[2] = z0;\n dest[3] = 0;\n dest[4] = x1;\n dest[5] = y1;\n dest[6] = z1;\n dest[7] = 0;\n dest[8] = x2;\n dest[9] = y2;\n dest[10] = z2;\n dest[11] = 0;\n dest[12] = -(x0 * posx + x1 * posy + x2 * posz);\n dest[13] = -(y0 * posx + y1 * posy + y2 * posz);\n dest[14] = -(z0 * posx + z1 * posy + z2 * posz);\n dest[15] = 1;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 'lookat' viewing transform matrix.\n * @method lookAtMat4c\n * @static\n */\n lookAtMat4c(posx, posy, posz, targetx, targety, targetz, upx, upy, upz) {\n return math.lookAtMat4v([posx, posy, posz], [targetx, targety, targetz], [upx, upy, upz], []);\n },\n\n /**\n * Returns a 4x4 orthographic projection matrix.\n * @method orthoMat4c\n * @static\n */\n orthoMat4c(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n\n dest[0] = 2.0 / rl;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 0.0;\n\n dest[4] = 0.0;\n dest[5] = 2.0 / tb;\n dest[6] = 0.0;\n dest[7] = 0.0;\n\n dest[8] = 0.0;\n dest[9] = 0.0;\n dest[10] = -2.0 / fn;\n dest[11] = 0.0;\n\n dest[12] = -(left + right) / rl;\n dest[13] = -(top + bottom) / tb;\n dest[14] = -(far + near) / fn;\n dest[15] = 1.0;\n\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4v(fmin, fmax, m) {\n if (!m) {\n m = math.mat4();\n }\n\n const fmin4 = [fmin[0], fmin[1], fmin[2], 0.0];\n const fmax4 = [fmax[0], fmax[1], fmax[2], 0.0];\n\n math.addVec4(fmax4, fmin4, tempMat1);\n math.subVec4(fmax4, fmin4, tempMat2);\n\n const t = 2.0 * fmin4[2];\n\n const tempMat20 = tempMat2[0];\n const tempMat21 = tempMat2[1];\n const tempMat22 = tempMat2[2];\n\n m[0] = t / tempMat20;\n m[1] = 0.0;\n m[2] = 0.0;\n m[3] = 0.0;\n\n m[4] = 0.0;\n m[5] = t / tempMat21;\n m[6] = 0.0;\n m[7] = 0.0;\n\n m[8] = tempMat1[0] / tempMat20;\n m[9] = tempMat1[1] / tempMat21;\n m[10] = -tempMat1[2] / tempMat22;\n m[11] = -1.0;\n\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = -t * fmax4[2] / tempMat22;\n m[15] = 0.0;\n\n return m;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method frustumMat4v\n * @static\n */\n frustumMat4(left, right, bottom, top, near, far, dest) {\n if (!dest) {\n dest = math.mat4();\n }\n const rl = (right - left);\n const tb = (top - bottom);\n const fn = (far - near);\n dest[0] = (near * 2) / rl;\n dest[1] = 0;\n dest[2] = 0;\n dest[3] = 0;\n dest[4] = 0;\n dest[5] = (near * 2) / tb;\n dest[6] = 0;\n dest[7] = 0;\n dest[8] = (right + left) / rl;\n dest[9] = (top + bottom) / tb;\n dest[10] = -(far + near) / fn;\n dest[11] = -1;\n dest[12] = 0;\n dest[13] = 0;\n dest[14] = -(far * near * 2) / fn;\n dest[15] = 0;\n return dest;\n },\n\n /**\n * Returns a 4x4 perspective projection matrix.\n * @method perspectiveMat4v\n * @static\n */\n perspectiveMat4(fovyrad, aspectratio, znear, zfar, m) {\n const pmin = [];\n const pmax = [];\n\n pmin[2] = znear;\n pmax[2] = zfar;\n\n pmax[1] = pmin[2] * Math.tan(fovyrad / 2.0);\n pmin[1] = -pmax[1];\n\n pmax[0] = pmax[1] * aspectratio;\n pmin[0] = -pmax[0];\n\n return math.frustumMat4v(pmin, pmax, m);\n },\n\n /**\n * Transforms a three-element position by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint3(m, p, dest = math.vec3()) {\n\n const x = p[0];\n const y = p[1];\n const z = p[2];\n\n dest[0] = (m[0] * x) + (m[4] * y) + (m[8] * z) + m[12];\n dest[1] = (m[1] * x) + (m[5] * y) + (m[9] * z) + m[13];\n dest[2] = (m[2] * x) + (m[6] * y) + (m[10] * z) + m[14];\n\n return dest;\n },\n\n /**\n * Transforms a homogeneous coordinate by a 4x4 matrix.\n * @method transformPoint3\n * @static\n */\n transformPoint4(m, v, dest = math.vec4()) {\n dest[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];\n dest[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];\n dest[2] = m[2] * v[0] + m[6] * v[1] + m[10] * v[2] + m[14] * v[3];\n dest[3] = m[3] * v[0] + m[7] * v[1] + m[11] * v[2] + m[15] * v[3];\n\n return dest;\n },\n\n\n /**\n * Transforms an array of three-element positions by a 4x4 matrix.\n * @method transformPoints3\n * @static\n */\n transformPoints3(m, points, points2) {\n const result = points2 || [];\n const len = points.length;\n let p0;\n let p1;\n let p2;\n let pi;\n\n // cache values\n const m0 = m[0];\n\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n let r;\n\n for (let i = 0; i < len; ++i) {\n\n // cache values\n pi = points[i];\n\n p0 = pi[0];\n p1 = pi[1];\n p2 = pi[2];\n\n r = result[i] || (result[i] = [0, 0, 0]);\n\n r[0] = (m0 * p0) + (m4 * p1) + (m8 * p2) + m12;\n r[1] = (m1 * p0) + (m5 * p1) + (m9 * p2) + m13;\n r[2] = (m2 * p0) + (m6 * p1) + (m10 * p2) + m14;\n r[3] = (m3 * p0) + (m7 * p1) + (m11 * p2) + m15;\n }\n\n result.length = len;\n\n return result;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions3\n * @static\n */\n transformPositions3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 3) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms an array of positions by a 4x4 matrix.\n * @method transformPositions4\n * @static\n */\n transformPositions4(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /**\n * Transforms a three-element vector by a 4x4 matrix.\n * @method transformVec3\n * @static\n */\n transformVec3(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n dest = dest || this.vec3();\n dest[0] = (m[0] * v0) + (m[4] * v1) + (m[8] * v2);\n dest[1] = (m[1] * v0) + (m[5] * v1) + (m[9] * v2);\n dest[2] = (m[2] * v0) + (m[6] * v1) + (m[10] * v2);\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 matrix.\n * @method transformVec4\n * @static\n */\n transformVec4(m, v, dest) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n dest = dest || math.vec4();\n dest[0] = m[0] * v0 + m[4] * v1 + m[8] * v2 + m[12] * v3;\n dest[1] = m[1] * v0 + m[5] * v1 + m[9] * v2 + m[13] * v3;\n dest[2] = m[2] * v0 + m[6] * v1 + m[10] * v2 + m[14] * v3;\n dest[3] = m[3] * v0 + m[7] * v1 + m[11] * v2 + m[15] * v3;\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the x-axis\n *\n * @method rotateVec3X\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3X(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);\n r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the y-axis\n *\n * @method rotateVec3Y\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Y(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c);\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Rotate a 3D vector around the z-axis\n *\n * @method rotateVec3Z\n * @param {Number[]} a The vec3 point to rotate\n * @param {Number[]} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @param {Number[]} dest The receiving vec3\n * @returns {Number[]} dest\n * @static\n */\n rotateVec3Z(a, b, c, dest) {\n const p = [];\n const r = [];\n\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);\n r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);\n r[2] = p[2];\n\n //translate to correct position\n dest[0] = r[0] + b[0];\n dest[1] = r[1] + b[1];\n dest[2] = r[2] + b[2];\n\n return dest;\n },\n\n /**\n * Transforms a four-element vector by a 4x4 projection matrix.\n *\n * @method projectVec4\n * @param {Number[]} p 3D View-space coordinate\n * @param {Number[]} q 2D Projected coordinate\n * @returns {Number[]} 2D Projected coordinate\n * @static\n */\n projectVec4(p, q) {\n const f = 1.0 / p[3];\n q = q || math.vec2();\n q[0] = v[0] * f;\n q[1] = v[1] * f;\n return q;\n },\n\n /**\n * Unprojects a three-element vector.\n *\n * @method unprojectVec3\n * @param {Number[]} p 3D Projected coordinate\n * @param {Number[]} viewMat View matrix\n * @returns {Number[]} projMat Projection matrix\n * @static\n */\n unprojectVec3: ((() => {\n const mat = new FloatArrayType(16);\n const mat2 = new FloatArrayType(16);\n const mat3 = new FloatArrayType(16);\n return function (p, viewMat, projMat, q) {\n return this.transformVec3(this.mulMat4(this.inverseMat4(viewMat, mat), this.inverseMat4(projMat, mat2), mat3), p, q)\n };\n }))(),\n\n /**\n * Linearly interpolates between two 3D vectors.\n * @method lerpVec3\n * @static\n */\n lerpVec3(t, t1, t2, p1, p2, dest) {\n const result = dest || math.vec3();\n const f = (t - t1) / (t2 - t1);\n result[0] = p1[0] + (f * (p2[0] - p1[0]));\n result[1] = p1[1] + (f * (p2[1] - p1[1]));\n result[2] = p1[2] + (f * (p2[2] - p1[2]));\n return result;\n },\n\n\n /**\n * Flattens a two-dimensional array into a one-dimensional array.\n *\n * @method flatten\n * @static\n * @param {Array of Arrays} a A 2D array\n * @returns Flattened 1D array\n */\n flatten(a) {\n\n const result = [];\n\n let i;\n let leni;\n let j;\n let lenj;\n let item;\n\n for (i = 0, leni = a.length; i < leni; i++) {\n item = a[i];\n for (j = 0, lenj = item.length; j < lenj; j++) {\n result.push(item[j]);\n }\n }\n\n return result;\n },\n\n\n identityQuaternion(dest = math.vec4()) {\n dest[0] = 0.0;\n dest[1] = 0.0;\n dest[2] = 0.0;\n dest[3] = 1.0;\n return dest;\n },\n\n /**\n * Initializes a quaternion from Euler angles.\n *\n * @param {Number[]} euler The Euler angles.\n * @param {String} order Euler angle order: \"XYZ\", \"YXZ\", \"ZXY\" etc.\n * @param {Number[]} [dest] Destination quaternion, created by default.\n * @returns {Number[]} The quaternion.\n */\n eulerToQuaternion(euler, order, dest = math.vec4()) {\n // http://www.mathworks.com/matlabcentral/fileexchange/\n // \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n //\tcontent/SpinCalc.m\n\n const a = (euler[0] * math.DEGTORAD) / 2;\n const b = (euler[1] * math.DEGTORAD) / 2;\n const c = (euler[2] * math.DEGTORAD) / 2;\n\n const c1 = Math.cos(a);\n const c2 = Math.cos(b);\n const c3 = Math.cos(c);\n const s1 = Math.sin(a);\n const s2 = Math.sin(b);\n const s3 = Math.sin(c);\n\n if (order === 'XYZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'YXZ') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'ZXY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'ZYX') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n\n } else if (order === 'YZX') {\n\n dest[0] = s1 * c2 * c3 + c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 + s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 - s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 - s1 * s2 * s3;\n\n } else if (order === 'XZY') {\n\n dest[0] = s1 * c2 * c3 - c1 * s2 * s3;\n dest[1] = c1 * s2 * c3 - s1 * c2 * s3;\n dest[2] = c1 * c2 * s3 + s1 * s2 * c3;\n dest[3] = c1 * c2 * c3 + s1 * s2 * s3;\n }\n\n return dest;\n },\n\n mat4ToQuaternion(m, dest = math.vec4()) {\n // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n // Assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n const m11 = m[0];\n const m12 = m[4];\n const m13 = m[8];\n const m21 = m[1];\n const m22 = m[5];\n const m23 = m[9];\n const m31 = m[2];\n const m32 = m[6];\n const m33 = m[10];\n let s;\n\n const trace = m11 + m22 + m33;\n\n if (trace > 0) {\n\n s = 0.5 / Math.sqrt(trace + 1.0);\n\n dest[3] = 0.25 / s;\n dest[0] = (m32 - m23) * s;\n dest[1] = (m13 - m31) * s;\n dest[2] = (m21 - m12) * s;\n\n } else if (m11 > m22 && m11 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n dest[3] = (m32 - m23) / s;\n dest[0] = 0.25 * s;\n dest[1] = (m12 + m21) / s;\n dest[2] = (m13 + m31) / s;\n\n } else if (m22 > m33) {\n\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n dest[3] = (m13 - m31) / s;\n dest[0] = (m12 + m21) / s;\n dest[1] = 0.25 * s;\n dest[2] = (m23 + m32) / s;\n\n } else {\n\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n dest[3] = (m21 - m12) / s;\n dest[0] = (m13 + m31) / s;\n dest[1] = (m23 + m32) / s;\n dest[2] = 0.25 * s;\n }\n\n return dest;\n },\n\n vec3PairToQuaternion(u, v, dest = math.vec4()) {\n const norm_u_norm_v = Math.sqrt(math.dotVec3(u, u) * math.dotVec3(v, v));\n let real_part = norm_u_norm_v + math.dotVec3(u, v);\n\n if (real_part < 0.00000001 * norm_u_norm_v) {\n\n // If u and v are exactly opposite, rotate 180 degrees\n // around an arbitrary orthogonal axis. Axis normalisation\n // can happen later, when we normalise the quaternion.\n\n real_part = 0.0;\n\n if (Math.abs(u[0]) > Math.abs(u[2])) {\n\n dest[0] = -u[1];\n dest[1] = u[0];\n dest[2] = 0;\n\n } else {\n dest[0] = 0;\n dest[1] = -u[2];\n dest[2] = u[1]\n }\n\n } else {\n\n // Otherwise, build quaternion the standard way.\n math.cross3Vec3(u, v, dest);\n }\n\n dest[3] = real_part;\n\n return math.normalizeQuaternion(dest);\n },\n\n angleAxisToQuaternion(angleAxis, dest = math.vec4()) {\n const halfAngle = angleAxis[3] / 2.0;\n const fsin = Math.sin(halfAngle);\n dest[0] = fsin * angleAxis[0];\n dest[1] = fsin * angleAxis[1];\n dest[2] = fsin * angleAxis[2];\n dest[3] = Math.cos(halfAngle);\n return dest;\n },\n\n quaternionToEuler: ((() => {\n const mat = new FloatArrayType(16);\n return (q, order, dest) => {\n dest = dest || math.vec3();\n math.quaternionToRotationMat4(q, mat);\n math.mat4ToEuler(mat, order, dest);\n return dest;\n };\n }))(),\n\n mulQuaternions(p, q, dest = math.vec4()) {\n const p0 = p[0];\n const p1 = p[1];\n const p2 = p[2];\n const p3 = p[3];\n const q0 = q[0];\n const q1 = q[1];\n const q2 = q[2];\n const q3 = q[3];\n dest[0] = p3 * q0 + p0 * q3 + p1 * q2 - p2 * q1;\n dest[1] = p3 * q1 + p1 * q3 + p2 * q0 - p0 * q2;\n dest[2] = p3 * q2 + p2 * q3 + p0 * q1 - p1 * q0;\n dest[3] = p3 * q3 - p0 * q0 - p1 * q1 - p2 * q2;\n return dest;\n },\n\n vec3ApplyQuaternion(q, vec, dest = math.vec3()) {\n const x = vec[0];\n const y = vec[1];\n const z = vec[2];\n\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n\n // calculate quat * vector\n\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n\n dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return dest;\n },\n\n quaternionToMat4(q, dest) {\n\n dest = math.identityMat4(dest);\n\n const q0 = q[0]; //x\n const q1 = q[1]; //y\n const q2 = q[2]; //z\n const q3 = q[3]; //w\n\n const tx = 2.0 * q0;\n const ty = 2.0 * q1;\n const tz = 2.0 * q2;\n\n const twx = tx * q3;\n const twy = ty * q3;\n const twz = tz * q3;\n\n const txx = tx * q0;\n const txy = ty * q0;\n const txz = tz * q0;\n\n const tyy = ty * q1;\n const tyz = tz * q1;\n const tzz = tz * q2;\n\n dest[0] = 1.0 - (tyy + tzz);\n dest[1] = txy + twz;\n dest[2] = txz - twy;\n\n dest[4] = txy - twz;\n dest[5] = 1.0 - (txx + tzz);\n dest[6] = tyz + twx;\n\n dest[8] = txz + twy;\n dest[9] = tyz - twx;\n\n dest[10] = 1.0 - (txx + tyy);\n\n return dest;\n },\n\n quaternionToRotationMat4(q, m) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n m[0] = 1 - (yy + zz);\n m[4] = xy - wz;\n m[8] = xz + wy;\n\n m[1] = xy + wz;\n m[5] = 1 - (xx + zz);\n m[9] = yz - wx;\n\n m[2] = xz - wy;\n m[6] = yz + wx;\n m[10] = 1 - (xx + yy);\n\n // last column\n m[3] = 0;\n m[7] = 0;\n m[11] = 0;\n\n // bottom row\n m[12] = 0;\n m[13] = 0;\n m[14] = 0;\n m[15] = 1;\n\n return m;\n },\n\n normalizeQuaternion(q, dest = q) {\n const len = math.lenVec4([q[0], q[1], q[2], q[3]]);\n dest[0] = q[0] / len;\n dest[1] = q[1] / len;\n dest[2] = q[2] / len;\n dest[3] = q[3] / len;\n return dest;\n },\n\n conjugateQuaternion(q, dest = q) {\n dest[0] = -q[0];\n dest[1] = -q[1];\n dest[2] = -q[2];\n dest[3] = q[3];\n return dest;\n },\n\n inverseQuaternion(q, dest) {\n return math.normalizeQuaternion(math.conjugateQuaternion(q, dest));\n },\n\n quaternionToAngleAxis(q, angleAxis = math.vec4()) {\n q = math.normalizeQuaternion(q, tempVec4);\n const q3 = q[3];\n const angle = 2 * Math.acos(q3);\n const s = Math.sqrt(1 - q3 * q3);\n if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt\n angleAxis[0] = q[0];\n angleAxis[1] = q[1];\n angleAxis[2] = q[2];\n } else {\n angleAxis[0] = q[0] / s;\n angleAxis[1] = q[1] / s;\n angleAxis[2] = q[2] / s;\n }\n angleAxis[3] = angle; // * 57.295779579;\n return angleAxis;\n },\n\n //------------------------------------------------------------------------------------------------------------------\n // Boundaries\n //------------------------------------------------------------------------------------------------------------------\n\n /**\n * Returns a new, uninitialized 3D axis-aligned bounding box.\n *\n * @private\n */\n AABB3(values) {\n return new FloatArrayType(values || 6);\n },\n\n /**\n * Returns a new, uninitialized 2D axis-aligned bounding box.\n *\n * @private\n */\n AABB2(values) {\n return new FloatArrayType(values || 4);\n },\n\n /**\n * Returns a new, uninitialized 3D oriented bounding box (OBB).\n *\n * @private\n */\n OBB3(values) {\n return new FloatArrayType(values || 32);\n },\n\n /**\n * Returns a new, uninitialized 2D oriented bounding box (OBB).\n *\n * @private\n */\n OBB2(values) {\n return new FloatArrayType(values || 16);\n },\n\n /** Returns a new 3D bounding sphere */\n Sphere3(x, y, z, r) {\n return new FloatArrayType([x, y, z, r]);\n },\n\n /**\n * Transforms an OBB3 by a 4x4 matrix.\n *\n * @private\n */\n transformOBB3(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6];\n const m7 = m[7];\n const m8 = m[8];\n const m9 = m[9];\n const m10 = m[10];\n const m11 = m[11];\n const m12 = m[12];\n const m13 = m[13];\n const m14 = m[14];\n const m15 = m[15];\n\n for (i = 0; i < len; i += 4) {\n\n x = p[i + 0];\n y = p[i + 1];\n z = p[i + 2];\n\n p2[i + 0] = (m0 * x) + (m4 * y) + (m8 * z) + m12;\n p2[i + 1] = (m1 * x) + (m5 * y) + (m9 * z) + m13;\n p2[i + 2] = (m2 * x) + (m6 * y) + (m10 * z) + m14;\n p2[i + 3] = (m3 * x) + (m7 * y) + (m11 * z) + m15;\n }\n\n return p2;\n },\n\n /** Returns true if the first AABB contains the second AABB.\n * @param aabb1\n * @param aabb2\n * @returns {boolean}\n */\n containsAABB3: function (aabb1, aabb2) {\n const result = (\n aabb1[0] <= aabb2[0] && aabb2[3] <= aabb1[3] &&\n aabb1[1] <= aabb2[1] && aabb2[4] <= aabb1[4] &&\n aabb1[2] <= aabb2[2] && aabb2[5] <= aabb1[5]);\n return result;\n },\n\n /**\n * Gets the diagonal size of an AABB3 given as minima and maxima.\n *\n * @private\n */\n getAABB3Diag: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return aabb => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n math.subVec3(max, min, tempVec3);\n\n return Math.abs(math.lenVec3(tempVec3));\n };\n }))(),\n\n /**\n * Get a diagonal boundary size that is symmetrical about the given point.\n *\n * @private\n */\n getAABB3DiagPoint: ((() => {\n\n const min = new FloatArrayType(3);\n const max = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (aabb, p) => {\n\n min[0] = aabb[0];\n min[1] = aabb[1];\n min[2] = aabb[2];\n\n max[0] = aabb[3];\n max[1] = aabb[4];\n max[2] = aabb[5];\n\n const diagVec = math.subVec3(max, min, tempVec3);\n\n const xneg = p[0] - aabb[0];\n const xpos = aabb[3] - p[0];\n const yneg = p[1] - aabb[1];\n const ypos = aabb[4] - p[1];\n const zneg = p[2] - aabb[2];\n const zpos = aabb[5] - p[2];\n\n diagVec[0] += (xneg > xpos) ? xneg : xpos;\n diagVec[1] += (yneg > ypos) ? yneg : ypos;\n diagVec[2] += (zneg > zpos) ? zneg : zpos;\n\n return Math.abs(math.lenVec3(diagVec));\n };\n }))(),\n\n /**\n * Gets the center of an AABB.\n *\n * @private\n */\n getAABB3Center(aabb, dest) {\n const r = dest || math.vec3();\n\n r[0] = (aabb[0] + aabb[3]) / 2;\n r[1] = (aabb[1] + aabb[4]) / 2;\n r[2] = (aabb[2] + aabb[5]) / 2;\n\n return r;\n },\n\n /**\n * Gets the center of a 2D AABB.\n *\n * @private\n */\n getAABB2Center(aabb, dest) {\n const r = dest || math.vec2();\n\n r[0] = (aabb[2] + aabb[0]) / 2;\n r[1] = (aabb[3] + aabb[1]) / 2;\n\n return r;\n },\n\n /**\n * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points.\n * Creates new AABB if none supplied.\n *\n * @private\n */\n collapseAABB3(aabb = math.AABB3()) {\n aabb[0] = math.MAX_DOUBLE;\n aabb[1] = math.MAX_DOUBLE;\n aabb[2] = math.MAX_DOUBLE;\n aabb[3] = -math.MAX_DOUBLE;\n aabb[4] = -math.MAX_DOUBLE;\n aabb[5] = -math.MAX_DOUBLE;\n\n return aabb;\n },\n\n /**\n * Converts an axis-aligned 3D boundary into an oriented boundary consisting of\n * an array of eight 3D positions, one for each corner of the boundary.\n *\n * @private\n */\n AABB3ToOBB3(aabb, obb = math.OBB3()) {\n obb[0] = aabb[0];\n obb[1] = aabb[1];\n obb[2] = aabb[2];\n obb[3] = 1;\n\n obb[4] = aabb[3];\n obb[5] = aabb[1];\n obb[6] = aabb[2];\n obb[7] = 1;\n\n obb[8] = aabb[3];\n obb[9] = aabb[4];\n obb[10] = aabb[2];\n obb[11] = 1;\n\n obb[12] = aabb[0];\n obb[13] = aabb[4];\n obb[14] = aabb[2];\n obb[15] = 1;\n\n obb[16] = aabb[0];\n obb[17] = aabb[1];\n obb[18] = aabb[5];\n obb[19] = 1;\n\n obb[20] = aabb[3];\n obb[21] = aabb[1];\n obb[22] = aabb[5];\n obb[23] = 1;\n\n obb[24] = aabb[3];\n obb[25] = aabb[4];\n obb[26] = aabb[5];\n obb[27] = 1;\n\n obb[28] = aabb[0];\n obb[29] = aabb[4];\n obb[30] = aabb[5];\n obb[31] = 1;\n\n return obb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n positions3ToAABB3: ((() => {\n\n const p = new FloatArrayType(3);\n\n return (positions, aabb, positionsDecodeMatrix) => {\n aabb = aabb || math.AABB3();\n\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = positions.length; i < len; i += 3) {\n\n if (positionsDecodeMatrix) {\n\n p[0] = positions[i + 0];\n p[1] = positions[i + 1];\n p[2] = positions[i + 2];\n\n math.decompressPosition(p, positionsDecodeMatrix, p);\n\n x = p[0];\n y = p[1];\n z = p[2];\n\n } else {\n x = positions[i + 0];\n y = positions[i + 1];\n z = positions[i + 2];\n }\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n };\n }))(),\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the homogeneous 3D points (x,y,z,w) given in a flattened array.\n *\n * @private\n */\n OBB3ToAABB3(obb, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = obb.length; i < len; i += 4) {\n\n x = obb[i + 0];\n y = obb[i + 1];\n z = obb[i + 2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum axis-aligned 3D boundary enclosing the given 3D points.\n *\n * @private\n */\n points3ToAABB3(points, aabb = math.AABB3()) {\n let xmin = math.MAX_DOUBLE;\n let ymin = math.MAX_DOUBLE;\n let zmin = math.MAX_DOUBLE;\n let xmax = -math.MAX_DOUBLE;\n let ymax = -math.MAX_DOUBLE;\n let zmax = -math.MAX_DOUBLE;\n\n let x;\n let y;\n let z;\n\n for (let i = 0, len = points.length; i < len; i++) {\n\n x = points[i][0];\n y = points[i][1];\n z = points[i][2];\n\n if (x < xmin) {\n xmin = x;\n }\n\n if (y < ymin) {\n ymin = y;\n }\n\n if (z < zmin) {\n zmin = z;\n }\n\n if (x > xmax) {\n xmax = x;\n }\n\n if (y > ymax) {\n ymax = y;\n }\n\n if (z > zmax) {\n zmax = z;\n }\n }\n\n aabb[0] = xmin;\n aabb[1] = ymin;\n aabb[2] = zmin;\n aabb[3] = xmax;\n aabb[4] = ymax;\n aabb[5] = zmax;\n\n return aabb;\n },\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n points3ToSphere3: ((() => {\n\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const numPoints = points.length;\n\n for (i = 0; i < numPoints; i++) {\n x += points[i][0];\n y += points[i][1];\n z += points[i][2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < numPoints; i++) {\n\n dist = Math.abs(math.lenVec3(math.subVec3(points[i], sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D positions.\n *\n * @private\n */\n positions3ToSphere3: ((() => {\n\n const tempVec3a = new FloatArrayType(3);\n const tempVec3b = new FloatArrayType(3);\n\n return (positions, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPositions = positions.length;\n let radius = 0;\n\n for (i = 0; i < lenPositions; i += 3) {\n x += positions[i];\n y += positions[i + 1];\n z += positions[i + 2];\n }\n\n const numPositions = lenPositions / 3;\n\n sphere[0] = x / numPositions;\n sphere[1] = y / numPositions;\n sphere[2] = z / numPositions;\n\n let dist;\n\n for (i = 0; i < lenPositions; i += 3) {\n\n tempVec3a[0] = positions[i];\n tempVec3a[1] = positions[i + 1];\n tempVec3a[2] = positions[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(tempVec3a, sphere, tempVec3b)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Finds the minimum boundary sphere enclosing the given 3D points.\n *\n * @private\n */\n OBB3ToSphere3: ((() => {\n\n const point = new FloatArrayType(3);\n const tempVec3 = new FloatArrayType(3);\n\n return (points, sphere) => {\n\n sphere = sphere || math.vec4();\n\n let x = 0;\n let y = 0;\n let z = 0;\n\n let i;\n const lenPoints = points.length;\n const numPoints = lenPoints / 4;\n\n for (i = 0; i < lenPoints; i += 4) {\n x += points[i + 0];\n y += points[i + 1];\n z += points[i + 2];\n }\n\n sphere[0] = x / numPoints;\n sphere[1] = y / numPoints;\n sphere[2] = z / numPoints;\n\n let radius = 0;\n let dist;\n\n for (i = 0; i < lenPoints; i += 4) {\n\n point[0] = points[i + 0];\n point[1] = points[i + 1];\n point[2] = points[i + 2];\n\n dist = Math.abs(math.lenVec3(math.subVec3(point, sphere, tempVec3)));\n\n if (dist > radius) {\n radius = dist;\n }\n }\n\n sphere[3] = radius;\n\n return sphere;\n };\n }))(),\n\n /**\n * Gets the center of a bounding sphere.\n *\n * @private\n */\n getSphere3Center(sphere, dest = math.vec3()) {\n dest[0] = sphere[0];\n dest[1] = sphere[1];\n dest[2] = sphere[2];\n\n return dest;\n },\n\n /**\n * Expands the first axis-aligned 3D boundary to enclose the second, if required.\n *\n * @private\n */\n expandAABB3(aabb1, aabb2) {\n\n if (aabb1[0] > aabb2[0]) {\n aabb1[0] = aabb2[0];\n }\n\n if (aabb1[1] > aabb2[1]) {\n aabb1[1] = aabb2[1];\n }\n\n if (aabb1[2] > aabb2[2]) {\n aabb1[2] = aabb2[2];\n }\n\n if (aabb1[3] < aabb2[3]) {\n aabb1[3] = aabb2[3];\n }\n\n if (aabb1[4] < aabb2[4]) {\n aabb1[4] = aabb2[4];\n }\n\n if (aabb1[5] < aabb2[5]) {\n aabb1[5] = aabb2[5];\n }\n\n return aabb1;\n },\n\n /**\n * Expands an axis-aligned 3D boundary to enclose the given point, if needed.\n *\n * @private\n */\n expandAABB3Point3(aabb, p) {\n\n if (aabb[0] > p[0]) {\n aabb[0] = p[0];\n }\n\n if (aabb[1] > p[1]) {\n aabb[1] = p[1];\n }\n\n if (aabb[2] > p[2]) {\n aabb[2] = p[2];\n }\n\n if (aabb[3] < p[0]) {\n aabb[3] = p[0];\n }\n\n if (aabb[4] < p[1]) {\n aabb[4] = p[1];\n }\n\n if (aabb[5] < p[2]) {\n aabb[5] = p[2];\n }\n\n return aabb;\n },\n\n /**\n * Calculates the normal vector of a triangle.\n *\n * @private\n */\n triangleNormal(a, b, c, normal = math.vec3()) {\n const p1x = b[0] - a[0];\n const p1y = b[1] - a[1];\n const p1z = b[2] - a[2];\n\n const p2x = c[0] - a[0];\n const p2y = c[1] - a[1];\n const p2z = c[2] - a[2];\n\n const p3x = p1y * p2z - p1z * p2y;\n const p3y = p1z * p2x - p1x * p2z;\n const p3z = p1x * p2y - p1y * p2x;\n\n const mag = Math.sqrt(p3x * p3x + p3y * p3y + p3z * p3z);\n if (mag === 0) {\n normal[0] = 0;\n normal[1] = 0;\n normal[2] = 0;\n } else {\n normal[0] = p3x / mag;\n normal[1] = p3y / mag;\n normal[2] = p3z / mag;\n }\n\n return normal\n }\n};\n\nexport {math};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/math.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/math.js", "access": "public", "description": null, "lineNumber": 1 @@ -10899,7 +10899,7 @@ "name": "src/lib/mergeVertices.js", "content": "/**\n * Given geometry defined as an array of positions, optional normals, option uv and an array of indices, returns\n * modified arrays that have duplicate vertices removed.\n *\n * @private\n */\nfunction mergeVertices(positions, indices, mergedPositions, mergedIndices) {\n const positionsMap = {};\n const indicesLookup = [];\n const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n const precision = 10 ** precisionPoints;\n let uvi = 0;\n for (let i = 0, len = positions.length; i < len; i += 3) {\n const vx = positions[i];\n const vy = positions[i + 1];\n const vz = positions[i + 2];\n const key = `${Math.round(vx * precision)}_${Math.round(vy * precision)}_${Math.round(vz * precision)}`;\n if (positionsMap[key] === undefined) {\n positionsMap[key] = mergedPositions.length / 3;\n mergedPositions.push(vx);\n mergedPositions.push(vy);\n mergedPositions.push(vz);\n }\n indicesLookup[i / 3] = positionsMap[key];\n uvi += 2;\n }\n for (let i = 0, len = indices.length; i < len; i++) {\n mergedIndices[i] = indicesLookup[indices[i]];\n }\n}\n\nexport {mergeVertices};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/lib/mergeVertices.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/lib/mergeVertices.js", "access": "public", "description": null, "lineNumber": 1 @@ -10954,7 +10954,7 @@ "name": "src/parsers/parseCityJSONIntoXKTModel.js", "content": "import {earcut} from './../lib/earcut';\nimport {math} from \"./../lib/math.js\";\n\nconst tempVec2a = math.vec2();\nconst tempVec3a = math.vec3();\nconst tempVec3b = math.vec3();\nconst tempVec3c = math.vec3();\n\n/**\n * @desc Parses a CityJSON model into an {@link XKTModel}.\n *\n * [CityJSON](https://www.cityjson.org) is a JSON-based encoding for a subset of the CityGML data model (version 2.0.0),\n * which is an open standardised data model and exchange format to store digital 3D models of cities and\n * landscapes. CityGML is an official standard of the [Open Geospatial Consortium](https://www.ogc.org/).\n *\n * This converter function supports most of the [CityJSON 1.0.2 Specification](https://www.cityjson.org/specs/1.0.2),\n * with the following limitations:\n *\n * * Does not (yet) support CityJSON semantics for geometry primitives.\n * * Does not (yet) support textured geometries.\n * * Does not (yet) support geometry templates.\n * * When the CityJSON file provides multiple *themes* for a geometry, then we parse only the first of the provided themes for that geometry.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a CityJSON model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/cityjson/DenHaag.json\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseCityJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.data CityJSON data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the CityJSON vertex positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform CityJSON vertex positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when CityJSON has been parsed.\n */\nfunction parseCityJSONIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n stats = {}, log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (data.type !== \"CityJSON\") {\n reject(\"Invalid argument: data is not a CityJSON file\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n let vertices;\n\n log(\"Using parser: parseCityJSONIntoXKTModel\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n\n if (data.transform || center || transform) {\n vertices = copyVertices(data.vertices);\n if (data.transform) {\n transformVertices(vertices, data.transform)\n }\n if (center) {\n centerVertices(vertices);\n }\n if (transform) {\n customTransformVertices(vertices, transform);\n }\n } else {\n vertices = data.vertices;\n }\n\n stats.sourceFormat = data.type || \"\";\n stats.schemaVersion = data.version || \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n stats.numMetaObjects++;\n\n const modelMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: modelMetaObjectId,\n metaObjectType: \"CityJSON\",\n metaObjectName: \"CityJSON\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n stats.numMetaObjects++;\n\n const ctx = {\n data,\n vertices,\n xktModel,\n rootMetaObjectId: modelMetaObjectId,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n ctx.xktModel.schema = data.type + \" \" + data.version;\n\n ctx.log(\"Converting \" + ctx.xktModel.schema);\n\n parseCityJSON(ctx);\n\n resolve();\n });\n}\n\nfunction copyVertices(vertices) {\n const vertices2 = [];\n for (let i = 0, j = 0; i < vertices.length; i++, j += 3) {\n const x = vertices[i][0];\n const y = vertices[i][1];\n const z = vertices[i][2];\n vertices2.push([x, y, z]);\n }\n return vertices2;\n}\n\nfunction transformVertices(vertices, cityJSONTransform) {\n const scale = cityJSONTransform.scale || math.vec3([1, 1, 1]);\n const translate = cityJSONTransform.translate || math.vec3([0, 0, 0]);\n for (let i = 0; i < vertices.length; i++) {\n const vertex = vertices[i];\n vertex[0] = (vertex[0] * scale[0]) + translate[0];\n vertex[1] = (vertex[1] * scale[1]) + translate[1];\n vertex[2] = (vertex[2] * scale[2]) + translate[2];\n }\n}\n\nfunction centerVertices(vertices) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = vertices.length;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n centerPos[0] += vertex[0];\n centerPos[1] += vertex[1];\n centerPos[2] += vertex[2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n vertex[0] -= centerPos[0];\n vertex[1] -= centerPos[1];\n vertex[2] -= centerPos[2];\n }\n }\n}\n\nfunction customTransformVertices(vertices, transform) {\n if (transform) {\n const mat = math.mat4(transform);\n for (let i = 0, len = vertices.length; i < len; i++) {\n const vertex = vertices[i];\n math.transformPoint3(mat, vertex, vertex);\n }\n }\n}\n\nfunction parseCityJSON(ctx) {\n\n const data = ctx.data;\n const cityObjects = data.CityObjects;\n\n for (const objectId in cityObjects) {\n if (cityObjects.hasOwnProperty(objectId)) {\n const cityObject = cityObjects[objectId];\n parseCityObject(ctx, cityObject, objectId);\n }\n }\n}\n\nfunction parseCityObject(ctx, cityObject, objectId) {\n\n const xktModel = ctx.xktModel;\n const data = ctx.data;\n const metaObjectId = objectId;\n const metaObjectType = cityObject.type;\n const metaObjectName = metaObjectType + \" : \" + objectId;\n\n const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObjectId;\n\n xktModel.createMetaObject({\n metaObjectId,\n metaObjectName,\n metaObjectType,\n parentMetaObjectId\n });\n\n ctx.stats.numMetaObjects++;\n\n if (!(cityObject.geometry && cityObject.geometry.length > 0)) {\n return;\n }\n\n const meshIds = [];\n\n for (let i = 0, len = cityObject.geometry.length; i < len; i++) {\n\n const geometry = cityObject.geometry[i];\n\n let objectMaterial;\n let surfaceMaterials;\n\n const appearance = data.appearance;\n if (appearance) {\n const materials = appearance.materials;\n if (materials) {\n const geometryMaterial = geometry.material;\n if (geometryMaterial) {\n const themeIds = Object.keys(geometryMaterial);\n if (themeIds.length > 0) {\n const themeId = themeIds[0];\n const theme = geometryMaterial[themeId];\n if (theme.value !== undefined) {\n objectMaterial = materials[theme.value];\n } else {\n const values = theme.values;\n if (values) {\n surfaceMaterials = [];\n for (let j = 0, lenj = values.length; j < lenj; j++) {\n const value = values[i];\n const surfaceMaterial = materials[value];\n surfaceMaterials.push(surfaceMaterial);\n }\n }\n }\n }\n }\n }\n }\n\n if (surfaceMaterials) {\n parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds);\n\n } else {\n parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds);\n }\n }\n\n if (meshIds.length > 0) {\n xktModel.createEntity({\n entityId: objectId,\n meshIds: meshIds\n });\n\n ctx.stats.numObjects++;\n }\n}\n\nfunction parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) {\n\n const geomType = geometry.type;\n\n switch (geomType) {\n\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n break;\n\n case \"MultiSolid\":\n\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n}\n\nfunction parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) {\n\n const vertices = ctx.vertices;\n const xktModel = ctx.xktModel;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n const surface = surfaces[i];\n const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0};\n\n const face = [];\n const holes = [];\n\n const sharedIndices = [];\n\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n for (let j = 0; j < surface.length; j++) {\n\n if (face.length > 0) {\n holes.push(face.length);\n }\n\n const newFace = extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg);\n\n face.push(...newFace);\n }\n\n if (face.length === 3) { // Triangle\n\n geometryCfg.indices.push(face[0]);\n geometryCfg.indices.push(face[1]);\n geometryCfg.indices.push(face[2]);\n\n } else if (face.length > 3) { // Polygon\n\n // Prepare to triangulate\n\n const pList = [];\n\n for (let k = 0; k < face.length; k++) {\n pList.push({\n x: vertices[sharedIndices[face[k]]][0],\n y: vertices[sharedIndices[face[k]]][1],\n z: vertices[sharedIndices[face[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n\n // Convert to 2D\n\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n\n to2D(pList[k], normal, tempVec2a);\n\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n // Triangulate\n\n const tr = earcut(pv, holes, 2);\n\n // Create triangles\n\n for (let k = 0; k < tr.length; k += 3) {\n geometryCfg.indices.unshift(face[tr[k]]);\n geometryCfg.indices.unshift(face[tr[k + 1]]);\n geometryCfg.indices.unshift(face[tr[k + 2]]);\n }\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n}\n\nfunction parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) {\n\n const xktModel = ctx.xktModel;\n const sharedIndices = [];\n const geometryCfg = {\n positions: [],\n indices: []\n };\n\n const geomType = geometry.type;\n\n switch (geomType) {\n case \"MultiPoint\":\n break;\n\n case \"MultiLineString\":\n break;\n\n case \"MultiSurface\":\n case \"CompositeSurface\":\n const surfaces = geometry.boundaries;\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n break;\n\n case \"Solid\":\n const shells = geometry.boundaries;\n for (let j = 0; j < shells.length; j++) {\n const surfaces = shells[j];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n break;\n\n case \"MultiSolid\":\n case \"CompositeSolid\":\n const solids = geometry.boundaries;\n for (let j = 0; j < solids.length; j++) {\n for (let k = 0; k < solids[j].length; k++) {\n const surfaces = solids[j][k];\n parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);\n }\n }\n break;\n\n case \"GeometryInstance\":\n break;\n }\n\n const geometryId = \"\" + ctx.nextId++;\n const meshId = \"\" + ctx.nextId++;\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: geometryCfg.positions,\n indices: geometryCfg.indices\n });\n\n xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8],\n opacity: 1.0\n //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0\n });\n\n meshIds.push(meshId);\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n}\n\nfunction parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) {\n\n const vertices = ctx.vertices;\n\n for (let i = 0; i < surfaces.length; i++) {\n\n let boundary = [];\n let holes = [];\n\n for (let j = 0; j < surfaces[i].length; j++) {\n if (boundary.length > 0) {\n holes.push(boundary.length);\n }\n const newBoundary = extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg);\n boundary.push(...newBoundary);\n }\n\n if (boundary.length === 3) { // Triangle\n\n primitiveCfg.indices.push(boundary[0]);\n primitiveCfg.indices.push(boundary[1]);\n primitiveCfg.indices.push(boundary[2]);\n\n } else if (boundary.length > 3) { // Polygon\n\n let pList = [];\n\n for (let k = 0; k < boundary.length; k++) {\n pList.push({\n x: vertices[sharedIndices[boundary[k]]][0],\n y: vertices[sharedIndices[boundary[k]]][1],\n z: vertices[sharedIndices[boundary[k]]][2]\n });\n }\n\n const normal = getNormalOfPositions(pList, math.vec3());\n let pv = [];\n\n for (let k = 0; k < pList.length; k++) {\n to2D(pList[k], normal, tempVec2a);\n pv.unshift(tempVec2a[0]);\n pv.unshift(tempVec2a[1]);\n }\n\n const tr = earcut(pv, holes, 2);\n\n for (let k = 0; k < tr.length; k += 3) {\n primitiveCfg.indices.unshift(boundary[tr[k]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 1]]);\n primitiveCfg.indices.unshift(boundary[tr[k + 2]]);\n }\n }\n }\n}\n\nfunction extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) {\n\n const vertices = ctx.vertices;\n const newBoundary = []\n\n for (let i = 0, len = boundary.length; i < len; i++) {\n\n const index = boundary[i];\n\n if (sharedIndices.includes(index)) {\n const vertexIndex = sharedIndices.indexOf(index);\n newBoundary.push(vertexIndex);\n\n } else {\n geometryCfg.positions.push(vertices[index][0]);\n geometryCfg.positions.push(vertices[index][1]);\n geometryCfg.positions.push(vertices[index][2]);\n\n newBoundary.push(sharedIndices.length);\n\n sharedIndices.push(index);\n }\n }\n\n return newBoundary\n}\n\nfunction getNormalOfPositions(positions, normal) {\n\n for (let i = 0; i < positions.length; i++) {\n\n let nexti = i + 1;\n if (nexti === positions.length) {\n nexti = 0;\n }\n\n normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z));\n normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x));\n normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y));\n }\n\n return math.normalizeVec3(normal);\n}\n\nfunction to2D(_p, _n, re) {\n\n const p = tempVec3a;\n const n = tempVec3b;\n const x3 = tempVec3c;\n\n p[0] = _p.x;\n p[1] = _p.y;\n p[2] = _p.z;\n\n n[0] = _n.x;\n n[1] = _n.y;\n n[2] = _n.z;\n\n x3[0] = 1.1;\n x3[1] = 1.1;\n x3[2] = 1.1;\n\n const dist = math.lenVec3(math.subVec3(x3, n));\n\n if (dist < 0.01) {\n x3[0] += 1.0;\n x3[1] += 2.0;\n x3[2] += 3.0;\n }\n\n const dot = math.dotVec3(x3, n);\n const tmp2 = math.mulVec3Scalar(n, dot, math.vec3());\n\n x3[0] -= tmp2[0];\n x3[1] -= tmp2[1];\n x3[2] -= tmp2[2];\n\n math.normalizeVec3(x3);\n\n const y3 = math.cross3Vec3(n, x3, math.vec3());\n const x = math.dotVec3(p, x3);\n const y = math.dotVec3(p, y3);\n\n re[0] = x;\n re[1] = y;\n}\n\nexport {parseCityJSONIntoXKTModel};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseCityJSONIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseCityJSONIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -11648,7 +11648,7 @@ "name": "src/parsers/parseGLTFIntoXKTModel.js", "content": "import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nimport {parse} from '@loaders.gl/core';\nimport {GLTFLoader} from '@loaders.gl/gltf';\nimport {\n ClampToEdgeWrapping,\n LinearFilter,\n LinearMipMapLinearFilter,\n LinearMipMapNearestFilter,\n MirroredRepeatWrapping,\n NearestFilter,\n NearestMipMapLinearFilter,\n NearestMipMapNearestFilter,\n RepeatWrapping\n} from \"../constants.js\";\n\n/**\n * @desc Parses glTF into an {@link XKTModel}, supporting ````.glb```` and textures.\n *\n * * Supports ````.glb```` and textures\n * * For a lightweight glTF JSON parser that ignores textures, see {@link parseGLTFJSONIntoXKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a binary glTF model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"../assets/models/gltf/HousePlan/glTF-Binary/HousePlan.glb\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {ArrayBuffer} params.data The glTF.\n * @param {String} [params.baseUri] The base URI used to load this glTF, if any. For resolving relative uris to linked resources.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeTextures=true] Whether to parse textures.\n * @param {Boolean} [params.includeNormals=true] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded non-PBR representation of the glTF.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when glTF has been parsed.\n */\nfunction parseGLTFIntoXKTModel({\n data,\n baseUri,\n xktModel,\n metaModelData,\n includeTextures = true,\n includeNormals = true,\n getAttachment,\n stats = {},\n log\n }) {\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numUVs = 0;\n stats.numTextures = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n parse(data, GLTFLoader, {\n baseUri\n }).then((gltfData) => {\n\n const ctx = {\n gltfData,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n error: function (msg) {\n console.error(msg);\n },\n xktModel,\n includeNormals: (includeNormals !== false),\n includeTextures: (includeTextures !== false),\n geometryCreated: {},\n nextId: 0,\n stats\n };\n\n ctx.log(\"Using parser: parseGLTFIntoXKTModel\");\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n ctx.log(`Parsing textures: ${ctx.includeTextures ? \"enabled\" : \"disabled\"}`);\n\n if (ctx.includeTextures) {\n parseTextures(ctx);\n }\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(`[parseGLTFIntoXKTModel] ${errMsg}`);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n return {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n}\n\nfunction parseTextures(ctx) {\n const gltfData = ctx.gltfData;\n const textures = gltfData.textures;\n if (textures) {\n for (let i = 0, len = textures.length; i < len; i++) {\n parseTexture(ctx, textures[i]);\n ctx.stats.numTextures++;\n }\n }\n}\n\nfunction parseTexture(ctx, texture) {\n if (!texture.source || !texture.source.image) {\n return;\n }\n const textureId = `texture-${ctx.nextId++}`;\n\n let minFilter = NearestMipMapLinearFilter;\n switch (texture.sampler.minFilter) {\n case 9728:\n minFilter = NearestFilter;\n break;\n case 9729:\n minFilter = LinearFilter;\n break;\n case 9984:\n minFilter = NearestMipMapNearestFilter;\n break;\n case 9985:\n minFilter = LinearMipMapNearestFilter;\n break;\n case 9986:\n minFilter = NearestMipMapLinearFilter;\n break;\n case 9987:\n minFilter = LinearMipMapLinearFilter;\n break;\n }\n\n let magFilter = LinearFilter;\n switch (texture.sampler.magFilter) {\n case 9728:\n magFilter = NearestFilter;\n break;\n case 9729:\n magFilter = LinearFilter;\n break;\n }\n\n let wrapS = RepeatWrapping;\n switch (texture.sampler.wrapS) {\n case 33071:\n wrapS = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapS = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapS = RepeatWrapping;\n break;\n }\n\n let wrapT = RepeatWrapping;\n switch (texture.sampler.wrapT) {\n case 33071:\n wrapT = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapT = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapT = RepeatWrapping;\n break;\n }\n\n let wrapR = RepeatWrapping;\n switch (texture.sampler.wrapR) {\n case 33071:\n wrapR = ClampToEdgeWrapping;\n break;\n case 33648:\n wrapR = MirroredRepeatWrapping;\n break;\n case 10497:\n wrapR = RepeatWrapping;\n break;\n }\n\n ctx.xktModel.createTexture({\n textureId: textureId,\n imageData: texture.source.image,\n mediaType: texture.source.mediaType,\n compressed: true,\n width: texture.source.image.width,\n height: texture.source.image.height,\n minFilter,\n magFilter,\n wrapS,\n wrapT,\n wrapR,\n flipY: !!texture.flipY,\n // encoding: \"sRGB\"\n });\n texture._textureId = textureId;\n}\n\nfunction parseMaterials(ctx) {\n const gltfData = ctx.gltfData;\n const materials = gltfData.materials;\n if (materials) {\n for (let i = 0, len = materials.length; i < len; i++) {\n const material = materials[i];\n material._textureSetId = ctx.includeTextures ? parseTextureSet(ctx, material) : null;\n material._attributes = parseMaterialAttributes(ctx, material);\n }\n }\n}\n\nfunction parseTextureSet(ctx, material) {\n const textureSetCfg = {};\n if (material.normalTexture) {\n textureSetCfg.normalTextureId = material.normalTexture.texture._textureId;\n }\n if (material.occlusionTexture) {\n textureSetCfg.occlusionTextureId = material.occlusionTexture.texture._textureId;\n }\n if (material.emissiveTexture) {\n textureSetCfg.emissiveTextureId = material.emissiveTexture.texture._textureId;\n }\n // const alphaMode = material.alphaMode;\n // switch (alphaMode) {\n // case \"NORMAL_OPAQUE\":\n // materialCfg.alphaMode = \"opaque\";\n // break;\n // case \"MASK\":\n // materialCfg.alphaMode = \"mask\";\n // break;\n // case \"BLEND\":\n // materialCfg.alphaMode = \"blend\";\n // break;\n // default:\n // }\n // const alphaCutoff = material.alphaCutoff;\n // if (alphaCutoff !== undefined) {\n // materialCfg.alphaCutoff = alphaCutoff;\n // }\n const metallicPBR = material.pbrMetallicRoughness;\n if (material.pbrMetallicRoughness) {\n const pbrMetallicRoughness = material.pbrMetallicRoughness;\n const baseColorTexture = pbrMetallicRoughness.baseColorTexture || pbrMetallicRoughness.colorTexture;\n if (baseColorTexture) {\n if (baseColorTexture.texture) {\n textureSetCfg.colorTextureId = baseColorTexture.texture._textureId;\n } else {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[baseColorTexture.index]._textureId;\n }\n }\n if (metallicPBR.metallicRoughnessTexture) {\n textureSetCfg.metallicRoughnessTextureId = metallicPBR.metallicRoughnessTexture.texture._textureId;\n }\n }\n const extensions = material.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const specularTexture = specularPBR.specularTexture;\n if (specularTexture !== null && specularTexture !== undefined) {\n // textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n const specularColorTexture = specularPBR.specularColorTexture;\n if (specularColorTexture !== null && specularColorTexture !== undefined) {\n textureSetCfg.colorTextureId = ctx.gltfData.textures[specularColorTexture.index]._textureId;\n }\n }\n }\n if (textureSetCfg.normalTextureId !== undefined ||\n textureSetCfg.occlusionTextureId !== undefined ||\n textureSetCfg.emissiveTextureId !== undefined ||\n textureSetCfg.colorTextureId !== undefined ||\n textureSetCfg.metallicRoughnessTextureId !== undefined) {\n textureSetCfg.textureSetId = `textureSet-${ctx.nextId++};`\n ctx.xktModel.createTextureSet(textureSetCfg);\n ctx.stats.numTextureSets++;\n return textureSetCfg.textureSetId;\n }\n return null;\n}\n\nfunction parseMaterialAttributes(ctx, material) { // Substitute RGBA for material, to use fast flat shading instead\n const extensions = material.extensions;\n const materialAttributes = {\n color: new Float32Array([1, 1, 1, 1]),\n opacity: 1,\n metallic: 0,\n roughness: 1\n };\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n materialAttributes.color.set(diffuseFactor);\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n materialAttributes.color.set(diffuse);\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n materialAttributes.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n materialAttributes.opacity = transparent;\n }\n }\n }\n const metallicPBR = material.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n materialAttributes.color[0] = baseColorFactor[0];\n materialAttributes.color[1] = baseColorFactor[1];\n materialAttributes.color[2] = baseColorFactor[2];\n materialAttributes.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n materialAttributes.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n materialAttributes.roughness = roughnessFactor;\n }\n }\n return materialAttributes;\n}\n\nfunction parseDefaultScene(ctx) {\n const gltfData = ctx.gltfData;\n const scene = gltfData.scene || gltfData.scenes[0];\n if (!scene) {\n ctx.error(\"glTF has no default scene\");\n return;\n }\n parseScene(ctx, scene);\n}\n\nfunction parseScene(ctx, scene) {\n const nodes = scene.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n countMeshUsage(ctx, node);\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n parseNode(ctx, node, 0, null);\n }\n}\n\nfunction countMeshUsage(ctx, node) {\n const mesh = node.mesh;\n if (mesh) {\n mesh.instances = mesh.instances ? mesh.instances + 1 : 1;\n }\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n if (!childNode) {\n ctx.error(\"Node not found: \" + i);\n continue;\n }\n countMeshUsage(ctx, childNode);\n }\n }\n}\n\nconst deferredMeshIds = [];\n\nfunction parseNode(ctx, node, depth, matrix) {\n\n const xktModel = ctx.xktModel;\n\n // Pre-order visit scene node\n\n let localMatrix;\n if (node.matrix) {\n localMatrix = node.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.translation) {\n localMatrix = math.translationMat4v(node.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.rotation) {\n localMatrix = math.quaternionToMat4(node.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n if (node.scale) {\n localMatrix = math.scalingMat4v(node.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (node.mesh) {\n\n const mesh = node.mesh;\n const numPrimitives = mesh.primitives.length;\n\n if (numPrimitives > 0) {\n for (let i = 0; i < numPrimitives; i++) {\n const primitive = mesh.primitives[i];\n if (!primitive._xktGeometryId) {\n const xktGeometryId = \"geometry-\" + ctx.nextId++;\n const geometryCfg = {\n geometryId: xktGeometryId\n };\n switch (primitive.mode) {\n case 0: // POINTS\n geometryCfg.primitiveType = \"points\";\n break;\n case 1: // LINES\n geometryCfg.primitiveType = \"lines\";\n break;\n case 2: // LINE_LOOP\n geometryCfg.primitiveType = \"line-loop\";\n break;\n case 3: // LINE_STRIP\n geometryCfg.primitiveType = \"line-strip\";\n break;\n case 4: // TRIANGLES\n geometryCfg.primitiveType = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n geometryCfg.primitiveType = \"triangle-strip\";\n break;\n case 6: // TRIANGLE_FAN\n geometryCfg.primitiveType = \"triangle-fan\";\n break;\n default:\n geometryCfg.primitiveType = \"triangles\";\n }\n const POSITION = primitive.attributes.POSITION;\n if (!POSITION) {\n continue;\n }\n geometryCfg.positions = primitive.attributes.POSITION.value;\n ctx.stats.numVertices += geometryCfg.positions.length / 3;\n if (ctx.includeNormals) {\n if (primitive.attributes.NORMAL) {\n geometryCfg.normals = primitive.attributes.NORMAL.value;\n ctx.stats.numNormals += geometryCfg.normals.length / 3;\n }\n }\n if (primitive.attributes.COLOR_0) {\n geometryCfg.colorsCompressed = primitive.attributes.COLOR_0.value;\n }\n if (ctx.includeTextures) {\n if (primitive.attributes.TEXCOORD_0) {\n geometryCfg.uvs = primitive.attributes.TEXCOORD_0.value;\n ctx.stats.numUVs += geometryCfg.uvs.length / 2;\n }\n }\n if (primitive.indices) {\n geometryCfg.indices = primitive.indices.value;\n if (primitive.mode === 4) {\n ctx.stats.numTriangles += geometryCfg.indices.length / 3;\n }\n }\n xktModel.createGeometry(geometryCfg);\n primitive._xktGeometryId = xktGeometryId;\n ctx.stats.numGeometries++;\n }\n\n const xktMeshId = ctx.nextId++;\n const meshCfg = {\n meshId: xktMeshId,\n geometryId: primitive._xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4()\n };\n const material = primitive.material;\n if (material) {\n meshCfg.textureSetId = material._textureSetId;\n meshCfg.color = material._attributes.color;\n meshCfg.opacity = material._attributes.opacity;\n meshCfg.metallic = material._attributes.metallic;\n meshCfg.roughness = material._attributes.roughness;\n } else {\n meshCfg.color = [1.0, 1.0, 1.0];\n meshCfg.opacity = 1.0;\n }\n xktModel.createMesh(meshCfg);\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n\n // Visit child scene nodes\n\n if (node.children) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNode = children[i];\n parseNode(ctx, childNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = node.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (!!xktEntityId && xktModel.entities[xktEntityId]) {\n ctx.log(`Warning: Two or more glTF nodes found with same 'name' attribute: '${nodeName} - will randomly-generating an object ID in XKT`);\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n if (ctx.metaModelCorrections) {\n // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n } else {\n // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds.length = 0;\n }\n }\n}\n\nexport {parseGLTFIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseGLTFIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseGLTFIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -12136,7 +12136,7 @@ "name": "src/parsers/parseGLTFJSONIntoXKTModel.js", "content": "import {utils} from \"../XKTModel/lib/utils.js\";\nimport {math} from \"../lib/math.js\";\n\nconst atob2 = (typeof atob !== 'undefined') ? atob : a => Buffer.from(a, 'base64').toString('binary');\n\nconst WEBGL_COMPONENT_TYPES = {\n 5120: Int8Array,\n 5121: Uint8Array,\n 5122: Int16Array,\n 5123: Uint16Array,\n 5125: Uint32Array,\n 5126: Float32Array\n};\n\nconst WEBGL_TYPE_SIZES = {\n 'SCALAR': 1,\n 'VEC2': 2,\n 'VEC3': 3,\n 'VEC4': 4,\n 'MAT2': 4,\n 'MAT3': 9,\n 'MAT4': 16\n};\n\n/**\n * @desc Parses glTF JSON into an {@link XKTModel}, without ````.glb```` and textures.\n *\n * * Lightweight JSON-based glTF parser which ignores textures\n * * For texture and ````.glb```` support, see {@link parseGLTFIntoXKTModel}\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a glTF model into it.\n *\n * ````javascript\n * utils.loadJSON(\"./models/gltf/duplex/scene.gltf\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseGLTFJSONIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing parameters.\n * @param {Object} params.data The glTF JSON.\n * @param {Object} [params.metaModelData] Metamodel JSON. If this is provided, then parsing is able to ensure that the XKTObjects it creates will fit the metadata properly.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Boolean} [params.includeNormals=false] Whether to parse normals. When false, the parser will ignore the glTF\n * geometry normals, and the glTF data will rely on the xeokit ````Viewer```` to automatically generate them. This has\n * the limitation that the normals will be face-aligned, and therefore the ````Viewer```` will only be able to render\n * a flat-shaded representation of the glTF.\n * @param {Boolean} [params.reuseGeometries=true] When true, the parser will enable geometry reuse within the XKTModel. When false,\n * will automatically \"expand\" all reused geometries into duplicate copies. This has the drawback of increasing the XKT\n * file size (~10-30% for typical models), but can make the model more responsive in the xeokit Viewer, especially if the model\n * has excessive geometry reuse. An example of excessive geometry reuse would be if we have 4000 geometries that are\n * shared amongst 2000 objects, ie. a large number of geometries with a low amount of reuse, which can present a\n * pathological performance case for xeokit's underlying graphics APIs (WebGL, WebGPU etc).\n * @param {function} [params.getAttachment] Callback through which to fetch attachments, if the glTF has them.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise}\n */\nfunction parseGLTFJSONIntoXKTModel({\n data,\n xktModel,\n metaModelData,\n includeNormals,\n reuseGeometries,\n getAttachment,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseGLTFJSONIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n stats.sourceFormat = \"glTF\";\n stats.schemaVersion = \"2.0\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numTriangles = 0;\n stats.numVertices = 0;\n stats.numNormals = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n\n const ctx = {\n gltf: data,\n metaModelCorrections: metaModelData ? getMetaModelCorrections(metaModelData) : null,\n getAttachment: getAttachment || (() => {\n throw new Error('You must define getAttachment() method to convert glTF with external resources')\n }),\n log: (log || function (msg) {\n }),\n xktModel,\n includeNormals,\n createXKTGeometryIds: {},\n nextMeshId: 0,\n reuseGeometries: (reuseGeometries !== false),\n stats\n };\n\n ctx.log(`Parsing normals: ${ctx.includeNormals ? \"enabled\" : \"disabled\"}`);\n\n parseBuffers(ctx).then(() => {\n\n parseBufferViews(ctx);\n freeBuffers(ctx);\n parseMaterials(ctx);\n parseDefaultScene(ctx);\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n}\n\nfunction getMetaModelCorrections(metaModelData) {\n const eachRootStats = {};\n const eachChildRoot = {};\n const metaObjects = metaModelData.metaObjects || [];\n const metaObjectsMap = {};\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n metaObjectsMap[metaObject.id] = metaObject;\n }\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const metaObject = metaObjects[i];\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) {\n let rootMetaObject = metaObjectParent;\n while (rootMetaObject.parent && metaObjectsMap[rootMetaObject.parent].type === rootMetaObject.type) {\n rootMetaObject = metaObjectsMap[rootMetaObject.parent];\n }\n const rootStats = eachRootStats[rootMetaObject.id] || (eachRootStats[rootMetaObject.id] = {\n numChildren: 0,\n countChildren: 0\n });\n rootStats.numChildren++;\n eachChildRoot[metaObject.id] = rootMetaObject;\n } else {\n\n }\n }\n }\n const metaModelCorrections = {\n metaObjectsMap,\n eachRootStats,\n eachChildRoot\n };\n return metaModelCorrections;\n}\n\nfunction parseBuffers(ctx) { // Parses geometry buffers into temporary \"_buffer\" Unit8Array properties on the glTF \"buffer\" elements\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n return Promise.all(buffers.map(buffer => parseBuffer(ctx, buffer)));\n } else {\n return new Promise(function (resolve, reject) {\n resolve();\n });\n }\n}\n\nfunction parseBuffer(ctx, bufferInfo) {\n return new Promise(function (resolve, reject) {\n // Allow a shortcut where the glTF buffer is \"enrichened\" with direct\n // access to the data-arrayBuffer, w/out needing to either:\n // - read the file indicated by the \".uri\" component of the buffer\n // - base64-decode the encoded data in the \".uri\" component\n if (bufferInfo._arrayBuffer) {\n bufferInfo._buffer = bufferInfo._arrayBuffer;\n resolve(bufferInfo);\n return;\n }\n // Otherwise, proceed with \"standard-glTF\" .uri component.\n const uri = bufferInfo.uri;\n if (!uri) {\n reject('gltf/handleBuffer missing uri in ' + JSON.stringify(bufferInfo));\n return;\n }\n parseArrayBuffer(ctx, uri).then((arrayBuffer) => {\n bufferInfo._buffer = arrayBuffer;\n resolve(arrayBuffer);\n }, (errMsg) => {\n reject(errMsg);\n })\n });\n}\n\nfunction parseArrayBuffer(ctx, uri) {\n return new Promise(function (resolve, reject) {\n const dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; // Check for data: URI\n const dataUriRegexResult = uri.match(dataUriRegex);\n if (dataUriRegexResult) { // Safari can't handle data URIs through XMLHttpRequest\n const isBase64 = !!dataUriRegexResult[2];\n let data = dataUriRegexResult[3];\n data = decodeURIComponent(data);\n if (isBase64) {\n data = atob2(data);\n }\n const buffer = new ArrayBuffer(data.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < data.length; i++) {\n view[i] = data.charCodeAt(i);\n }\n resolve(buffer);\n } else { // Uri is a path to a file\n ctx.getAttachment(uri).then(\n (arrayBuffer) => {\n resolve(arrayBuffer);\n },\n (errMsg) => {\n reject(errMsg);\n });\n }\n });\n}\n\nfunction parseBufferViews(ctx) { // Parses our temporary \"_buffer\" properties into \"_buffer\" properties on glTF \"bufferView\" elements\n const bufferViewsInfo = ctx.gltf.bufferViews;\n if (bufferViewsInfo) {\n for (let i = 0, len = bufferViewsInfo.length; i < len; i++) {\n parseBufferView(ctx, bufferViewsInfo[i]);\n }\n }\n}\n\nfunction parseBufferView(ctx, bufferViewInfo) {\n const buffer = ctx.gltf.buffers[bufferViewInfo.buffer];\n bufferViewInfo._typedArray = null;\n const byteLength = bufferViewInfo.byteLength || 0;\n const byteOffset = bufferViewInfo.byteOffset || 0;\n bufferViewInfo._buffer = buffer._buffer.slice(byteOffset, byteOffset + byteLength);\n}\n\nfunction freeBuffers(ctx) { // Deletes the \"_buffer\" properties from the glTF \"buffer\" elements, to save memory\n const buffers = ctx.gltf.buffers;\n if (buffers) {\n for (let i = 0, len = buffers.length; i < len; i++) {\n buffers[i]._buffer = null;\n }\n }\n}\n\nfunction parseMaterials(ctx) {\n const materialsInfo = ctx.gltf.materials;\n if (materialsInfo) {\n for (let i = 0, len = materialsInfo.length; i < len; i++) {\n const materialInfo = materialsInfo[i];\n const material = parseMaterial(ctx, materialInfo);\n materialInfo._materialData = material;\n }\n }\n}\n\nfunction parseMaterial(ctx, materialInfo) { // Attempts to extract an RGBA color for a glTF material\n const material = {\n color: new Float32Array([1, 1, 1]),\n opacity: 1.0,\n metallic: 0,\n roughness: 1\n };\n const extensions = materialInfo.extensions;\n if (extensions) {\n const specularPBR = extensions[\"KHR_materials_pbrSpecularGlossiness\"];\n if (specularPBR) {\n const diffuseFactor = specularPBR.diffuseFactor;\n if (diffuseFactor !== null && diffuseFactor !== undefined) {\n material.color[0] = diffuseFactor[0];\n material.color[1] = diffuseFactor[1];\n material.color[2] = diffuseFactor[2];\n }\n }\n const common = extensions[\"KHR_materials_common\"];\n if (common) {\n const technique = common.technique;\n const values = common.values || {};\n const blinn = technique === \"BLINN\";\n const phong = technique === \"PHONG\";\n const lambert = technique === \"LAMBERT\";\n const diffuse = values.diffuse;\n if (diffuse && (blinn || phong || lambert)) {\n if (!utils.isString(diffuse)) {\n material.color[0] = diffuse[0];\n material.color[1] = diffuse[1];\n material.color[2] = diffuse[2];\n }\n }\n const transparency = values.transparency;\n if (transparency !== null && transparency !== undefined) {\n material.opacity = transparency;\n }\n const transparent = values.transparent;\n if (transparent !== null && transparent !== undefined) {\n material.opacity = transparent;\n }\n }\n }\n const metallicPBR = materialInfo.pbrMetallicRoughness;\n if (metallicPBR) {\n const baseColorFactor = metallicPBR.baseColorFactor;\n if (baseColorFactor) {\n material.color[0] = baseColorFactor[0];\n material.color[1] = baseColorFactor[1];\n material.color[2] = baseColorFactor[2];\n material.opacity = baseColorFactor[3];\n }\n const metallicFactor = metallicPBR.metallicFactor;\n if (metallicFactor !== null && metallicFactor !== undefined) {\n material.metallic = metallicFactor;\n }\n const roughnessFactor = metallicPBR.roughnessFactor;\n if (roughnessFactor !== null && roughnessFactor !== undefined) {\n material.roughness = roughnessFactor;\n }\n }\n return material;\n}\n\nfunction parseDefaultScene(ctx) {\n const scene = ctx.gltf.scene || 0;\n const defaultSceneInfo = ctx.gltf.scenes[scene];\n if (!defaultSceneInfo) {\n throw new Error(\"glTF has no default scene\");\n }\n parseScene(ctx, defaultSceneInfo);\n}\n\n\nfunction parseScene(ctx, sceneInfo) {\n const nodes = sceneInfo.nodes;\n if (!nodes) {\n return;\n }\n for (let i = 0, len = nodes.length; i < len; i++) {\n const glTFNode = ctx.gltf.nodes[nodes[i]];\n if (glTFNode) {\n parseNode(ctx, glTFNode, 0, null);\n }\n }\n}\n\nlet deferredMeshIds = [];\n\nfunction parseNode(ctx, glTFNode, depth, matrix) {\n\n const gltf = ctx.gltf;\n const xktModel = ctx.xktModel;\n\n let localMatrix;\n\n if (glTFNode.matrix) {\n localMatrix = glTFNode.matrix;\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, math.mat4());\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.translation) {\n localMatrix = math.translationMat4v(glTFNode.translation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.rotation) {\n localMatrix = math.quaternionToMat4(glTFNode.rotation);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n if (glTFNode.scale) {\n localMatrix = math.scalingMat4v(glTFNode.scale);\n if (matrix) {\n matrix = math.mulMat4(matrix, localMatrix, localMatrix);\n } else {\n matrix = localMatrix;\n }\n }\n\n const gltfMeshId = glTFNode.mesh;\n\n if (gltfMeshId !== undefined) {\n\n const meshInfo = gltf.meshes[gltfMeshId];\n\n if (meshInfo) {\n\n const numPrimitivesInMesh = meshInfo.primitives.length;\n\n if (numPrimitivesInMesh > 0) {\n\n for (let i = 0; i < numPrimitivesInMesh; i++) {\n\n const primitiveInfo = meshInfo.primitives[i];\n\n const geometryHash = createPrimitiveGeometryHash(primitiveInfo);\n\n let xktGeometryId = ctx.createXKTGeometryIds[geometryHash];\n\n if ((!ctx.reuseGeometries) || !xktGeometryId) {\n\n xktGeometryId = \"geometry-\" + ctx.nextMeshId++\n\n const geometryArrays = {};\n\n parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays);\n\n const colors = geometryArrays.colors;\n\n let colorsCompressed;\n\n if (geometryArrays.colors) {\n colorsCompressed = [];\n for (let j = 0, lenj = colors.length; j < lenj; j += 4) {\n colorsCompressed.push(colors[j + 0]);\n colorsCompressed.push(colors[j + 1]);\n colorsCompressed.push(colors[j + 2]);\n colorsCompressed.push(255);\n }\n }\n\n xktModel.createGeometry({\n geometryId: xktGeometryId,\n primitiveType: geometryArrays.primitive,\n positions: geometryArrays.positions,\n normals: ctx.includeNormals ? geometryArrays.normals : null,\n colorsCompressed: colorsCompressed,\n indices: geometryArrays.indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += geometryArrays.positions ? geometryArrays.positions.length / 3 : 0;\n ctx.stats.numNormals += (ctx.includeNormals && geometryArrays.normals) ? geometryArrays.normals.length / 3 : 0;\n ctx.stats.numTriangles += geometryArrays.indices ? geometryArrays.indices.length / 3 : 0;\n\n ctx.createXKTGeometryIds[geometryHash] = xktGeometryId;\n } else {\n// Geometry reused\n }\n\n const materialIndex = primitiveInfo.material;\n const materialInfo = (materialIndex !== null && materialIndex !== undefined) ? gltf.materials[materialIndex] : null;\n const color = materialInfo ? materialInfo._materialData.color : new Float32Array([1.0, 1.0, 1.0, 1.0]);\n const opacity = materialInfo ? materialInfo._materialData.opacity : 1.0;\n const metallic = materialInfo ? materialInfo._materialData.metallic : 0.0;\n const roughness = materialInfo ? materialInfo._materialData.roughness : 1.0;\n\n const xktMeshId = \"mesh-\" + ctx.nextMeshId++;\n\n xktModel.createMesh({\n meshId: xktMeshId,\n geometryId: xktGeometryId,\n matrix: matrix ? matrix.slice() : math.identityMat4(),\n color: color,\n opacity: opacity,\n metallic: metallic,\n roughness: roughness\n });\n\n deferredMeshIds.push(xktMeshId);\n }\n }\n }\n }\n\n\n if (glTFNode.children) {\n const children = glTFNode.children;\n for (let i = 0, len = children.length; i < len; i++) {\n const childNodeIdx = children[i];\n const childGLTFNode = gltf.nodes[childNodeIdx];\n if (!childGLTFNode) {\n console.warn('Node not found: ' + i);\n continue;\n }\n parseNode(ctx, childGLTFNode, depth + 1, matrix);\n }\n }\n\n // Post-order visit scene node\n\n const nodeName = glTFNode.name;\n if (((nodeName !== undefined && nodeName !== null) || depth === 0) && deferredMeshIds.length > 0) {\n if (nodeName === undefined || nodeName === null) {\n ctx.log(`[parseGLTFJSONIntoXKTModel] Warning: 'name' properties not found on glTF scene nodes - will randomly-generate object IDs in XKT`);\n }\n let xktEntityId = nodeName; // Fall back on generated ID when `name` not found on glTF scene node(s)\n if (xktEntityId === undefined || xktEntityId === null) {\n if (xktModel.entities[xktEntityId]) {\n ctx.error(\"Two or more glTF nodes found with same 'name' attribute: '\" + nodeName + \"'\");\n }\n while (!xktEntityId || xktModel.entities[xktEntityId]) {\n xktEntityId = \"entity-\" + ctx.nextId++;\n }\n }\n if (ctx.metaModelCorrections) { // Merging meshes into XKTObjects that map to metaobjects\n const rootMetaObject = ctx.metaModelCorrections.eachChildRoot[xktEntityId];\n if (rootMetaObject) {\n const rootMetaObjectStats = ctx.metaModelCorrections.eachRootStats[rootMetaObject.id];\n rootMetaObjectStats.countChildren++;\n if (rootMetaObjectStats.countChildren >= rootMetaObjectStats.numChildren) {\n xktModel.createEntity({\n entityId: rootMetaObject.id,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n } else {\n const metaObject = ctx.metaModelCorrections.metaObjectsMap[xktEntityId];\n if (metaObject) {\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n } else { // Create an XKTObject from the meshes at each named glTF node, don't care about metaobjects\n xktModel.createEntity({\n entityId: xktEntityId,\n meshIds: deferredMeshIds\n });\n ctx.stats.numObjects++;\n deferredMeshIds = [];\n }\n }\n}\n\nfunction createPrimitiveGeometryHash(primitiveInfo) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return \"empty\";\n }\n const mode = primitiveInfo.mode;\n const material = primitiveInfo.material;\n const indices = primitiveInfo.indices;\n const positions = primitiveInfo.attributes.POSITION;\n const normals = primitiveInfo.attributes.NORMAL;\n const colors = primitiveInfo.attributes.COLOR_0;\n const uv = primitiveInfo.attributes.TEXCOORD_0;\n return [\n mode,\n // material,\n (indices !== null && indices !== undefined) ? indices : \"-\",\n (positions !== null && positions !== undefined) ? positions : \"-\",\n (normals !== null && normals !== undefined) ? normals : \"-\",\n (colors !== null && colors !== undefined) ? colors : \"-\",\n (uv !== null && uv !== undefined) ? uv : \"-\"\n ].join(\";\");\n}\n\nfunction parsePrimitiveGeometry(ctx, primitiveInfo, geometryArrays) {\n const attributes = primitiveInfo.attributes;\n if (!attributes) {\n return;\n }\n switch (primitiveInfo.mode) {\n case 0: // POINTS\n geometryArrays.primitive = \"points\";\n break;\n case 1: // LINES\n geometryArrays.primitive = \"lines\";\n break;\n case 2: // LINE_LOOP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 3: // LINE_STRIP\n // TODO: convert\n geometryArrays.primitive = \"lines\";\n break;\n case 4: // TRIANGLES\n geometryArrays.primitive = \"triangles\";\n break;\n case 5: // TRIANGLE_STRIP\n // TODO: convert\n console.log(\"TRIANGLE_STRIP\");\n geometryArrays.primitive = \"triangles\";\n break;\n case 6: // TRIANGLE_FAN\n // TODO: convert\n console.log(\"TRIANGLE_FAN\");\n geometryArrays.primitive = \"triangles\";\n break;\n default:\n geometryArrays.primitive = \"triangles\";\n }\n const accessors = ctx.gltf.accessors;\n const indicesIndex = primitiveInfo.indices;\n if (indicesIndex !== null && indicesIndex !== undefined) {\n const accessorInfo = accessors[indicesIndex];\n geometryArrays.indices = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const positionsIndex = attributes.POSITION;\n if (positionsIndex !== null && positionsIndex !== undefined) {\n const accessorInfo = accessors[positionsIndex];\n geometryArrays.positions = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const normalsIndex = attributes.NORMAL;\n if (normalsIndex !== null && normalsIndex !== undefined) {\n const accessorInfo = accessors[normalsIndex];\n geometryArrays.normals = parseAccessorTypedArray(ctx, accessorInfo);\n }\n const colorsIndex = attributes.COLOR_0;\n if (colorsIndex !== null && colorsIndex !== undefined) {\n const accessorInfo = accessors[colorsIndex];\n geometryArrays.colors = parseAccessorTypedArray(ctx, accessorInfo);\n }\n}\n\nfunction parseAccessorTypedArray(ctx, accessorInfo) {\n const bufferView = ctx.gltf.bufferViews[accessorInfo.bufferView];\n const itemSize = WEBGL_TYPE_SIZES[accessorInfo.type];\n const TypedArray = WEBGL_COMPONENT_TYPES[accessorInfo.componentType];\n const elementBytes = TypedArray.BYTES_PER_ELEMENT; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n const itemBytes = elementBytes * itemSize;\n if (accessorInfo.byteStride && accessorInfo.byteStride !== itemBytes) { // The buffer is not interleaved if the stride is the item size in bytes.\n throw new Error(\"interleaved buffer!\"); // TODO\n } else {\n return new TypedArray(bufferView._buffer, accessorInfo.byteOffset || 0, accessorInfo.count * itemSize);\n }\n}\n\nexport {parseGLTFJSONIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseGLTFJSONIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseGLTFJSONIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -12856,7 +12856,7 @@ "name": "src/parsers/parseIFCIntoXKTModel.js", "content": "/**\n * @desc Parses IFC STEP file data into an {@link XKTModel}.\n *\n * This function uses [web-ifc](https://github.com/tomvandig/web-ifc) to parse the IFC, which relies on a\n * WASM file to do the parsing.\n *\n * Depending on how we use this function, we may need to provide it with a path to the directory where that WASM file is stored.\n *\n * This function is tested with web-ifc version 0.0.34.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an IFC model into it.\n *\n * ````javascript\n * import {XKTModel, parseIFCIntoXKTModel, writeXKTModelToArrayBuffer} from \"xeokit-convert.es.js\";\n *\n * import * as WebIFC from \"web-ifc-api.js\";\n *\n * utils.loadArraybuffer(\"rac_advanced_sample_project.ifc\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseIFCIntoXKTModel({\n * WebIFC,\n * data,\n * xktModel,\n * wasmPath: \"../dist/\",\n * autoNormals: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {Object} params.WebIFC The WebIFC library. We pass this in as an external dependency, in order to give the\n * caller the choice of whether to use the Browser or NodeJS version.\n * @param {ArrayBuffer} [params.data] IFC file data.\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Boolean} [params.autoNormals=true] When true, the parser will ignore the IFC geometry normals, and the IFC\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the IFC model. This is ````true```` by default, because IFC models tend to look acceptable with flat-shading,\n * and we always want to minimize IFC model size wherever possible.\n * @param {String[]} [params.includeTypes] Option to only convert objects of these types.\n * @param {String[]} [params.excludeTypes] Option to never convert objects of these types.\n * @param {String} params.wasmPath Path to ````web-ifc.wasm````, required by this function.\n * @param {Object} [params.stats={}] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when IFC has been parsed.\n */\nfunction parseIFCIntoXKTModel({\n WebIFC,\n data,\n xktModel,\n autoNormals = true,\n includeTypes,\n excludeTypes,\n wasmPath,\n stats = {},\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseIFCIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n if (!wasmPath) {\n reject(\"Argument expected: wasmPath\");\n return;\n }\n\n const ifcAPI = new WebIFC.IfcAPI();\n\n if (wasmPath) {\n ifcAPI.SetWasmPath(wasmPath);\n }\n\n ifcAPI.Init().then(() => {\n\n const dataArray = new Uint8Array(data);\n\n const modelID = ifcAPI.OpenModel(dataArray);\n\n stats.sourceFormat = \"IFC\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 0;\n stats.numPropertySets = 0;\n stats.numObjects = 0;\n stats.numGeometries = 0;\n stats.numTriangles = 0;\n stats.numVertices = 0;\n\n const ctx = {\n WebIFC,\n modelID,\n ifcAPI,\n xktModel,\n autoNormals,\n log: (log || function (msg) {\n }),\n nextId: 0,\n stats\n };\n\n if (includeTypes) {\n ctx.includeTypes = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n ctx.includeTypes[includeTypes[i]] = true;\n }\n }\n\n if (excludeTypes) {\n ctx.excludeTypes = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n ctx.excludeTypes[excludeTypes[i]] = true;\n }\n }\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(modelID, WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(modelID, ifcProjectId);\n\n ctx.xktModel.schema = \"\";\n ctx.xktModel.modelId = \"\" + modelID;\n ctx.xktModel.projectId = \"\" + ifcProjectId;\n\n parseMetadata(ctx);\n parseGeometry(ctx);\n parsePropertySets(ctx);\n\n resolve();\n\n }).catch((e) => {\n\n reject(e);\n })\n });\n}\n\nfunction parsePropertySets(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCRELDEFINESBYPROPERTIES);\n\n for (let i = 0; i < lines.size(); i++) {\n\n let relID = lines.get(i);\n\n let rel = ctx.ifcAPI.GetLine(ctx.modelID, relID, true);\n\n if (rel) {\n\n const relatingPropertyDefinition = rel.RelatingPropertyDefinition;\n if (!relatingPropertyDefinition) {\n continue;\n }\n\n const propertySetId = relatingPropertyDefinition.GlobalId.value;\n\n const relatedObjects = rel.RelatedObjects;\n if (relatedObjects) {\n for (let i = 0, len = relatedObjects.length; i < len; i++) {\n const relatedObject = relatedObjects[i];\n const metaObjectId = relatedObject.GlobalId.value;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n if (metaObject) {\n if (!metaObject.propertySetIds) {\n metaObject.propertySetIds = [];\n }\n metaObject.propertySetIds.push(propertySetId);\n }\n }\n }\n\n const props = relatingPropertyDefinition.HasProperties;\n if (props && props.length > 0) {\n const propertySetType = \"Default\";\n const propertySetName = relatingPropertyDefinition.Name.value;\n const properties = [];\n for (let i = 0, len = props.length; i < len; i++) {\n const prop = props[i];\n const name = prop.Name;\n const nominalValue = prop.NominalValue;\n if (name && nominalValue) {\n const property = {\n name: name.value,\n type: nominalValue.type,\n value: nominalValue.value,\n valueType: nominalValue.valueType\n };\n if (prop.Description) {\n property.description = prop.Description.value;\n } else if (nominalValue.description) {\n property.description = nominalValue.description;\n }\n properties.push(property);\n }\n }\n ctx.xktModel.createPropertySet({propertySetId, propertySetType, propertySetName, properties});\n ctx.stats.numPropertySets++;\n }\n }\n }\n}\n\nfunction parseMetadata(ctx) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCPROJECT);\n const ifcProjectId = lines.get(0);\n const ifcProject = ctx.ifcAPI.GetLine(ctx.modelID, ifcProjectId);\n\n parseSpatialChildren(ctx, ifcProject);\n}\n\nfunction parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectType = ifcElement.__proto__.constructor.name;\n\n if (ctx.includeTypes && (!ctx.includeTypes[metaObjectType])) {\n return;\n }\n\n if (ctx.excludeTypes && ctx.excludeTypes[metaObjectType]) {\n return;\n }\n\n createMetaObject(ctx, ifcElement, parentMetaObjectId);\n\n const metaObjectId = ifcElement.GlobalId.value;\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingObject',\n 'RelatedObjects',\n ctx.WebIFC.IFCRELAGGREGATES,\n metaObjectId);\n\n parseRelatedItemsOfType(\n ctx,\n ifcElement.expressID,\n 'RelatingStructure',\n 'RelatedElements',\n ctx.WebIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,\n metaObjectId);\n}\n\nfunction createMetaObject(ctx, ifcElement, parentMetaObjectId) {\n\n const metaObjectId = ifcElement.GlobalId.value;\n const propertySetIds = null;\n const metaObjectType = ifcElement.__proto__.constructor.name;\n const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== \"\") ? ifcElement.Name.value : metaObjectType;\n\n ctx.xktModel.createMetaObject({metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId});\n ctx.stats.numMetaObjects++;\n}\n\nfunction parseRelatedItemsOfType(ctx, id, relation, related, type, parentMetaObjectId) {\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, type);\n\n for (let i = 0; i < lines.size(); i++) {\n\n const relID = lines.get(i);\n const rel = ctx.ifcAPI.GetLine(ctx.modelID, relID);\n const relatedItems = rel[relation];\n\n let foundElement = false;\n\n if (Array.isArray(relatedItems)) {\n const values = relatedItems.map((item) => item.value);\n foundElement = values.includes(id);\n\n } else {\n foundElement = (relatedItems.value === id);\n }\n\n if (foundElement) {\n\n const element = rel[related];\n\n if (!Array.isArray(element)) {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n\n } else {\n\n element.forEach((element2) => {\n\n const ifcElement = ctx.ifcAPI.GetLine(ctx.modelID, element2.value);\n\n parseSpatialChildren(ctx, ifcElement, parentMetaObjectId);\n });\n }\n }\n }\n}\n\nfunction parseGeometry(ctx) {\n\n // Parses the geometry and materials in the IFC, creates\n // XKTEntity, XKTMesh and XKTGeometry components within the XKTModel.\n\n const flatMeshes = ctx.ifcAPI.LoadAllGeometry(ctx.modelID);\n\n for (let i = 0, len = flatMeshes.size(); i < len; i++) {\n const flatMesh = flatMeshes.get(i);\n createObject(ctx, flatMesh);\n }\n\n // LoadAllGeometry does not return IFCSpace meshes\n // here is a workaround\n\n const lines = ctx.ifcAPI.GetLineIDsWithType(ctx.modelID, ctx.WebIFC.IFCSPACE);\n for (let j = 0, len = lines.size(); j < len; j++) {\n const ifcSpaceId = lines.get(j);\n const flatMesh = ctx.ifcAPI.GetFlatMesh(ctx.modelID, ifcSpaceId);\n createObject(ctx, flatMesh);\n }\n}\n\nfunction createObject(ctx, flatMesh) {\n\n const flatMeshExpressID = flatMesh.expressID;\n const placedGeometries = flatMesh.geometries;\n\n const meshIds = [];\n\n const properties = ctx.ifcAPI.GetLine(ctx.modelID, flatMeshExpressID);\n const entityId = properties.GlobalId.value;\n\n const metaObjectId = entityId;\n const metaObject = ctx.xktModel.metaObjects[metaObjectId];\n\n if (ctx.includeTypes && (!metaObject || (!ctx.includeTypes[metaObject.metaObjectType]))) {\n return;\n }\n\n if (ctx.excludeTypes && (!metaObject || ctx.excludeTypes[metaObject.metaObjectType])) {\n console.log(\"excluding: \" + metaObjectId)\n return;\n }\n\n for (let j = 0, lenj = placedGeometries.size(); j < lenj; j++) {\n\n const placedGeometry = placedGeometries.get(j);\n const geometryId = \"\" + placedGeometry.geometryExpressID;\n\n if (!ctx.xktModel.geometries[geometryId]) {\n\n const geometry = ctx.ifcAPI.GetGeometry(ctx.modelID, placedGeometry.geometryExpressID);\n const vertexData = ctx.ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());\n const indices = ctx.ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());\n\n // De-interleave vertex arrays\n\n const positions = [];\n const normals = [];\n\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n positions.push(vertexData[k * 6 + 0]);\n positions.push(vertexData[k * 6 + 1]);\n positions.push(vertexData[k * 6 + 2]);\n }\n\n if (!ctx.autoNormals) {\n for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {\n normals.push(vertexData[k * 6 + 3]);\n normals.push(vertexData[k * 6 + 4]);\n normals.push(vertexData[k * 6 + 5]);\n }\n }\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: ctx.autoNormals ? null : normals,\n indices: indices\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numVertices += (positions.length / 3);\n ctx.stats.numTriangles += (indices.length / 3);\n }\n\n const meshId = (\"mesh\" + ctx.nextId++);\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n matrix: placedGeometry.flatTransformation,\n color: [placedGeometry.color.x, placedGeometry.color.y, placedGeometry.color.z],\n opacity: placedGeometry.color.w\n });\n\n meshIds.push(meshId);\n }\n\n if (meshIds.length > 0) {\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: meshIds\n });\n ctx.stats.numObjects++;\n }\n}\n\nexport {parseIFCIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseIFCIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseIFCIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -13252,7 +13252,7 @@ "name": "src/parsers/parseLASIntoXKTModel.js", "content": "import {parse} from '@loaders.gl/core';\nimport {LASLoader} from '@loaders.gl/las';\n\nimport {math} from \"../lib/math.js\";\n\nconst MAX_VERTICES = 500000; // TODO: Rough estimate\n\n/**\n * @desc Parses LAS and LAZ point cloud data into an {@link XKTModel}.\n *\n * This parser handles both the LASER file format (LAS) and its compressed version (LAZ),\n * a public format for the interchange of 3-dimensional point cloud data data, developed\n * for LIDAR mapping purposes.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/laz/autzen.laz\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parseLASIntoXKTModel({\n * data,\n * xktModel,\n * rotateX: true,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data LAS/LAZ file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {boolean} [params.center=false] Set true to center the LAS point positions to [0,0,0]. This is applied before the transformation matrix, if specified.\n * @param {Boolean} [params.transform] 4x4 transformation matrix to transform point positions. Use this to rotate, translate and scale them if neccessary.\n * @param {Number|String} [params.colorDepth=8] Whether colors encoded using 8 or 16 bits. Can be set to 'auto'. LAS specification recommends 16 bits.\n * @param {Boolean} [params.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.\n * @param {Number} [params.skip=1] Read one from every n points.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n * @returns {Promise} Resolves when LAS has been parsed.\n */\nfunction parseLASIntoXKTModel({\n data,\n xktModel,\n center = false,\n transform = null,\n colorDepth = \"auto\",\n fp64 = false,\n skip = 1,\n stats,\n log = () => {\n }\n }) {\n\n if (log) {\n log(\"Using parser: parseLASIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n log(\"Converting LAZ/LAS\");\n\n log(`center: ${center}`);\n if (transform) {\n log(`transform: [${transform}]`);\n }\n log(`colorDepth: ${colorDepth}`);\n log(`fp64: ${fp64}`);\n log(`skip: ${skip}`);\n\n parse(data, LASLoader, {\n las: {\n colorDepth,\n fp64\n }\n }).then((parsedData) => {\n\n const attributes = parsedData.attributes;\n\n const loaderData = parsedData.loaderData;\n const pointsFormatId = loaderData.pointsFormatId !== undefined ? loaderData.pointsFormatId : -1;\n\n if (!attributes.POSITION) {\n log(\"No positions found in file (expected for all LAS point formats)\");\n return;\n }\n\n let readAttributes = {};\n\n switch (pointsFormatId) {\n case 0:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 0)\");\n return;\n }\n\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 1:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 1)\");\n return;\n }\n readAttributes = readIntensities(attributes.POSITION, attributes.intensity);\n break;\n case 2:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 2)\");\n return;\n }\n\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n case 3:\n if (!attributes.intensity) {\n log(\"No intensities found in file (expected for LAS point format 3)\");\n return;\n }\n readAttributes = readColorsAndIntensities(attributes.POSITION, attributes.COLOR_0, attributes.intensity);\n break;\n }\n\n const pointsChunks = chunkArray(readPositions(readAttributes.positions), MAX_VERTICES * 3);\n const colorsChunks = chunkArray(readAttributes.colors, MAX_VERTICES * 4);\n\n const meshIds = [];\n\n for (let j = 0, lenj = pointsChunks.length; j < lenj; j++) {\n\n const geometryId = `geometry-${j}`;\n const meshId = `mesh-${j}`;\n\n meshIds.push(meshId);\n\n xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"points\",\n positions: pointsChunks[j],\n colorsCompressed: colorsChunks[j]\n });\n\n xktModel.createMesh({\n meshId,\n geometryId\n });\n }\n\n const entityId = math.createUUID();\n\n xktModel.createEntity({\n entityId,\n meshIds\n });\n\n const rootMetaObjectId = math.createUUID();\n\n xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"PointCloud\",\n metaObjectName: \"PointCloud (LAZ)\",\n parentMetaObjectId: rootMetaObjectId\n });\n\n if (stats) {\n stats.sourceFormat = \"LAS\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = readAttributes.positions.length / 3;\n }\n\n resolve();\n\n }, (errMsg) => {\n reject(errMsg);\n });\n });\n\n function readPositions(positionsValue) {\n if (positionsValue) {\n if (center) {\n const centerPos = math.vec3();\n const numPoints = positionsValue.length;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n centerPos[0] += positionsValue[i + 0];\n centerPos[1] += positionsValue[i + 1];\n centerPos[2] += positionsValue[i + 2];\n }\n centerPos[0] /= numPoints;\n centerPos[1] /= numPoints;\n centerPos[2] /= numPoints;\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n positionsValue[i + 0] -= centerPos[0];\n positionsValue[i + 1] -= centerPos[1];\n positionsValue[i + 2] -= centerPos[2];\n }\n }\n if (transform) {\n const mat = math.mat4(transform);\n const pos = math.vec3();\n for (let i = 0, len = positionsValue.length; i < len; i += 3) {\n pos[0] = positionsValue[i + 0];\n pos[1] = positionsValue[i + 1];\n pos[2] = positionsValue[i + 2];\n math.transformPoint3(mat, pos, pos);\n positionsValue[i + 0] = pos[0];\n positionsValue[i + 1] = pos[1];\n positionsValue[i + 2] = pos[2];\n }\n }\n }\n return positionsValue;\n }\n\n function readColorsAndIntensities(attributesPosition, attributesColor, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const colors = attributesColor.value;\n const colorSize = attributesColor.size;\n const intensities = attributesIntensity.value;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n=0,len = intensities.length; i < len; i++, k += colorSize, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = colors[k + 0];\n colorsCompressed[m++] = colors[k + 1];\n colorsCompressed[m++] = colors[k + 2];\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function readIntensities(attributesPosition, attributesIntensity) {\n const positionsValue = attributesPosition.value;\n const intensities = attributesIntensity.intensity;\n const colorsCompressedSize = intensities.length * 4;\n const positions = [];\n const colorsCompressed = new Uint8Array(colorsCompressedSize / skip);\n let count = skip;\n for (let i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, len = intensities.length; i < len; i++, k += 3, j += 4, l += 3) {\n if (count <= 0) {\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = 0;\n colorsCompressed[m++] = Math.round((intensities[i] / 65536) * 255);\n positions[n++] = positionsValue[l + 0];\n positions[n++] = positionsValue[l + 1];\n positions[n++] = positionsValue[l + 2];\n count = skip;\n } else {\n count--;\n }\n }\n return {\n positions,\n colors: colorsCompressed\n };\n }\n\n function chunkArray(array, chunkSize) {\n if (chunkSize >= array.length) {\n return [array]; // One chunk\n }\n let result = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n }\n\n}\n\nexport {parseLASIntoXKTModel};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseLASIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseLASIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -13425,7 +13425,7 @@ "name": "src/parsers/parseMetaModelIntoXKTModel.js", "content": "/**\n * @desc Parses JSON metamodel into an {@link XKTModel}.\n *\n * @param {Object} params Parsing parameters.\n * @param {JSON} params.metaModelData Metamodel data.\n * @param {String[]} [params.excludeTypes] Types to exclude from parsing.\n * @param {String[]} [params.includeTypes] Types to include in parsing.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when JSON has been parsed.\n */\nfunction parseMetaModelIntoXKTModel({metaModelData, xktModel, includeTypes, excludeTypes, log}) {\n\n if (log) {\n log(\"Using parser: parseMetaModelIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n const metaObjects = metaModelData.metaObjects || [];\n const propertySets = metaModelData.propertySets || [];\n\n xktModel.modelId = metaModelData.revisionId || \"\"; // HACK\n xktModel.projectId = metaModelData.projectId || \"\";\n xktModel.revisionId = metaModelData.revisionId || \"\";\n xktModel.author = metaModelData.author || \"\";\n xktModel.createdAt = metaModelData.createdAt || \"\";\n xktModel.creatingApplication = metaModelData.creatingApplication || \"\";\n xktModel.schema = metaModelData.schema || \"\";\n\n for (let i = 0, len = propertySets.length; i < len; i++) {\n\n const propertySet = propertySets[i];\n\n xktModel.createPropertySet({\n propertySetId: propertySet.id,\n propertySetName: propertySet.name,\n propertySetType: propertySet.type,\n properties: propertySet.properties\n });\n }\n\n let includeTypesMap;\n if (includeTypes) {\n includeTypesMap = {};\n for (let i = 0, len = includeTypes.length; i < len; i++) {\n includeTypesMap[includeTypes[i]] = true;\n }\n }\n\n let excludeTypesMap;\n if (excludeTypes) {\n excludeTypesMap = {};\n for (let i = 0, len = excludeTypes.length; i < len; i++) {\n excludeTypesMap[excludeTypes[i]] = true;\n }\n }\n\n const metaObjectsMap = {};\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n const newObject = metaObjects[i];\n metaObjectsMap[newObject.id] = newObject;\n }\n\n let countMetaObjects = 0;\n\n for (let i = 0, len = metaObjects.length; i < len; i++) {\n\n const metaObject = metaObjects[i];\n const type = metaObject.type;\n\n if (excludeTypesMap && excludeTypesMap[type]) {\n continue;\n }\n\n if (includeTypesMap && !includeTypesMap[type]) {\n continue;\n }\n\n if (metaObject.parent !== undefined && metaObject.parent !== null) {\n const metaObjectParent = metaObjectsMap[metaObject.parent];\n if (metaObject.type === metaObjectParent.type) { // Don't create redundant sub-objects\n continue\n }\n }\n\n const propertySetIds = [];\n if (metaObject.propertySetIds) {\n for (let j = 0, lenj = metaObject.propertySetIds.length; j < lenj; j++) {\n const propertySetId = metaObject.propertySetIds[j];\n if (propertySetId !== undefined && propertySetId !== null && propertySetId !== \"\") {\n propertySetIds.push(propertySetId);\n }\n }\n }\n if (metaObject.propertySetId !== undefined && metaObject.propertySetId !== null && metaObject.propertySetId !== \"\") {\n propertySetIds.push(metaObject.propertySetId);\n }\n\n xktModel.createMetaObject({\n metaObjectId: metaObject.id,\n metaObjectType: metaObject.type,\n metaObjectName: metaObject.name,\n parentMetaObjectId: metaObject.parent,\n propertySetIds: propertySetIds.length > 0 ? propertySetIds : null\n });\n\n countMetaObjects++;\n }\n\n if (log) {\n log(\"Converted meta objects: \" + countMetaObjects);\n }\n\n resolve();\n });\n}\n\nexport {parseMetaModelIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseMetaModelIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseMetaModelIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -13528,7 +13528,7 @@ "name": "src/parsers/parsePCDIntoXKTModel.js", "content": "/**\n * @desc Parses PCD point cloud data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an LAZ point cloud model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"\"./models/pcd/ism_test_cat.pcd\"\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * await parsePCDIntoXKTModel({\n * data,\n * xktModel,\n * log: (msg) => { console.log(msg); }\n * }).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PCD file data.\n * @param {Boolean} [params.littleEndian=true] Whether PCD binary data is Little-Endian or Big-Endian.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PCD has been parsed.\n */\nfunction parsePCDIntoXKTModel({data, xktModel, littleEndian = true, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePCDIntoXKTModel\");\n }\n\n return new Promise(function(resolve, reject) {\n\n const textData = decodeText(new Uint8Array(data));\n\n const header = parseHeader(textData);\n\n const positions = [];\n const normals = [];\n const colors = [];\n\n if (header.data === 'ascii') {\n\n const offset = header.offset;\n const data = textData.substr(header.headerLen);\n const lines = data.split('\\n');\n\n for (let i = 0, l = lines.length; i < l; i++) {\n\n if (lines[i] === '') {\n continue;\n }\n\n const line = lines[i].split(' ');\n\n if (offset.x !== undefined) {\n positions.push(parseFloat(line[offset.x]));\n positions.push(parseFloat(line[offset.y]));\n positions.push(parseFloat(line[offset.z]));\n }\n\n if (offset.rgb !== undefined) {\n const rgb = parseFloat(line[offset.rgb]);\n const r = (rgb >> 16) & 0x0000ff;\n const g = (rgb >> 8) & 0x0000ff;\n const b = (rgb >> 0) & 0x0000ff;\n colors.push(r, g, b, 255);\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n if (header.data === 'binary_compressed') {\n\n const sizes = new Uint32Array(data.slice(header.headerLen, header.headerLen + 8));\n const compressedSize = sizes[0];\n const decompressedSize = sizes[1];\n const decompressed = decompressLZF(new Uint8Array(data, header.headerLen + 8, compressedSize), decompressedSize);\n const dataview = new DataView(decompressed.buffer);\n const offset = header.offset;\n\n for (let i = 0; i < header.points; i++) {\n\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32((header.points * offset.x) + header.size[0] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.y) + header.size[1] * i, littleEndian));\n positions.push(dataview.getFloat32((header.points * offset.z) + header.size[2] * i, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 0));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 1));\n colors.push(dataview.getUint8((header.points * offset.rgb) + header.size[3] * i + 2));\n // colors.push(255);\n } else {\n colors.push(1);\n colors.push(1);\n colors.push(1);\n }\n }\n }\n\n if (header.data === 'binary') {\n\n const dataview = new DataView(data, header.headerLen);\n const offset = header.offset;\n\n for (let i = 0, row = 0; i < header.points; i++, row += header.rowSize) {\n if (offset.x !== undefined) {\n positions.push(dataview.getFloat32(row + offset.x, littleEndian));\n positions.push(dataview.getFloat32(row + offset.y, littleEndian));\n positions.push(dataview.getFloat32(row + offset.z, littleEndian));\n }\n\n if (offset.rgb !== undefined) {\n colors.push(dataview.getUint8(row + offset.rgb + 2));\n colors.push(dataview.getUint8(row + offset.rgb + 1));\n colors.push(dataview.getUint8(row + offset.rgb + 0));\n } else {\n colors.push(255);\n colors.push(255);\n colors.push(255);\n }\n }\n }\n\n xktModel.createGeometry({\n geometryId: \"pointsGeometry\",\n primitiveType: \"points\",\n positions: positions,\n colors: colors && colors.length > 0 ? colors : null\n });\n\n xktModel.createMesh({\n meshId: \"pointsMesh\",\n geometryId: \"pointsGeometry\"\n });\n\n xktModel.createEntity({\n entityId: \"geometries\",\n meshIds: [\"pointsMesh\"]\n });\n\n if (log) {\n log(\"Converted drawable objects: 1\");\n log(\"Converted geometries: 1\");\n log(\"Converted vertices: \" + positions.length / 3);\n }\n\n if (stats) {\n stats.sourceFormat = \"PCD\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = positions.length / 3;\n }\n\n resolve();\n });\n}\n\nfunction parseHeader(data) {\n const header = {};\n const result1 = data.search(/[\\r\\n]DATA\\s(\\S*)\\s/i);\n const result2 = /[\\r\\n]DATA\\s(\\S*)\\s/i.exec(data.substr(result1 - 1));\n header.data = result2[1];\n header.headerLen = result2[0].length + result1;\n header.str = data.substr(0, header.headerLen);\n header.str = header.str.replace(/\\#.*/gi, ''); // Strip comments\n header.version = /VERSION (.*)/i.exec(header.str); // Parse\n header.fields = /FIELDS (.*)/i.exec(header.str);\n header.size = /SIZE (.*)/i.exec(header.str);\n header.type = /TYPE (.*)/i.exec(header.str);\n header.count = /COUNT (.*)/i.exec(header.str);\n header.width = /WIDTH (.*)/i.exec(header.str);\n header.height = /HEIGHT (.*)/i.exec(header.str);\n header.viewpoint = /VIEWPOINT (.*)/i.exec(header.str);\n header.points = /POINTS (.*)/i.exec(header.str);\n if (header.version !== null) {\n header.version = parseFloat(header.version[1]);\n }\n if (header.fields !== null) {\n header.fields = header.fields[1].split(' ');\n }\n if (header.type !== null) {\n header.type = header.type[1].split(' ');\n }\n if (header.width !== null) {\n header.width = parseInt(header.width[1]);\n }\n if (header.height !== null) {\n header.height = parseInt(header.height[1]);\n }\n if (header.viewpoint !== null) {\n header.viewpoint = header.viewpoint[1];\n }\n if (header.points !== null) {\n header.points = parseInt(header.points[1], 10);\n }\n if (header.points === null) {\n header.points = header.width * header.height;\n }\n if (header.size !== null) {\n header.size = header.size[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (header.count !== null) {\n header.count = header.count[1].split(' ').map(function (x) {\n return parseInt(x, 10);\n });\n } else {\n header.count = [];\n for (let i = 0, l = header.fields.length; i < l; i++) {\n header.count.push(1);\n }\n }\n header.offset = {};\n let sizeSum = 0;\n for (let i = 0, l = header.fields.length; i < l; i++) {\n if (header.data === 'ascii') {\n header.offset[header.fields[i]] = i;\n } else {\n header.offset[header.fields[i]] = sizeSum;\n sizeSum += header.size[i] * header.count[i];\n }\n }\n header.rowSize = sizeSum; // For binary only\n return header;\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]);\n }\n try {\n return decodeURIComponent(escape(s));\n } catch (e) {\n return s;\n }\n}\n\nfunction decompressLZF(inData, outLength) { // https://gitlab.com/taketwo/three-pcd-loader/blob/master/decompress-lzf.js\n const inLength = inData.length;\n const outData = new Uint8Array(outLength);\n let inPtr = 0;\n let outPtr = 0;\n let ctrl;\n let len;\n let ref;\n do {\n ctrl = inData[inPtr++];\n if (ctrl < (1 << 5)) {\n ctrl++;\n if (outPtr + ctrl > outLength) throw new Error('Output buffer is not large enough');\n if (inPtr + ctrl > inLength) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = inData[inPtr++];\n } while (--ctrl);\n } else {\n len = ctrl >> 5;\n ref = outPtr - ((ctrl & 0x1f) << 8) - 1;\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n if (len === 7) {\n len += inData[inPtr++];\n if (inPtr >= inLength) throw new Error('Invalid compressed data');\n }\n ref -= inData[inPtr++];\n if (outPtr + len + 2 > outLength) throw new Error('Output buffer is not large enough');\n if (ref < 0) throw new Error('Invalid compressed data');\n if (ref >= outPtr) throw new Error('Invalid compressed data');\n do {\n outData[outPtr++] = outData[ref++];\n } while (--len + 2);\n }\n } while (inPtr < inLength);\n return outData;\n}\n\nexport {parsePCDIntoXKTModel};", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parsePCDIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parsePCDIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -13732,7 +13732,7 @@ "name": "src/parsers/parsePLYIntoXKTModel.js", "content": "import {parse} from '@loaders.gl/core';\nimport {PLYLoader} from '@loaders.gl/ply';\n\n/**\n * @desc Parses PLY file data into an {@link XKTModel}.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load a PLY model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/ply/test.ply\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parsePLYIntoXKTModel({data, xktModel}).then(()=>{\n * xktModel.finalize();\n * },\n * (msg) => {\n * console.error(msg);\n * });\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer} params.data PLY file data.\n * @param {XKTModel} params.xktModel XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when PLY has been parsed.\n */\nasync function parsePLYIntoXKTModel({data, xktModel, stats, log}) {\n\n if (log) {\n log(\"Using parser: parsePLYIntoXKTModel\");\n }\n\n if (!data) {\n throw \"Argument expected: data\";\n }\n\n if (!xktModel) {\n throw \"Argument expected: xktModel\";\n }\n\n let parsedData;\n try {\n parsedData = await parse(data, PLYLoader);\n } catch (e) {\n if (log) {\n log(\"Error: \" + e);\n }\n return;\n }\n\n const attributes = parsedData.attributes;\n const hasColors = !!attributes.COLOR_0;\n\n if (hasColors) {\n const colorsValue = hasColors ? attributes.COLOR_0.value : null;\n const colorsCompressed = [];\n for (let i = 0, len = colorsValue.length; i < len; i += 4) {\n colorsCompressed.push(colorsValue[i]);\n colorsCompressed.push(colorsValue[i + 1]);\n colorsCompressed.push(colorsValue[i + 2]);\n }\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : [],\n colorsCompressed: colorsCompressed\n });\n } else {\n xktModel.createGeometry({\n geometryId: \"plyGeometry\",\n primitiveType: \"triangles\",\n positions: attributes.POSITION.value,\n indices: parsedData.indices ? parsedData.indices.value : []\n });\n }\n\n xktModel.createMesh({\n meshId: \"plyMesh\",\n geometryId: \"plyGeometry\",\n color: (!hasColors) ? [1, 1, 1] : null\n });\n\n xktModel.createEntity({\n entityId: \"ply\",\n meshIds: [\"plyMesh\"]\n });\n\n if (stats) {\n stats.sourceFormat = \"PLY\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numVertices = attributes.POSITION.value.length / 3;\n }\n}\n\nexport {parsePLYIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parsePLYIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parsePLYIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -13825,7 +13825,7 @@ "name": "src/parsers/parseSTLIntoXKTModel.js", "content": "import {faceToVertexNormals} from \"../lib/faceToVertexNormals.js\";\nimport {math} from \"../lib/math.js\";\n\n/**\n * @desc Parses STL file data into an {@link XKTModel}.\n *\n * * Supports binary and ASCII STL formats.\n * * Option to create a separate {@link XKTEntity} for each group of faces that share the same vertex colors.\n * * Option to smooth face-aligned normals loaded from STL.\n * * Option to reduce XKT file size by ignoring STL normals and relying on xeokit to auto-generate them.\n *\n * ## Usage\n *\n * In the example below we'll create an {@link XKTModel}, then load an STL model into it.\n *\n * ````javascript\n * utils.loadArraybuffer(\"./models/stl/binary/spurGear.stl\", async (data) => {\n *\n * const xktModel = new XKTModel();\n *\n * parseSTLIntoXKTModel({data, xktModel});\n *\n * xktModel.finalize();\n * });\n * ````\n *\n * @param {Object} params Parsing params.\n * @param {ArrayBuffer|String} [params.data] STL file data. Can be binary or string.\n * @param {Boolean} [params.autoNormals=false] When true, the parser will ignore the STL geometry normals, and the STL\n * data will rely on the xeokit ````Viewer```` to automatically generate them. This has the limitation that the\n * normals will be face-aligned, and therefore the ````Viewer```` will only be able to render a flat-shaded representation\n * of the STL.\n * Overrides ````smoothNormals```` when ````true````. This ignores the normals in the STL, and loads no\n * normals from the STL into the {@link XKTModel}, resulting in the XKT file storing no normals for the STL model. The\n * xeokit-sdk will then automatically generate the normals within its shaders. The disadvantages are that auto-normals\n * may slow rendering down a little bit, and that the normals can only be face-aligned (and thus rendered using flat\n * shading). The advantages, however, are a smaller XKT file size, and the ability to apply certain geometry optimizations\n * during parsing, such as removing duplicated STL vertex positions, that are not possible when normals are loaded\n * for the STL vertices.\n * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented STL normals to vertex normals, for a smooth appearance. Ignored if ````autoNormals```` is ````true````.\n * @param {Number} [params.smoothNormalsAngleThreshold=20] This is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.\n * @param {Boolean} [params.splitMeshes=true] When true, creates a separate {@link XKTEntity} for each group of faces that share the same vertex colors. Only works with binary STL (ie. when ````data```` is an ArrayBuffer).\n * @param {XKTModel} [params.xktModel] XKTModel to parse into.\n * @param {Object} [params.stats] Collects statistics.\n * @param {function} [params.log] Logging callback.\n @returns {Promise} Resolves when STL has been parsed.\n */\nasync function parseSTLIntoXKTModel({\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n stats,\n log\n }) {\n\n if (log) {\n log(\"Using parser: parseSTLIntoXKTModel\");\n }\n\n return new Promise(function (resolve, reject) {\n\n if (!data) {\n reject(\"Argument expected: data\");\n return;\n }\n\n if (!xktModel) {\n reject(\"Argument expected: xktModel\");\n return;\n }\n\n const rootMetaObjectId = math.createUUID();\n\n const rootMetaObject = xktModel.createMetaObject({\n metaObjectId: rootMetaObjectId,\n metaObjectType: \"Model\",\n metaObjectName: \"Model\"\n });\n\n const ctx = {\n data,\n splitMeshes,\n autoNormals,\n smoothNormals,\n smoothNormalsAngleThreshold,\n xktModel,\n rootMetaObject,\n nextId: 0,\n log: (log || function (msg) {\n }),\n stats: {\n numObjects: 0,\n numGeometries: 0,\n numTriangles: 0,\n numVertices: 0\n }\n };\n\n const binData = ensureBinary(data);\n\n if (isBinary(binData)) {\n parseBinary(ctx, binData);\n } else {\n parseASCII(ctx, ensureString(data));\n }\n\n if (stats) {\n stats.sourceFormat = \"STL\";\n stats.schemaVersion = \"\";\n stats.title = \"\";\n stats.author = \"\";\n stats.created = \"\";\n stats.numMetaObjects = 2;\n stats.numPropertySets = 0;\n stats.numObjects = 1;\n stats.numGeometries = 1;\n stats.numTriangles = ctx.stats.numTriangles;\n stats.numVertices = ctx.stats.numVertices;\n }\n\n resolve();\n });\n}\n\nfunction isBinary(data) {\n const reader = new DataView(data);\n const numFaces = reader.getUint32(80, true);\n const faceSize = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);\n const numExpectedBytes = 80 + (32 / 8) + (numFaces * faceSize);\n if (numExpectedBytes === reader.byteLength) {\n return true;\n }\n const solid = [115, 111, 108, 105, 100];\n for (let i = 0; i < 5; i++) {\n if (solid[i] !== reader.getUint8(i, false)) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseBinary(ctx, data) {\n const reader = new DataView(data);\n const faces = reader.getUint32(80, true);\n let r;\n let g;\n let b;\n let hasColors = false;\n let colors;\n let defaultR;\n let defaultG;\n let defaultB;\n let lastR = null;\n let lastG = null;\n let lastB = null;\n let newMesh = false;\n let alpha;\n for (let index = 0; index < 80 - 10; index++) {\n if ((reader.getUint32(index, false) === 0x434F4C4F /*COLO*/) &&\n (reader.getUint8(index + 4) === 0x52 /*'R'*/) &&\n (reader.getUint8(index + 5) === 0x3D /*'='*/)) {\n hasColors = true;\n colors = [];\n defaultR = reader.getUint8(index + 6) / 255;\n defaultG = reader.getUint8(index + 7) / 255;\n defaultB = reader.getUint8(index + 8) / 255;\n alpha = reader.getUint8(index + 9) / 255;\n }\n }\n let dataOffset = 84;\n let faceLength = 12 * 4 + 2;\n let positions = [];\n let normals = [];\n let splitMeshes = ctx.splitMeshes;\n for (let face = 0; face < faces; face++) {\n let start = dataOffset + face * faceLength;\n let normalX = reader.getFloat32(start, true);\n let normalY = reader.getFloat32(start + 4, true);\n let normalZ = reader.getFloat32(start + 8, true);\n if (hasColors) {\n let packedColor = reader.getUint16(start + 48, true);\n if ((packedColor & 0x8000) === 0) {\n r = (packedColor & 0x1F) / 31;\n g = ((packedColor >> 5) & 0x1F) / 31;\n b = ((packedColor >> 10) & 0x1F) / 31;\n } else {\n r = defaultR;\n g = defaultG;\n b = defaultB;\n }\n if (splitMeshes && r !== lastR || g !== lastG || b !== lastB) {\n if (lastR !== null) {\n newMesh = true;\n }\n lastR = r;\n lastG = g;\n lastB = b;\n }\n }\n for (let i = 1; i <= 3; i++) {\n let vertexstart = start + i * 12;\n positions.push(reader.getFloat32(vertexstart, true));\n positions.push(reader.getFloat32(vertexstart + 4, true));\n positions.push(reader.getFloat32(vertexstart + 8, true));\n if (!ctx.autoNormals) {\n normals.push(normalX, normalY, normalZ);\n }\n if (hasColors) {\n colors.push(r, g, b, 1); // TODO: handle alpha\n }\n }\n if (splitMeshes && newMesh) {\n addMesh(ctx, positions, normals, colors);\n positions = [];\n normals = [];\n colors = colors ? [] : null;\n newMesh = false;\n }\n }\n if (positions.length > 0) {\n addMesh(ctx, positions, normals, colors);\n }\n}\n\nfunction parseASCII(ctx, data) {\n const faceRegex = /facet([\\s\\S]*?)endfacet/g;\n let faceCounter = 0;\n const floatRegex = /[\\s]+([+-]?(?:\\d+.\\d+|\\d+.|\\d+|.\\d+)(?:[eE][+-]?\\d+)?)/.source;\n const vertexRegex = new RegExp('vertex' + floatRegex + floatRegex + floatRegex, 'g');\n const normalRegex = new RegExp('normal' + floatRegex + floatRegex + floatRegex, 'g');\n const positions = [];\n const normals = [];\n const colors = null;\n let normalx;\n let normaly;\n let normalz;\n let result;\n let verticesPerFace;\n let normalsPerFace;\n let text;\n while ((result = faceRegex.exec(data)) !== null) {\n verticesPerFace = 0;\n normalsPerFace = 0;\n text = result[0];\n while ((result = normalRegex.exec(text)) !== null) {\n normalx = parseFloat(result[1]);\n normaly = parseFloat(result[2]);\n normalz = parseFloat(result[3]);\n normalsPerFace++;\n }\n while ((result = vertexRegex.exec(text)) !== null) {\n positions.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3]));\n normals.push(normalx, normaly, normalz);\n verticesPerFace++;\n }\n if (normalsPerFace !== 1) {\n ctx.log(\"Error in normal of face \" + faceCounter);\n return -1;\n }\n if (verticesPerFace !== 3) {\n ctx.log(\"Error in positions of face \" + faceCounter);\n return -1;\n }\n faceCounter++;\n }\n addMesh(ctx, positions, normals, colors);\n}\n\nlet nextGeometryId = 0;\n\nfunction addMesh(ctx, positions, normals, colors) {\n\n const indices = new Int32Array(positions.length / 3);\n for (let ni = 0, len = indices.length; ni < len; ni++) {\n indices[ni] = ni;\n }\n\n normals = normals && normals.length > 0 ? normals : null;\n colors = colors && colors.length > 0 ? colors : null;\n\n if (!ctx.autoNormals && ctx.smoothNormals) {\n faceToVertexNormals(positions, normals, {smoothNormalsAngleThreshold: ctx.smoothNormalsAngleThreshold});\n }\n\n const geometryId = \"\" + nextGeometryId++;\n const meshId = \"\" + nextGeometryId++;\n const entityId = \"\" + nextGeometryId++;\n\n ctx.xktModel.createGeometry({\n geometryId: geometryId,\n primitiveType: \"triangles\",\n positions: positions,\n normals: (!ctx.autoNormals) ? normals : null,\n colors: colors,\n indices: indices\n });\n\n ctx.xktModel.createMesh({\n meshId: meshId,\n geometryId: geometryId,\n color: colors ? null : [1, 1, 1],\n metallic: 0.9,\n roughness: 0.1\n });\n\n ctx.xktModel.createEntity({\n entityId: entityId,\n meshIds: [meshId]\n });\n\n ctx.xktModel.createMetaObject({\n metaObjectId: entityId,\n metaObjectType: \"Default\",\n metaObjectName: \"STL Mesh\",\n parentMetaObjectId: ctx.rootMetaObject.metaObjectId\n });\n\n ctx.stats.numGeometries++;\n ctx.stats.numObjects++;\n ctx.stats.numVertices += positions.length / 3;\n ctx.stats.numTriangles += indices.length / 3;\n}\n\nfunction ensureString(buffer) {\n if (typeof buffer !== 'string') {\n return decodeText(new Uint8Array(buffer));\n }\n return buffer;\n}\n\nfunction ensureBinary(buffer) {\n if (typeof buffer === 'string') {\n const arrayBuffer = new Uint8Array(buffer.length);\n for (let i = 0; i < buffer.length; i++) {\n arrayBuffer[i] = buffer.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n }\n return arrayBuffer.buffer || arrayBuffer;\n } else {\n return buffer;\n }\n}\n\nfunction decodeText(array) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(array);\n }\n let s = '';\n for (let i = 0, il = array.length; i < il; i++) {\n s += String.fromCharCode(array[i]); // Implicitly assumes little-endian.\n }\n return decodeURIComponent(escape(s));\n}\n\nexport {parseSTLIntoXKTModel};\n", "static": true, - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/src/parsers/parseSTLIntoXKTModel.js", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/src/parsers/parseSTLIntoXKTModel.js", "access": "public", "description": null, "lineNumber": 1 @@ -14224,15 +14224,15 @@ { "kind": "index", "content": "# xeokit-convert\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/xeolabs?style=social)](https://twitter.com/xeolabs)\n[![npm version](https://badge.fury.io/js/%40xeokit%2Fxeokit-convert.svg)](https://badge.fury.io/js/%40xeokit%2Fxeokit-convert)\n\nUse **xeokit-convert** to:\n\n* Convert BIM and AEC models directly into XKT files for super fast loading into [xeokit](https://xeokit.io)\n* Generate XKT files with JavaScript\n\n> xeokit-convert replaces [xeokit-gltf-to-xkt](https://github.com/xeokit/xeokit-gltf-to-xkt) and [xeokit-xkt-utils](https://github.com/xeokit/xeokit-xkt-utils), which are deprecated.\n\n> CAUTION: Direct IFC conversion is an alpha status feature, since it depends on [web-ifc](https://github.com/tomvandig/web-ifc), a 3rd-party library, which is also alpha at this time. As such, some IFC models may not convert properly. If this is the case for your models, consider using our [standard conversion setup](https://www.notion.so/xeokit/Converting-IFC-Models-using-3rd-Party-Open-Source-Tools-c373e48bc4094ff5b6e5c5700ff580ee)\nuntil issues have been resolved.\n\n[![View Revit Sample IFC in xeokit](https://xeokit.github.io/xeokit-ifc-to-xkt/assets/rac_advanced_sample_project.png)](https://xeokit.github.io/xeokit-convert/demos/demoXKT.html?xktSrc=.././assets/models/xkt/ifc_rac_advanced_sample_project/model.xkt)\n\n* [[View this XKT model](https://xeokit.github.io/xeokit-convert/demos/demoXKT.html?xktSrc=.././assets/models/xkt/ifc_rac_advanced_sample_project/model.xkt)]\n\n---\n\n# Contents\n\n- [Introduction](#introduction)\n- [Acknowledgements](#acknowledgements)\n- [Resources](#resources)\n- [Features](#features)\n- [Installing](#installing)\n- [Components](#components)\n- [Using ````convert2xkt````](#using-----convert2xkt----)\n + [Converting an IFC file into an XKT file on the command line](#converting-an-ifc-file-into-an-xkt-file-on-the-command-line)\n + [Viewing the XKT file with xeokit](#viewing-the-xkt-file-with-xeokit)\n + [Querying the XKT version in Node.js](#querying-the-xkt-version-in-nodejs)\n + [Converting an IFC file into an XKT file in Node.js](#converting-an-ifc-file-into-an-xkt-file-in-nodejs)\n + [Converting IFC file data into XKT data in Node.js](#converting-ifc-file-data-into-xkt-data-in-nodejs)\n- [Converting Split Files Output from ````ifc2gltf````](#converting-split-files-from-ifc2gltf)\n- [Using ````XKTModel````](#using-----xktmodel----)\n + [Programmatically Building an XKT File](#programmatically-building-an-xkt-file)\n + [Serializing the XKTModel to an ArrayBuffer](#serializing-the-xktmodel-to-an-arraybuffer)\n + [Loading the ArrayBuffer into a Viewer](#loading-the-arraybuffer-into-a-viewer)\n + [Loading IFC into an XKTModel](#loading-ifc-into-an-xktmodel)\n + [Loading LAS into an XKTModel](#loading-las-into-an-xktmodel)\n + [Loading glTF into an XKTModel](#loading-gltf-into-an-xktmodel)\n + [Loading STL into an XKTModel](#loading-stl-into-an-xktmodel)\n- [Building](#building)\n + [Building Binaries](#building-binaries)\n\n---\n\n# Introduction\n\n[````xeokit-convert````](https://github.com/xeokit/xeokit-convert) provides the means to convert 3D BIM and AEC models\ninto XKT files for super fast loading into [xeokit](https://xeokit.io), along with programming tools to generate XKT\nfiles with JavaScript on Node.js.\n\nThe [XKT format](https://github.com/xeokit/xeokit-convert/tree/master/specs) compresses large double-precision models to\na compact payload that loads quickly over the Web into a xeokit viewer running in the browser. We can use xeokit-convert\nto convert several source formats into XKT, such as IFC, glTF and CityJSON.\n\n# Acknowledgements\n\nOur thanks to the authors of these open source libraries, which we use internally within ````xeokit-convert````:\n\n* [loaders.gl](https://loaders.gl) - Copyright (C) 2015 Uber Technologies,\n Inc. ([MIT License](http://www.opensource.org/licenses/mit-license.php))\n* [Basis Universal](https://github.com/BinomialLLC/basis_universal) - Binomal\n LLC, ([Apache 2 License](http://www.apache.org/licenses/LICENSE-2.0))\n* [Pako](https://github.com/nodeca/pako) - Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei\n Tuputcyn ([MIT License](http://www.opensource.org/licenses/mit-license.php))\n* [earcut](https://github.com/mapbox/earcut) - Copyright (C) 2016,\n Mapbox ([ISC License](https://opensource.org/licenses/ISC))\n* [web-ifc](https://github.com/tomvandig/web-ifc) - Copyright (C) 2020-2021 web-ifc\n contributors ([Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/))\n\n# Resources\n\n* [npm](https://www.npmjs.com/package/@xeokit/xeokit-convert)\n* [API Docs](https://xeokit.github.io/xeokit-convert/docs)\n* [Source Code](https://github.com/xeokit/xeokit-convert)\n* [Releases / Changelog](https://github.com/xeokit/xeokit-convert/releases)\n* [XKT Specifications](https://xeokit.github.io/xeokit-convert/specs/)\n\n# Features\n\n* A Node-based CLI tool to convert various 3D model formats to XKT files.\n* A JavaScript toolkit of components for loading, generating and saving XKT files.\n\n# Installing\n\n````bash\nnpm i @xeokit/xeokit-convert\n````\n\nIf you get ````RuntimeError: memory access out of bounds```` while converting IFC, then you'll need to compile the\n3rd-party web-ifc WASM module for your system - see [Building Binaries](#building-binaries).\n\n# Components\n\nThe table below lists the components provided by ````xeokit-convert````.\n\nAt the center of the toolkit, we've got the converter tool, provided as both a Node.js function and CLI executable.\n\nBundled with the converter, we've got the XKT document model, a bunch of loaders for different formats, and a function\nto serialize the document model to a BLOB. We use these components within the converter tool, and also provide them as\npart of the public API for extensibility.\n\n| Component | Description |\n| --- | --- |\n| [convert2xkt](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-convert2xkt) (function)
[convert2xkt](https://github.com/xeokit/xeokit-convert/blob/master/convert2xkt.js) (Node script)| A Node-based JavaScript function and CLI tool that converts various AEC model formats into xeokit's native, super-fast-loading XKT format. |\n| [XKTModel](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) | A JavaScript document model that represents the contents of an XKT file in memory. Using this, we can programmatically build a document model in JavaScript, adding geometries, materials, objects etc, then serialize it to an XKT file. |\n| [parseIFCIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseIFCIntoXKTModel) | Parses IFC data into an ````XKTModel````. This is an alpha-status feature. |\n| [parseGLTFIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseGLTFIntoXKTModel) | Parses glTF into an ````XKTModel````. Supports all glTF formats, along with textures. |\n| [parseGLTFJSONIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseGLTFJSONIntoXKTModel) | Parses glTF JSON into an ````XKTModel````. Our original lightweight glTF parser that does not support ````.glb```` and textures. |\n| [parseCityJSONIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseJSONIntoXKTModel) | Parses CityJSON into an ````XKTModel```` |\n| [parseLASIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseLASIntoXKTModel) | Parses LAS and LAZ into an ````XKTModel```` |\n| [parseSTLIntoXKTModel](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseSTLIntoXKTModel) | Parses STL into an ````XKTModel```` |\n| [writeXKTModelToArrayBuffer](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-writeXKTModelToArrayBuffer) | Serializes an ````XKTModel```` to an XKT file |\n\n# Using ````convert2xkt````\n\nThe ````convert2xkt```` tool converts various model formats into xeokit's native XKT format, which is designed to load\nsuper fast over the Web into a xeokit viewer. We provide this tool as both a [CLI script]() and as\na [function](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-convert2xkt) to use within\nour own Node scripts.\n\n````bash\nnode convert2xkt.js -h\n\nUsage: convert2xkt [options]\n\nOptions:\n -v, --version output the version number\n -s, --source [file] path to source file\n -a, --sourcemanifest [file] path to source manifest file (for converting split file output from ifcgltf -s)\n -f, --format [string] source file format (optional); supported formats are gltf, ifc, laz, las, pcd, ply, stl and cityjson\n -m, --metamodel [file] path to source metamodel JSON file (optional)\n -i, --include [types] only convert these types (optional)\n -x, --exclude [types] never convert these types (optional)\n -r, --rotatex rotate model 90 degrees about X axis (for las and cityjson)\n -g, --disablegeoreuse disable geometry reuse (optional)\n -z, --mintilesize [number] minimum diagonal tile size (optional, default 500)\n -t, --disabletextures ignore textures (optional)\n -n, --disablenormals ignore normals (optional)\n -o, --output [file] path to target .xkt file when -s option given, or JSON manifest for multiple .xkt files when source manifest file given with -a; creates directories on path automatically if not existing\n -l, --log enable logging (optional)\n -h, --help display help for command\n\nXKT version: 10\n````\n\n### Converting an IFC file into an XKT file on the command line\n\nLet's use the [convert2xkt](https://github.com/xeokit/xeokit-convert/blob/master/convert2xkt.js) Node script to convert\nan IFC file to XKT on the command line.\n\n````bash\nnode convert2xkt.js -s rme_advanced_sample_project.ifc -o rme_advanced_sample_project.ifc.xkt -l\n\n[convert2xkt] Reading input file: rme_advanced_sample_project.ifc\n[convert2xkt] Input file size: 35309.94 kB\n[convert2xkt] Geometry reuse is enabled\n[convert2xkt] Converting...\n[convert2xkt] Converted to: XKT v9\n[convert2xkt] XKT size: 1632.98 kB\n[convert2xkt] Compression ratio: 21.62\n[convert2xkt] Conversion time: 54.41 s\n[convert2xkt] Converted metaobjects: 0\n[convert2xkt] Converted property sets: 0\n[convert2xkt] Converted drawable objects: 1986\n[convert2xkt] Converted geometries: 3897\n[convert2xkt] Converted triangles: 286076\n[convert2xkt] Converted vertices: 547740\n[convert2xkt] reuseGeometries: false\n[convert2xkt] minTileSize: 10000\n[convert2xkt] Writing XKT file: rme_advanced_sample_project.ifc.xkt\n````\n\n### Viewing the XKT file with xeokit\n\nNow that we've got an XKT file, we can now view it in the browser using a\nxeokit [Viewer](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html) configured with\nan [XKTLoaderPlugin](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html)\n.\n\n````javascript\nimport {Viewer, XKTLoaderPlugin} from\n \"https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk@1/dist/xeokit-sdk.es.min.js\";\n\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nconst modelNode = xktLoader.load({\n id: \"myModel\",\n src: \"./rme_sample_project.ifc.xkt\"\n});\n````\n\n### Querying the XKT version in Node.js\n\nFrom with a Node script, we can query which XKT version ````xeokit-convert```` currently generates:\n\n````javascript\nconst {XKT_INFO} = require(\"./dist/xeokit-convert.cjs.js\");\n\nconst xktVersion = XKT_INFO.xktVersion; // Unsigned integer\nconsole.log(`XKT version: ${xktVersion}`);\n````\n\n### Converting an IFC file into an XKT file in Node.js\n\nWe can use\nthe [convert2xkt](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-convert2xkt)\nfunction from within our Nodejs scripts to programmatically convert files to XKT.\n\n````javascript\nconst convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\n\nconvert2xkt({\n source: \"rme_advanced_sample_project.ifc\",\n output: \"rme_advanced_sample_project.ifc.xkt\",\n log: (msg) => {\n console.log(msg)\n }\n}).then(() => {\n console.log(\"Converted.\");\n}, (errMsg) => {\n console.error(\"Conversion failed: \" + errMsg)\n});\n````\n\n### Converting IFC file data into XKT data in Node.js\n\nWhen using\nthe [convert2xkt](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-convert2xkt)\nfunction in our Node scripts, we can manage all file data in memory.\n\nThis is great for when we want more control over where we read and write the files.\n\n````javascript\nconst convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\nconst fs = require('fs');\n\nconvert2xkt({\n sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n outputXKT: (xtkArrayBuffer) => {\n fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n }\n}).then(() => {\n console.log(\"Converted.\");\n}, (errMsg) => {\n console.error(\"Conversion failed: \" + errMsg)\n});\n````\n\nWhen using\nthe [convert2xkt](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-convert2xkt)\nfunction in our Node scripts, we can manage all file data in memory.\n\nThis is great for when we want more control over where we read and write the files.\n\n````javascript\nconst convert2xkt = require(\"@xeokit/xeokit-convert/dist/convert2xkt.cjs.js\");\nconst fs = require('fs');\n\nconvert2xkt({\n sourceData: fs.readFileSync(\"rme_advanced_sample_project.ifc\"),\n outputXKT: (xtkArrayBuffer) => {\n fs.writeFileSync(\"rme_advanced_sample_project.ifc.xkt\", xtkArrayBuffer);\n }\n}).then(() => {\n console.log(\"Converted.\");\n}, (errMsg) => {\n console.error(\"Conversion failed: \" + errMsg)\n});\n````\n\n# Converting Split Files Output from ````ifc2gltf````\n\nThe ````ifc2gltf```` tool has the option to convert IFC files into multiple glTF/GLB and JSON metadata files. We can then use ````convert2xkt```` to convert each of these \nfiles individually. This allows us to convert a huge IFC files into several, smaller XKT files, then load \nthose XKT files individually into a xeokit Viewer.\n\n## Usage\n\nRun ````ifc2gltf```` with the ````-s```` option, to convert an IFC file into a set of multiple ````glb```` geometry and ````json```` metadata files:\n\n````\nifc2gltfcxconverter -i model.ifc -o myGLBFiles/model.glb -m myGLBFiles/model.json -s 5 -e 3\n````\n\nThe ````ifc2gltf```` ````-s 5```` option causes ````ifc2gltf```` to split the output into these multiple files, each no bigger than 5Gb.\n\nThe contents of the ````myGLBFiles```` directory then looks like this:\n\n````\nmyGLBFiles\n├── model.glb\n├── model.json\n├── model_1.glb\n├── model_1.json\n├── model_2.glb\n├── model_2.json\n├── model_3.glb\n├── model_3.json\n└── model.glb.manifest.json\n````\n\nNow run ````convert2xkt```` with the ````-a```` option, pointing to the ````myGLBFiles/model.glb.manifest.json```` file:\n\n````bash\nnode convert2xkt.js -a myGLBFiles/model.glb.manifest.json -o myXKTFiles -l\n````\n\nThe contents of ````myXKTFiles```` now look like this:\n\n````\nmyXKTFiles\n├── model.xkt\n├── model_1.xkt\n├── model_2.xkt\n├── model_3.xkt\n└── model.xkt.manifest.json\n````\n\nThe ````model.xkt.manifest```` file looks like this:\n\n````json\n{\n \"inputFile\": \"/absolute/path/myGLBFiles/model.glb.manifest.json\",\n \"converterApplication\": \"convert2xkt\",\n \"converterApplicationVersion\": \"v1.1.8\",\n \"conversionDate\": \"09-08-2023- 23-53-30\",\n \"outputDir\": \"/absolute/path/myXKTFiles\",\n \"xktFiles\": [\n \"model.xkt\",\n \"model_1.xkt\",\n \"model_2.xkt\",\n \"model_3.xkt\"\n ]\n}\n````\n\nWe can then load those XKT files into a xeokit Viewer, and the Viewer will automaticlly combine their geometry and metadata into the same scene. \n# Using ````XKTModel````\n\n````XKTModel```` is a JavaScript class that represents the contents of an XKT file in memory.\n\nIt's a sort of *XKT document model*, with methods to build 3D objects within it, functions to import various model\nformats, and a function to serialize it to an XKT file.\n\nWe can use these tools to:\n\n* programmatically XKT files,\n* combine multiple models into an XKT file, from different formats,\n* develop custom XKT converters, and\n* extend ````convert2xkt```` to support more formats.\n\n### Programmatically Building an XKT File\n\nTo demonstrate the API, let's\nuse [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) 's\nbuilder methods to programmatically build a model that resembles the screenshot below. Then we'll serialize\nthe ````XKTModel```` to an\n````ArrayBuffer````, which we'll finally load that into a\nxeokit [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html)\nusing [````XKTLoaderPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html)\n.\n\nWe'll code this example to run in the browser, using the ES module\nin [xeokit-convert.es.js](./dist/xeokit-convert.es.js). We could also code it to run on node, using the CommonJS module\nin [xeokit-convert.cjs.js](./dist/xeokit-convert.cjs.js).\n\n![XKTModel Example](http://xeokit.io/img/docs/PerformanceModel/PerformanceModel.png)\n\n````javascript\nconst {\n XKTModel,\n writeXKTModelToArrayBuffer\n} = require(\"@xeokit/xeokit-convert/dist/xeokit-convert.cjs.js\");\nconst fs = require('fs');\n\nconst xktModel = new XKTModel();\n\n// Create metamodel - this part is optional\n\n// Create property sets to hold info about the model\n\nxktModel.createPropertySet({\n propertySetId: \"tableTopPropSet\",\n propertySetType: \"Default\",\n propertySetName: \"Table Top\",\n properties: [\n {\n id: \"tableTopMaterial\",\n type: \"Default\",\n name: \"Table top material\",\n value: \"Marble\"\n },\n {\n id: \"tableTopDimensions\",\n type: \"Default\",\n name: \"Table top dimensions\",\n value: \"90x90x3 cm\"\n }\n ]\n});\n\nxktModel.createPropertySet({\n propertySetId: \"tableLegPropSet\",\n propertySetType: \"Default\",\n propertySetName: \"Table Leg\",\n properties: [\n {\n id: \"tableLegMaterial\",\n type: \"Default\",\n name: \"Table leg material\",\n value: \"Pine\"\n },\n {\n id: \"tableLegDimensions\",\n type: \"Default\",\n name: \"Table leg dimensions\",\n value: \"5x5x50 cm\"\n }\n ]\n});\n\n// Create a hierarchy of metaobjects to describe the structure of the model\n\nxktModel.createMetaObject({ // Root XKTMetaObject, has no XKTEntity\n metaObjectId: \"table\",\n metaObjectName: \"The Table\",\n metaObjectType: \"furniture\"\n});\n\nxktModel.createMetaObject({\n metaObjectId: \"redLeg\",\n metaObjectName: \"Red Table Leg\",\n metaObjectType: \"furniturePart\",\n parentMetaObjectId: \"table\",\n propertySetIds: [\"tableLegPropSet\"]\n});\n\nxktModel.createMetaObject({\n metaObjectId: \"greenLeg\",\n metaObjectName: \"Green Table Leg\",\n metaObjectType: \"furniturePart\",\n parentMetaObjectId: \"table\",\n propertySetIds: [\"tableLegPropSet\"]\n});\n\nxktModel.createMetaObject({\n metaObjectId: \"blueLeg\",\n metaObjectName: \"Blue Table Leg\",\n metaObjectType: \"furniturePart\",\n parentMetaObjectId: \"table\",\n propertySetIds: [\"tableLegPropSet\"]\n});\n\nxktModel.createMetaObject({\n metaObjectId: \"yellowLeg\",\n metaObjectName: \"Yellow Table Leg\",\n metaObjectType: \"furniturePart\",\n parentMetaObjectId: \"table\",\n propertySetIds: [\"tableLegPropSet\"]\n});\n\nxktModel.createMetaObject({\n metaObjectId: \"pinkTop\",\n metaObjectName: \"The Pink Table Top\",\n metaObjectType: \"furniturePart\",\n parentMetaObjectId: \"table\",\n propertySetIds: [\"tableTopPropSet\"]\n});\n\n// Create an XKTGeometry that defines a box shape, as a triangle mesh \n\nxktModel.createGeometry({\n geometryId: \"boxGeometry\",\n primitiveType: \"triangles\", // Also \"lines\" and \"points\"\n positions: [\n 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1,\n -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1,\n -1, -1, -1, -1, -1, 1, -1, 1, 1, -1\n ],\n normals: [ // Only for \"triangles\"\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,\n -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0,\n -1, 0, 0, -1\n ],\n indices: [\n 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19,\n 20, 21, 22, 20, 22, 23\n ]\n});\n\n// Create five XKTMeshes, which represent the table top and legs.\n// Each XKTMesh has its own color, position, orientation and size, \n// and uses the XKTGeometry to define its shape. \n// An XKTGeometry can be used by multiple XKTMeshes.\n\nxktModel.createMesh({\n meshId: \"redLegMesh\",\n geometryId: \"boxGeometry\",\n position: [-4, -6, -4],\n scale: [1, 3, 1],\n rotation: [0, 0, 0],\n color: [1, 0, 0],\n opacity: 1\n});\n\nxktModel.createMesh({\n meshId: \"greenLegMesh\",\n geometryId: \"boxGeometry\",\n position: [4, -6, -4],\n scale: [1, 3, 1],\n rotation: [0, 0, 0],\n color: [0, 1, 0],\n opacity: 1\n});\n\nxktModel.createMesh({\n meshId: \"blueLegMesh\",\n geometryId: \"boxGeometry\",\n position: [4, -6, 4],\n scale: [1, 3, 1],\n rotation: [0, 0, 0],\n color: [0, 0, 1],\n opacity: 1\n});\n\nxktModel.createMesh({\n meshId: \"yellowLegMesh\",\n geometryId: \"boxGeometry\",\n position: [-4, -6, 4],\n scale: [1, 3, 1],\n rotation: [0, 0, 0],\n color: [1, 1, 0],\n opacity: 1\n});\n\nxktModel.createMesh({\n meshId: \"pinkTopMesh\",\n geometryId: \"boxGeometry\",\n position: [0, -3, 0],\n scale: [6, 0.5, 6],\n rotation: [0, 0, 0],\n color: [1, 0, 1],\n opacity: 1\n});\n\n// Create five XKTEntities, which represent abstract, named objects in the model. \n// Each XKTEntity has an XKTMesh.\n// An XKTEntity can have multiple XKTMeshes. \n// An XKTMesh can only belong to one XKTEntity.\n\nxktModel.createEntity({\n entityId: \"redLeg\",\n meshIds: [\"redLegMesh\"]\n});\n\nxktModel.createEntity({\n entityId: \"greenLeg\",\n meshIds: [\"greenLegMesh\"]\n});\n\nxktModel.createEntity({\n entityId: \"blueLeg\",\n meshIds: [\"blueLegMesh\"]\n});\n\nxktModel.createEntity({\n entityId: \"yellowLeg\",\n meshIds: [\"yellowLegMesh\"]\n});\n\nxktModel.createEntity({\n entityId: \"pinkTop\",\n meshIds: [\"pinkTopMesh\"]\n});\n````\n\nOnce we've built\nour [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html), we\nneed to finalize it. Then it's ready to use. Note that finalizing is an asynhronous operation, so we await its\ncompletion before continuing.\n\n````javascript\nawait xktModel.finalize();\n````\n\n### Serializing the XKTModel to an ArrayBuffer\n\nNext, we'll\nuse [````writeXKTModelToArrayBuffer````](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-writeXKTModelToArrayBuffer)\nto serialize\nour [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) to\nan ````ArrayBuffer````.\n\n````javascript\nconst xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel);\n\nfs.writeFileSync(\"./myModel.xkt\", xktArrayBuffer);\n````\n\n### Loading the ArrayBuffer into a Viewer\n\nLet's now create a [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html),\nthen load the ````ArrayBuffer```` into it using\nan [````XKTLoaderPlugin````](https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html)\n.\n\n````javascript\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nconst model = xktLoader.load({\n id: \"myModel\",\n src: \"./myModel.xkt\"\n});\n````\n\nFinally, when the model has loaded, let's fit it in view.\n\n````javascript\nmodel.on(\"loaded\", () => {\n viewer.cameraFlight.flyTo(model);\n});\n````\n\n### Loading IFC into an XKTModel\n\nLet's\nuse [````parseIFCIntoXKTModel````](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseIFCIntoXKTModel)\nto import IFC into\nan [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html).\n\nAs before, we'll also use the classes and functions introduced in the previous examples to serialize\nthe [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) to\nan ````ArrayBuffer````, then load it into\na [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html).\n\n````javascript\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nutils.loadArraybuffer(\"./assets/models/ifc/rac_advanced_sample_project.ifc\", async (data) => {\n\n const xktModel = new XKTModel();\n\n parseIFCIntoXKTModel({data, xktModel, wasmPath: \"../dist/\"}).then(() => {\n\n xktModel.finalize().then(() => {\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel);\n\n xktLoader.load({\n id: \"myModel\",\n xkt: xktArrayBuffer,\n edges: true\n });\n\n viewer.cameraFlight.flyTo(viewer.scene);\n });\n });\n },\n (errMsg) => {\n });\n````\n\n### Loading LAS into an XKTModel\n\nLet's\nuse [````parseLASIntoXKTModel````](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseLASIntoXKTModel)\nto import LAS into\nan [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html).\n\nAs before, we'll also use the classes and functions introduced in the previous examples to serialize\nthe [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) to\nan ````ArrayBuffer````, then load it into\na [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html).\n\n````javascript\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nutils.loadArraybuffer(\"./assets/models/laz/indoor.0.1.laz\", async (data) => {\n\n const xktModel = new XKTModel();\n\n parseLASIntoXKTModel({data, xktModel, rotateX: true}).then(() => {\n\n xktModel.finalize().then(() => {\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel);\n\n xktLoader.load({\n id: \"myModel\",\n xkt: xktArrayBuffer,\n edges: true\n });\n\n viewer.cameraFlight.flyTo(viewer.scene);\n });\n });\n },\n (errMsg) => {\n });\n````\n\n### Loading glTF into an XKTModel\n\nLet's\nuse [````parseGLTFIntoXKTModel````](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseGLTFIntoXKTModel)\nto import glTF into\nan [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html).\n\nWe'll also use the classes and functions introduced in the previous examples to serialize\nthe [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) to\nan ````ArrayBuffer````, then validate the ````ArrayBuffer```` and load it into\na [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html).\n\n````javascript\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nutils.loadArraybuffer(\"./assets/models/gltf/MAP/glTF-Embedded/MAP.gltf\", (gltf) => {\n\n const xktModel = new XKTModel();\n\n parseGLTFIntoXKTModel({data: gltf, xktModel: xktModel}).then(() => {\n\n xktModel.finalize().then(() => {\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel);\n\n xktLoader.load({\n id: \"myModel\",\n xkt: xktArrayBuffer\n });\n\n viewer.cameraFlight.flyTo(viewer.scene);\n });\n });\n },\n (errMsg) => {\n });\n````\n\n### Loading STL into an XKTModel\n\nLet's\nuse [````parseSTLIntoXKTModel````](https://xeokit.github.io/xeokit-convert/docs/function/index.html#static-function-parseSTLIntoXKTModel)\nto import STL into\nan [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html).\n\nAs before, we'll also use the classes and functions introduced in the previous examples to serialize\nthe [````XKTModel````](https://xeokit.github.io/xeokit-convert/docs/class/src/XKTModel/XKTModel.js~XKTModel.html) to\nan ````ArrayBuffer````, then load it into\na [````Viewer````](https://xeokit.github.io/xeokit-sdk/docs/class/src/viewer/Viewer.js~Viewer.html).\n\n````javascript\nconst viewer = new Viewer({\n canvasId: \"myCanvas\"\n});\n\nconst xktLoader = new XKTLoaderPlugin(viewer);\n\nutils.loadArraybuffer(\"./assets/models/stl/binary/spurGear.stl\", (json) => {\n\n const xktModel = new XKTModel();\n\n parseSTLIntoXKTModel({stlData: json, xktModel: xktModel}).then(() => {\n\n xktModel.finalize().then(() => {\n\n const xktArrayBuffer = writeXKTModelToArrayBuffer(xktModel);\n\n xktLoader.load({\n id: \"myModel\",\n xkt: xktArrayBuffer\n });\n\n viewer.cameraFlight.flyTo(viewer.scene);\n });\n });\n },\n (errMsg) => {\n });\n````\n\n# Building\n\n### Building Binaries\n\nBuilding the binaries in [````./dist````](https://github.com/xeokit/xeokit-convert/tree/main/dist):\n\n````bash\nnpm update\nnpm run build\n````\n\nThis will build:\n\n* [./dist/convert2xkt.cjs.js](./dist/convert2xkt.cjs.js) - Nodejs CLI converter tool\n* [./dist/xeokit-convert.cjs.js](./dist/xeokit-convert.cjs.js) - CommonJS module library of XKT classes and functions\n* [./dist/xeokit-convert.es.js](./dist/xeokit-convert.es.js) - ES module library of XKT classes and functions\n* [./dist/web-ifc.wasm](./dist/web-ifc.wasm) - 3rd-party web-ifc WASM module\n\nBuilding the JavaScript API documentation in [````./docs````](https://xeokit.github.io/xeokit-convert/docs):\n\n````bash\nnpm run docs\n````\n\n### RuntimeError: memory access out of bounds\n\nWith luck, the WASM module already be compiled appropriately for your target x86 system.\n\nHowever, if you get this error:\n\n````bash\nRuntimeError: memory access out of bounds\n````\n\nthen you will need to compile that WASM module for your target system. Please follow the instructions for that on the\n[web-ifc](https://github.com/tomvandig/web-ifc) project page, then replace [./dist/web-ifc.wasm](./dist/web-ifc.wasm)\nwith your compiled binary.\n\n### TypeError: fetch failed\n\nThis error is possible in in nodejs version 17+. As fix you will have to add the --no-experimental-fetch flag to the command.\n````bash\nnode --no-experimental-fetch convert2xkt.js ...\n````\n", - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/README.md", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/README.md", "name": "./README.md", "static": true, "access": "public" }, { "kind": "packageJSON", - "content": "{\n \"name\": \"@xeokit/xeokit-convert\",\n \"version\": \"1.1.15-beta-9\",\n \"description\": \"JavaScript utilities to create .XKT files\",\n \"main\": \"index.js\",\n \"bin\": \"/convert2xkt.js\",\n \"directories\": {},\n \"scripts\": {\n \"build\": \"webpack --mode=production --node-env=production --progress; rollup --config rollup.config.dist.js; rollup --config rollup.config.convert2xkt.js; rm -Rf ./docs/*; ./node_modules/.bin/esdoc\",\n \"build-node\": \"webpack --mode=production --node-env=production --progress\",\n \"build-browser\": \"rollup --config rollup.config.dist.js\",\n \"docs\": \"rm -Rf ./docs/*; ./node_modules/.bin/esdoc\",\n \"publish\": \"npm publish --access public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/xeokit/xeokit-convert.git\"\n },\n \"keywords\": [\n \"xeolabs\",\n \"xeokit\",\n \"bim\",\n \"opensource\",\n \"ifc\",\n \"webgl\",\n \"xkt\",\n \"gltf\",\n \"glb\",\n \"cityjson\",\n \"laz\",\n \"gis\"\n ],\n \"author\": \"Lindsay Kay\",\n \"license\": \"LICENSE\",\n \"bugs\": {\n \"url\": \"https://github.com/xeokit/xeokit-convert/issues\"\n },\n \"homepage\": \"https://github.com/xeokit/xeokit-convert#readme\",\n \"dependencies\": {\n \"@loaders.gl/core\": \"^3.2.6\",\n \"@loaders.gl/gltf\": \"^3.2.6\",\n \"@loaders.gl/images\": \"^3.2.6\",\n \"@loaders.gl/json\": \"^3.2.6\",\n \"@loaders.gl/las\": \"^3.2.6\",\n \"@loaders.gl/obj\": \"^3.2.6\",\n \"@loaders.gl/ply\": \"^3.2.6\",\n \"@loaders.gl/polyfills\": \"^3.2.6\",\n \"@loaders.gl/textures\": \"^3.2.6\",\n \"@typeonly/validator\": \"^0.5.2\",\n \"commander\": \"^11.0.0\",\n \"core-js\": \"^3.22.5\",\n \"fs\": \"0.0.1-security\",\n \"pako\": \"^2.0.4\",\n \"path\": \"^0.12.7\",\n \"web-ifc\": \"0.0.40\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.17.10\",\n \"@babel/plugin-external-helpers\": \"^7.17.12\",\n \"@babel/preset-env\": \"^7.17.12\",\n \"@rollup/plugin-alias\": \"^3.1.9\",\n \"@rollup/plugin-commonjs\": \"^21.1.0\",\n \"@rollup/plugin-node-resolve\": \"^13.2.1\",\n \"@xeokit/xeokit-sdk\": \"^2.3.0\",\n \"babel-loader\": \"^8.2.5\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-node\": \"^1.0.5\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"http-server\": \"^14.1.0\",\n \"npm-upgrade\": \"^3.1.0\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^2.70.2\",\n \"rollup-plugin-copy\": \"^3.4.0\",\n \"rollup-plugin-minify-es\": \"^1.1.1\",\n \"typeonly\": \"^0.4.6\",\n \"webpack\": \"^5.72.1\",\n \"webpack-cli\": \"^4.9.2\",\n \"webpack-node-externals\": \"^3.0.0\"\n },\n \"files\": [\n \"/dist\",\n \"/convert2xkt.js\",\n \"/convert2xkt.conf.js\"\n ]\n}\n", - "longname": "/home/lindsay/xeolabs/xeokit-convert-mar14/package.json", + "content": "{\n \"name\": \"@xeokit/xeokit-convert\",\n \"version\": \"1.1.15-beta-10\",\n \"description\": \"JavaScript utilities to create .XKT files\",\n \"main\": \"index.js\",\n \"bin\": \"/convert2xkt.js\",\n \"directories\": {},\n \"scripts\": {\n \"build\": \"webpack --mode=production --node-env=production --progress; rollup --config rollup.config.dist.js; rollup --config rollup.config.convert2xkt.js; rm -Rf ./docs/*; ./node_modules/.bin/esdoc\",\n \"build-node\": \"webpack --mode=production --node-env=production --progress\",\n \"build-browser\": \"rollup --config rollup.config.dist.js\",\n \"docs\": \"rm -Rf ./docs/*; ./node_modules/.bin/esdoc\",\n \"publish\": \"npm publish --access public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/xeokit/xeokit-convert.git\"\n },\n \"keywords\": [\n \"xeolabs\",\n \"xeokit\",\n \"bim\",\n \"opensource\",\n \"ifc\",\n \"webgl\",\n \"xkt\",\n \"gltf\",\n \"glb\",\n \"cityjson\",\n \"laz\",\n \"gis\"\n ],\n \"author\": \"Lindsay Kay\",\n \"license\": \"LICENSE\",\n \"bugs\": {\n \"url\": \"https://github.com/xeokit/xeokit-convert/issues\"\n },\n \"homepage\": \"https://github.com/xeokit/xeokit-convert#readme\",\n \"dependencies\": {\n \"@loaders.gl/core\": \"^3.2.6\",\n \"@loaders.gl/gltf\": \"^3.2.6\",\n \"@loaders.gl/images\": \"^3.2.6\",\n \"@loaders.gl/json\": \"^3.2.6\",\n \"@loaders.gl/las\": \"^3.2.6\",\n \"@loaders.gl/obj\": \"^3.2.6\",\n \"@loaders.gl/ply\": \"^3.2.6\",\n \"@loaders.gl/polyfills\": \"^3.2.6\",\n \"@loaders.gl/textures\": \"^3.2.6\",\n \"@typeonly/validator\": \"^0.5.2\",\n \"commander\": \"^11.0.0\",\n \"core-js\": \"^3.22.5\",\n \"fs\": \"0.0.1-security\",\n \"pako\": \"^2.0.4\",\n \"path\": \"^0.12.7\",\n \"web-ifc\": \"0.0.40\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.17.10\",\n \"@babel/plugin-external-helpers\": \"^7.17.12\",\n \"@babel/preset-env\": \"^7.17.12\",\n \"@rollup/plugin-alias\": \"^3.1.9\",\n \"@rollup/plugin-commonjs\": \"^21.1.0\",\n \"@rollup/plugin-node-resolve\": \"^13.2.1\",\n \"@xeokit/xeokit-sdk\": \"^2.3.0\",\n \"babel-loader\": \"^8.2.5\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-node\": \"^1.0.5\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"http-server\": \"^14.1.0\",\n \"npm-upgrade\": \"^3.1.0\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^2.70.2\",\n \"rollup-plugin-copy\": \"^3.4.0\",\n \"rollup-plugin-minify-es\": \"^1.1.1\",\n \"typeonly\": \"^0.4.6\",\n \"webpack\": \"^5.72.1\",\n \"webpack-cli\": \"^4.9.2\",\n \"webpack-node-externals\": \"^3.0.0\"\n },\n \"files\": [\n \"/dist\",\n \"/convert2xkt.js\",\n \"/convert2xkt.conf.js\"\n ]\n}\n", + "longname": "/home/lindsay/xeokit/xeokit-convert-mar27/package.json", "name": "package.json", "static": true, "access": "public" diff --git a/docs/source.html b/docs/source.html index d4d9ccb..0ce8957 100644 --- a/docs/source.html +++ b/docs/source.html @@ -99,7 +99,7 @@ 100 %6/6 672 byte 36 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/MockXKTModel.js @@ -107,7 +107,7 @@ 16 %2/12 3633 byte 116 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTEntity.js @@ -115,7 +115,7 @@ 100 %7/7 2355 byte 73 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTGeometry.js @@ -123,7 +123,7 @@ 100 %17/17 4924 byte 158 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTMesh.js @@ -131,7 +131,7 @@ 100 %12/12 3004 byte 99 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTMetaObject.js @@ -139,7 +139,7 @@ 100 %7/7 2671 byte 81 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTModel.js @@ -147,7 +147,7 @@ 63 %41/65 57450 byte 1536 - 2024-03-05 00:45:45 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTPropertySet.js @@ -155,7 +155,7 @@ 100 %6/6 1302 byte 52 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTTexture.js @@ -163,7 +163,7 @@ 93 %15/16 3811 byte 144 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTTextureSet.js @@ -171,7 +171,7 @@ 100 %12/12 2206 byte 87 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/XKTTile.js @@ -179,7 +179,7 @@ 100 %4/4 753 byte 35 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/buildEdgeIndices.js @@ -187,7 +187,7 @@ 100 %1/1 6461 byte 167 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/buildFaceNormals.js @@ -195,7 +195,7 @@ 50 %1/2 1893 byte 76 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/buildVertexNormals.js @@ -203,7 +203,7 @@ 100 %1/1 2016 byte 81 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/earcut.js @@ -211,7 +211,7 @@ 2 %1/34 20369 byte 676 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/faceToVertexNormals.js @@ -219,7 +219,7 @@ 100 %1/1 2764 byte 104 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/geometryCompression.js @@ -227,7 +227,7 @@ 44 %4/9 7096 byte 194 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/isTriangleMeshSolid.js @@ -235,7 +235,7 @@ 100 %1/1 3870 byte 164 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/math.js @@ -243,7 +243,7 @@ 16 %1/6 94289 byte 3742 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/mergeVertices.js @@ -251,7 +251,7 @@ 100 %1/1 1212 byte 31 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/toArraybuffer.js @@ -259,7 +259,7 @@ 100 %1/1 269 byte 12 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/lib/utils.js @@ -267,7 +267,7 @@ 33 %1/3 333 byte 22 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKTModel/writeXKTModelToArrayBuffer.js @@ -275,7 +275,7 @@ 11 %1/9 22711 byte 460 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/XKT_INFO.js @@ -283,7 +283,7 @@ 100 %1/1 563 byte 20 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/constants.js @@ -306,15 +306,15 @@ 100 %16/16 3498 byte 91 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/convert2xkt.js convert2xkt 100 %1/1 - 18163 byte - 438 - 2024-04-01 20:39:19 (UTC) + 18404 byte + 449 + 2024-04-05 05:31:40 (UTC) src/geometryBuilders/buildBoxGeometry.js @@ -322,7 +322,7 @@ 100 %1/1 6056 byte 249 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildBoxLinesGeometry.js @@ -330,7 +330,7 @@ 100 %1/1 3062 byte 115 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildCylinderGeometry.js @@ -338,7 +338,7 @@ 100 %1/1 7750 byte 279 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildGridGeometry.js @@ -346,7 +346,7 @@ 100 %1/1 2670 byte 108 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildPlaneGeometry.js @@ -354,7 +354,7 @@ 100 %1/1 4626 byte 177 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildSphereGeometry.js @@ -362,7 +362,7 @@ 100 %1/1 4383 byte 170 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildTorusGeometry.js @@ -370,7 +370,7 @@ 100 %1/1 4890 byte 183 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/geometryBuilders/buildVectorTextGeometry.js @@ -378,7 +378,7 @@ 50 %1/2 34298 byte 1723 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/index.js @@ -386,7 +386,7 @@ - 1525 byte 24 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/buildFaceNormals.js @@ -394,7 +394,7 @@ 50 %1/2 1893 byte 76 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/buildVertexNormals.js @@ -402,7 +402,7 @@ 100 %1/1 2016 byte 81 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/earcut.js @@ -410,7 +410,7 @@ 2 %1/34 20369 byte 676 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/faceToVertexNormals.js @@ -418,7 +418,7 @@ 100 %1/1 2764 byte 104 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/math.js @@ -426,7 +426,7 @@ 16 %1/6 94289 byte 3742 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/lib/mergeVertices.js @@ -434,7 +434,7 @@ 100 %1/1 1212 byte 31 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseCityJSONIntoXKTModel.js @@ -442,7 +442,7 @@ 5 %1/18 19862 byte 664 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseGLTFIntoXKTModel.js @@ -450,7 +450,7 @@ 8 %1/12 24053 byte 661 - 2024-04-04 19:32:47 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseGLTFJSONIntoXKTModel.js @@ -458,7 +458,7 @@ 5 %1/20 24984 byte 661 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseIFCIntoXKTModel.js @@ -466,7 +466,7 @@ 12 %1/8 14498 byte 432 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseLASIntoXKTModel.js @@ -474,7 +474,7 @@ 50 %1/2 11508 byte 312 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseMetaModelIntoXKTModel.js @@ -482,7 +482,7 @@ 100 %1/1 4295 byte 120 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parsePCDIntoXKTModel.js @@ -490,7 +490,7 @@ 25 %1/4 10430 byte 297 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parsePLYIntoXKTModel.js @@ -498,7 +498,7 @@ 100 %1/1 3010 byte 108 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) src/parsers/parseSTLIntoXKTModel.js @@ -506,7 +506,7 @@ 11 %1/9 12458 byte 357 - 2024-03-05 00:05:03 (UTC) + 2024-03-04 18:21:20 (UTC) diff --git a/package.json b/package.json index f5e98ad..93e47d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xeokit/xeokit-convert", - "version": "1.1.15-beta-9", + "version": "1.1.15-beta-10", "description": "JavaScript utilities to create .XKT files", "main": "index.js", "bin": "/convert2xkt.js", diff --git a/src/convert2xkt.js b/src/convert2xkt.js index a43c524..d1070e5 100755 --- a/src/convert2xkt.js +++ b/src/convert2xkt.js @@ -120,6 +120,14 @@ function convert2xkt({ stats.conversionTime = 0; stats.aabb = null; + function getFileExtension(fileName) { + let ext = path.extname(source); + if (ext.charAt(0) === ".") { + ext = ext.substring(1); + } + return ext; + } + return new Promise(function (resolve, reject) { const _log = log; log = (msg) => { @@ -148,7 +156,10 @@ function convert2xkt({ const startTime = new Date(); const sourceConfigs = configs.sourceConfigs || {}; - const ext = sourceFormat || path.extname(source); + const ext = sourceFormat || getFileExtension(source); + + log(`Input file extension: "${ext}"`); + let fileTypeConfigs = sourceConfigs[ext]; if (!fileTypeConfigs) {