@loaders.gl/3d-tiles
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){(function(t){const o=n(2),r="undefined"==typeof window?t:window;r.loaders=r.loaders||{},e.exports=Object.assign(r.loaders,o)}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){(function(t){const r=n(4),o="undefined"==typeof window?t:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,r)}).call(this,n(2))},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){},function(e,t,n){"use strict";n.r(t);const r={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",MODEL_BATCHED:"b3dm",MODEL_INSTANCED:"i3dm",GEOMETRY:"geom",VECTOR:"vect"},o={COMPOSITE:"cmpt",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",POINT_CLOUD:"pnts"},i={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]},s={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function a(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var f=n(5);function u(e,t,n){a(e instanceof ArrayBuffer);const r=new f.TextDecoder("utf8"),o=new Uint8Array(e,t,n);return r.decode(o)}class c{constructor({featureTableJson:e,featureTableBinary:t}){this.json=e,this.buffer=t,this.featuresLength=0,this._cachedTypedArrays={}}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,t=s.UNSIGNED_INT,n=1){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,r.byteOffset):r}getPropertyArray(e,t,n){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(this,e,t,n,this.featuresLength,r.byteOffset):this._getTypedArrayFromArray(this,e,t,r)}getProperty(e,t,n,r,o){const i=this.json[e];if(!i)return i;const s=this.getPropertyArray(e,t,n);if(1===n)return s[r];for(let e=0;e<n;++e)o[e]=s[n*r+e];return o}_getTypedArrayFromBinary(e,t,n,r,o){}_getTypedArrayFromArray(e,t,n){}}const l=4;function y(e,t,n=0){const r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=l,e.version=r.getUint32(n,!0),n+=l,e.byteLength=r.getUint32(n,!0),n+=l,1!==e.version)throw new Error(`3D Tile Version ${e.version} not supported`);return n}const d=4;function T(e,t,n){const r=new DataView(t);return e.featureTableJsonByteLength=r.getUint32(n,!0),n+=d,e.featureTableBinaryByteLength=r.getUint32(n,!0),n+=d,e.batchTableJsonByteLength=r.getUint32(n,!0),n+=d,e.batchTableBinaryByteLength=r.getUint32(n,!0),n+=d}function b(e,t,n,r){return n=function(e,t,n,r){const{featureTableJsonByteLength:o,featureTableBinaryByteLength:i}=e;if(e.featureTableJson={BATCH_LENGTH:0},o>0){const r=u(t,n,o);e.featureTableJson=JSON.parse(r)}return n+=o,e.featureTableBinary=new Uint8Array(t,n,i),n+=i}(e,t,n),n=function(e,t,n,r){const{batchTableJsonByteLength:o,batchTableBinaryByteLength:i}=e;if(o>0){const r=u(t,n,o);e.batchTableJson=JSON.parse(r),n+=o,i>0&&(e.batchTableBinary=new Uint8Array(t,n,i),e.batchTableBinary=new Uint8Array(e.batchTableBinary),n+=i)}return n}(e,t,n)}function g(e,t,n,r){return n=b(e,t,n=T(e,t,n=y(e,t,n))),function(e){const t=new c(e),n=t.getGlobalProperty("POINTS_LENGTH");if(e.featuresLength=n,t.featuresLength=n,!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");e.rtcCenter=t.getGlobalProperty("RTC_CENTER",s.FLOAT,3),e.positions=null,e.colors=null,e.normals=null,e.batchIds=null,e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e),n}function h(e,t,n){const r=e.byteOffset+e.byteLength-n;if(0===r)throw new Error("glTF byte length must be greater than 0.");if(n%4==0)e.gltfView=new Uint8Array(t,n,r);else{console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`);const o=new Uint8Array(t);e.gltfView=new Uint8Array(o.subarray(n,n+r))}return e.byteOffset+e.byteLength}function w(e,t=0,n={},r={}){switch(r.byteOffset=t,r.type=function(e,t=0){const n=new DataView(e);return`${String.fromCharCode(n.getUint8(t+0))}${String.fromCharCode(n.getUint8(t+1))}${String.fromCharCode(n.getUint8(t+2))}${String.fromCharCode(n.getUint8(t+3))}`}(e,t),r.type){case o.COMPOSITE:!function(e,t,n,r,o){n=y(e,t,n);const i=new DataView(t);for(e.tilesLength=i.getUint32(n,!0),n+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-n>12;){const i={};e.tiles.push(i),n=o(t,n,r,i)}}(r,e,t,n,w);break;case o.BATCHED_3D_MODEL:!function(e,t,n,r){n=h(e,t,n=b(e,t,n=T(e,t,n=y(e,t,n))));const o=new c(e);e.rtcCenter=o.getGlobalProperty("RTC_CENTER",s.FLOAT,3)}(r,e,t);break;case o.INSTANCED_3D_MODEL:!function(e,t,n,r){if(n=y(e,t,n),1!==e.version)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);n=T(e,t,n);const o=new DataView(t);if(e.gltfFormat=o.getUint32(n,!0),n=h(e,n=b(e,t,n+=4)),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const i=new c(e),s=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined")}(r,e,t);break;case o.POINT_CLOUD:g(r,e,t);break;default:throw new Error(`3DTileLoader: unknown type ${r.type}`)}return r}var O={name:"3D Tiles",extensions:["cmpt","pnts","b3dm","i3dm"],parseSync:function(e,t,n,r){return w(e,0,t)},binary:!0};function p(e,t,n){if(!e)return{byteOffset:t+12};const{magic:r,version:o=1,byteLength:i}=n;a(Array.isArray(r)&&Number.isFinite(o)&&Number.isFinite(i));const s=new DataView(e);return s.setUint8(t+0,r[0]),s.setUint8(t+1,r[1]),s.setUint8(t+2,r[2]),s.setUint8(t+3,r[3]),s.setUint32(t+4,o,!0),s.setUint32(t+8,i,!0),{buffer:e,byteOffset:t+=12}}function E(e={}){const{tiles:t=[]}=e,n=t.length;let r=0;for(let e=0;e<n;++e)r+=t[e].byteLength;const o=16+r,s=new ArrayBuffer(o);p(s,0,{magic:i.COMPOSITE,...e,byteLength:o}),new DataView(s).setUint32(12,n,!0);const a=new Uint8Array(s);let f=16;for(let e=0;e<n;++e){const n=new Uint8Array(t[e]);a.set(n,f),f+=n.byteLength}return s}function D(e={}){const{featuresLength:t=1}=e,n={BATCH_LENGTH:t},r=JSON.stringify(n),o=r.length,s=28+o,a=new ArrayBuffer(s);p(a,0,{magic:i.BATCHED_MODEL,byteLength:s,...e});const f=new DataView(a);f.setUint32(12,o,!0),f.setUint32(16,0,!0),f.setUint32(20,0,!0),f.setUint32(24,0,!0);let u=28;for(let e=0;e<o;e++)f.setUint8(u,r.charCodeAt(e)),u++;return a}function L(e={}){const{featuresLength:t=1,gltfFormat:n=1,gltfUri:r=""}=e,o=r.length,s={INSTANCES_LENGTH:t,POSITION:new Array(3*t).fill(0)},a=JSON.stringify(s),f=a.length,u=32+f+r.length,c=new ArrayBuffer(u),l=new DataView(c);p(c,0,{magic:i.INSTANCED_MODEL,byteLength:u,...e}),l.setUint32(12,f,!0),l.setUint32(16,0,!0),l.setUint32(20,0,!0),l.setUint32(24,0,!0),l.setUint32(28,n,!0);let y=32;for(let e=0;e<f;e++)l.setUint8(y,a.charCodeAt(e)),y++;for(let e=0;e<o;e++)l.setUint8(y,r.charCodeAt(e)),y++;return c}function N(e={}){const t={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}},{featureTableJson:n=t}=e;let r=JSON.stringify(n);r=function(e,t){const n=e.length,r=Math.ceil(n/t)*t-n;let o="";for(let e=0;e<r;++e)o+=" ";return e+o}(r,4);const{featureTableJsonByteLength:o=r.length}=e,s=new ArrayBuffer(12),a=s.byteLength,f=28+o+a,u=new ArrayBuffer(f);p(u,0,{magic:i.POINT_CLOUD,...e,byteLength:f});const c=new DataView(u);c.setUint32(12,o,!0),c.setUint32(16,a,!0),c.setUint32(20,0,!0),c.setUint32(24,0,!0);let l=28;for(let e=0;e<o;e++)c.setUint8(l,r.charCodeAt(e)),l++;for(let e=0;e<a;e++)c.setUint8(l,s[e]),l++;return u}function U(e,t){switch(e.type){case r.COMPOSITE:return E({...e,...t});case r.POINTCLOUD:return N({...e,...t});case r.MODEL_BATCHED:return D({...e,...t});case r.MODEL_INSTANCED:return L({...e,...t});default:throw new Error}}n.d(t,"Tile3DLoader",function(){return O}),n.d(t,"TILE3D_TYPE",function(){return r}),n.d(t,"parse3DTile",function(){return w}),n.d(t,"encode3DTile",function(){return U}),n.d(t,"encodeComposite3DTile",function(){return E}),n.d(t,"encodeBatchedModel3DTile",function(){return D}),n.d(t,"encodeInstancedModel3DTile",function(){return L}),n.d(t,"encodePointCloud3DTile",function(){return N})},function(e,t,n){"undefined"==typeof TextDecoder?e.exports=n(3):e.exports={TextEncoder:TextEncoder,TextDecoder:TextDecoder}}])}); |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "Tile3DLoader", { | ||
enumerable: true, | ||
get: function get() { | ||
return _tile3dLoader["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "TILE3D_TYPE", { | ||
enumerable: true, | ||
get: function get() { | ||
return _constants.TILE3D_TYPE; | ||
} | ||
}); | ||
Object.defineProperty(exports, "parse3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _parse3dTile["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "encode3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _encode3dTile["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "encodeComposite3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _encode3dTileComposite.encodeComposite3DTile; | ||
} | ||
}); | ||
Object.defineProperty(exports, "encodeBatchedModel3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _encode3dTileBatchedModel.encodeBatchedModel3DTile; | ||
} | ||
}); | ||
Object.defineProperty(exports, "encodeInstancedModel3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _encode3dTileInstancedModel.encodeInstancedModel3DTile; | ||
} | ||
}); | ||
Object.defineProperty(exports, "encodePointCloud3DTile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _encode3dTilePointCloud.encodePointCloud3DTile; | ||
} | ||
}); | ||
var _tile3dLoader = _interopRequireDefault(require("./tile-3d-loader")); | ||
var _constants = require("./constants"); | ||
var _parse3dTile = _interopRequireDefault(require("./parsers/parse-3d-tile")); | ||
var _encode3dTile = _interopRequireDefault(require("./encoders/encode-3d-tile")); | ||
var _encode3dTileComposite = require("./encoders/encode-3d-tile-composite"); | ||
var _encode3dTileBatchedModel = require("./encoders/encode-3d-tile-batched-model"); | ||
var _encode3dTileInstancedModel = require("./encoders/encode-3d-tile-instanced-model"); | ||
var _encode3dTilePointCloud = require("./encoders/encode-3d-tile-point-cloud"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,9 @@ | ||
export { default as Tile3DLoader } from './tile-3d-loader'; | ||
export { TILE3D_TYPE } from './constants'; | ||
export { default as parse3DTile } from './parsers/parse-3d-tile'; | ||
export { default as encode3DTile } from './encoders/encode-3d-tile'; | ||
export { encodeComposite3DTile } from './encoders/encode-3d-tile-composite'; | ||
export { encodeBatchedModel3DTile } from './encoders/encode-3d-tile-batched-model'; | ||
export { encodeInstancedModel3DTile } from './encoders/encode-3d-tile-instanced-model'; | ||
export { encodePointCloud3DTile } from './encoders/encode-3d-tile-point-cloud'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,9 @@ | ||
export { default as Tile3DLoader } from './tile-3d-loader'; | ||
export { TILE3D_TYPE } from './constants'; | ||
export { default as parse3DTile } from './parsers/parse-3d-tile'; | ||
export { default as encode3DTile } from './encoders/encode-3d-tile'; | ||
export { encodeComposite3DTile } from './encoders/encode-3d-tile-composite'; | ||
export { encodeBatchedModel3DTile } from './encoders/encode-3d-tile-batched-model'; | ||
export { encodeInstancedModel3DTile } from './encoders/encode-3d-tile-instanced-model'; | ||
export { encodePointCloud3DTile } from './encoders/encode-3d-tile-point-cloud'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@loaders.gl/3d-tiles", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.", | ||
@@ -37,4 +37,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/core": "1.0.0" | ||
"@loaders.gl/core": "1.0.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
729364
158
7112
4
+ Added@loaders.gl/core@1.0.1(transitive)
- Removed@loaders.gl/core@1.0.0(transitive)
Updated@loaders.gl/core@1.0.1