@loaders.gl/tile-converter 4.0.0-alpha.18 → 4.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/bin/converter.js +1 -1
  2. package/dist/constants.d.ts +2 -0
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +3 -1
  5. package/dist/converter-cli.js +10 -2
  6. package/dist/converter.min.js +172 -103
  7. package/dist/deps-installer/deps-installer.d.ts +3 -2
  8. package/dist/deps-installer/deps-installer.d.ts.map +1 -1
  9. package/dist/deps-installer/deps-installer.js +36 -10
  10. package/dist/dist.min.js +226 -151
  11. package/dist/es5/constants.js +5 -1
  12. package/dist/es5/constants.js.map +1 -1
  13. package/dist/es5/converter-cli.js +7 -2
  14. package/dist/es5/converter-cli.js.map +1 -1
  15. package/dist/es5/deps-installer/deps-installer.js +112 -38
  16. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  17. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +21 -8
  18. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  19. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +7 -6
  20. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  21. package/dist/es5/i3s-converter/helpers/geometry-converter.js +78 -67
  22. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  23. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +38 -9
  24. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  25. package/dist/es5/i3s-converter/i3s-converter.js +86 -99
  26. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  27. package/dist/es5/i3s-converter/types.js +11 -11
  28. package/dist/es5/i3s-converter/types.js.map +1 -1
  29. package/dist/es5/i3s-server/controllers/slpk-controller.js +1 -1
  30. package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
  31. package/dist/es5/index.js +3 -3
  32. package/dist/es5/index.js.map +1 -1
  33. package/dist/es5/pgm-loader.js +1 -1
  34. package/dist/es5/slpk-extractor/helpers/{file-handle-provider.js → file-handle-file.js} +9 -9
  35. package/dist/es5/slpk-extractor/helpers/file-handle-file.js.map +1 -0
  36. package/dist/es5/slpk-extractor/slpk-extractor.js +5 -5
  37. package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
  38. package/dist/esm/constants.js +2 -0
  39. package/dist/esm/constants.js.map +1 -1
  40. package/dist/esm/converter-cli.js +7 -2
  41. package/dist/esm/converter-cli.js.map +1 -1
  42. package/dist/esm/deps-installer/deps-installer.js +37 -11
  43. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  44. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +18 -6
  45. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  46. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +7 -6
  47. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  48. package/dist/esm/i3s-converter/helpers/geometry-converter.js +37 -25
  49. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  50. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +28 -9
  51. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  52. package/dist/esm/i3s-converter/i3s-converter.js +49 -36
  53. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  54. package/dist/esm/i3s-converter/types.js +9 -9
  55. package/dist/esm/i3s-converter/types.js.map +1 -1
  56. package/dist/esm/i3s-server/bin/i3s-server.min.js +71 -71
  57. package/dist/esm/i3s-server/controllers/slpk-controller.js +2 -2
  58. package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/index.js.map +1 -1
  61. package/dist/esm/pgm-loader.js +1 -1
  62. package/dist/esm/slpk-extractor/helpers/{file-handle-provider.js → file-handle-file.js} +3 -3
  63. package/dist/esm/slpk-extractor/helpers/file-handle-file.js.map +1 -0
  64. package/dist/esm/slpk-extractor/slpk-extractor.js +3 -3
  65. package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
  66. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +11 -1
  67. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  68. package/dist/i3s-converter/helpers/batch-ids-extensions.js +33 -13
  69. package/dist/i3s-converter/helpers/geometry-attributes.js +7 -6
  70. package/dist/i3s-converter/helpers/geometry-converter.d.ts +7 -6
  71. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  72. package/dist/i3s-converter/helpers/geometry-converter.js +59 -47
  73. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +2 -2
  74. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
  75. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +39 -14
  76. package/dist/i3s-converter/i3s-converter.d.ts +2 -1
  77. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  78. package/dist/i3s-converter/i3s-converter.js +49 -31
  79. package/dist/i3s-converter/types.d.ts +4 -2
  80. package/dist/i3s-converter/types.d.ts.map +1 -1
  81. package/dist/i3s-converter/types.js +11 -11
  82. package/dist/i3s-server/controllers/slpk-controller.js +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +3 -3
  86. package/dist/slpk-extractor/helpers/{file-handle-provider.d.ts → file-handle-file.d.ts} +5 -5
  87. package/dist/slpk-extractor/helpers/file-handle-file.d.ts.map +1 -0
  88. package/dist/slpk-extractor/helpers/{file-handle-provider.js → file-handle-file.js} +5 -5
  89. package/dist/slpk-extractor/slpk-extractor.js +5 -5
  90. package/dist/slpk-extractor.min.js +32 -32
  91. package/package.json +15 -14
  92. package/src/constants.ts +3 -0
  93. package/src/converter-cli.ts +9 -2
  94. package/src/deps-installer/deps-installer.ts +55 -10
  95. package/src/i3s-converter/helpers/batch-ids-extensions.ts +39 -12
  96. package/src/i3s-converter/helpers/geometry-attributes.ts +15 -8
  97. package/src/i3s-converter/helpers/geometry-converter.ts +84 -48
  98. package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +48 -18
  99. package/src/i3s-converter/i3s-converter.ts +65 -39
  100. package/src/i3s-converter/types.ts +4 -2
  101. package/src/i3s-server/controllers/slpk-controller.ts +2 -2
  102. package/src/index.ts +1 -1
  103. package/src/slpk-extractor/helpers/{file-handle-provider.ts → file-handle-file.ts} +5 -5
  104. package/src/slpk-extractor/slpk-extractor.ts +3 -3
  105. package/dist/es5/slpk-extractor/helpers/file-handle-provider.js.map +0 -1
  106. package/dist/esm/slpk-extractor/helpers/file-handle-provider.js.map +0 -1
  107. package/dist/slpk-extractor/helpers/file-handle-provider.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["GltfPrimitiveModeString"],"sources":["../../../src/i3s-converter/types.ts"],"sourcesContent":["import {GLTFImagePostprocessed, GLTFNodePostprocessed} from '@loaders.gl/gltf';\nimport {\n BoundingVolumes,\n I3SMaterialDefinition,\n MaterialDefinitionInfo,\n TextureDefinitionInfo\n} from '@loaders.gl/i3s';\nimport {Matrix4, Vector3} from '@math.gl/core';\n\n/** Converted resources for specific node */\nexport type I3SConvertedResources = {\n /**\n * Node id\n */\n nodeId?: number;\n /** Non-compressed geometry buffer that have structure met\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n * (Geometry buffer)\n */\n geometry: ArrayBuffer | null;\n /**\n * Draco compressed geometry\n */\n compressedGeometry?: Promise<ArrayBuffer> | null;\n /**\n * Texture image content\n */\n texture: any | null;\n /**\n * If the resource has uvRegions geometry attribute\n */\n hasUvRegions: boolean;\n /**\n * Shared resources built from GLTF material\n */\n sharedResources: SharedResourcesArrays | null;\n /**\n * Material definition of the node\n */\n meshMaterial?: I3SMaterialDefinition | null;\n /**\n * Number of vertices in the node\n */\n vertexCount: number | null;\n /**\n * Feature attributes contents\n */\n attributes: ArrayBuffer[] | null;\n /**\n * Number of features in the node\n */\n featureCount: number | null;\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: BoundingVolumes | null;\n};\n\n/**\n * Geometry and feature attributes converted from GLTF primitives\n */\nexport type ConvertedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** Feature indices grouped by ...\n * converted from \"batch ids\" of GLTF\n */\n featureIndicesGroups?: number[][];\n /** Feature indices converted from \"batch ids\" */\n featureIndices: number[];\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: null | BoundingVolumes;\n /** merged materials data */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Postprocessed geometry and feature attributes\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\nexport type GeometryAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** faceRanges attribute value */\n faceRange: Uint32Array;\n /** feature Ids attribute value */\n featureIds: number[];\n /** number of features in the node */\n featureCount: number;\n};\n\n/** Geometry attributes specific for the particular feature */\nexport type GroupedByFeatureIdAttributes = {\n /** Feature Id */\n featureId: number;\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n};\n\n/** Shared resources made from GLTF material */\nexport type SharedResourcesArrays = {\n /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */\n materialDefinitionInfos?: MaterialDefinitionInfo[];\n /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/\n textureDefinitionInfos?: TextureDefinitionInfo[];\n /** node id to make unique SharedResource ids */\n nodePath?: string;\n};\n\n/** I3S material definition and texture content taken from GLTF material */\nexport type I3SMaterialWithTexture = {\n /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\n material: I3SMaterialDefinition;\n /** Texture content (image) */\n texture?: GLTFImagePostprocessed;\n /** Metadata of all merged materials */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Metadata of some original texture */\nexport type MergedMaterial = {\n /** Gltf material Id */\n originalMaterialId: string;\n /** Original texture size */\n textureSize?: {\n width: number;\n height: number;\n };\n /** Uint16Array of 4 elements https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md */\n uvRegion?: Uint16Array;\n};\n\nexport type TypedArrayConstructor =\n | Uint8ArrayConstructor\n | Int8ArrayConstructor\n | Uint16ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\n/**\n * glTF primitive modes (mesh topology types)\n * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode\n */\nexport enum GltfPrimitiveModeString {\n POINTS = 'POINTS',\n LINES = 'LINES',\n LINE_LOOP = 'LINE_LOOP',\n LINE_STRIP = 'LINE_STRIP',\n TRIANGLES = 'TRIANGLES',\n TRIANGLE_STRIP = 'TRIANGLE_STRIP',\n TRIANGLE_FAN = 'TRIANGLE_FAN'\n}\n\n/** Preprocessed data gathered from child tiles binary content */\nexport type PreprocessData = {\n /** Mesh topology types used in gltf primitives of the tileset */\n meshTopologyTypes: Set<GltfPrimitiveModeString>;\n};\n\n/** Texture image properties required for conversion */\nexport type TextureImageProperties = {\n /** Array with image data */\n data: Uint8Array;\n /** Is the texture compressed */\n compressed?: boolean;\n /** Height of the texture's image */\n height?: number;\n /** Width of the texture's image */\n width?: number;\n /** Number of components (3 for RGB, 4 for RGBA) */\n components?: number;\n /** Mime type of the texture's image */\n mimeType?: string;\n};\n\n/** glTF attributes data, prepared for conversion */\nexport type GLTFAttributesData = {\n /** glTF PBR materials (only id is required) */\n gltfMaterials?: {id: string}[];\n /** glTF geometry nodes */\n nodes: GLTFNodePostprocessed[];\n /** glTF texture images (set to null for compressed textures) */\n images: (null | TextureImageProperties)[];\n /** Source tile origin coordinates in cartographic coordinate system */\n cartographicOrigin: Vector3;\n /** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */\n cartesianModelMatrix: Matrix4;\n};\n"],"mappings":"AA2KA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}
1
+ {"version":3,"file":"types.js","names":["GLTFPrimitiveModeString"],"sources":["../../../src/i3s-converter/types.ts"],"sourcesContent":["import {GLTFImagePostprocessed, GLTFNodePostprocessed} from '@loaders.gl/gltf';\nimport {\n BoundingVolumes,\n I3SMaterialDefinition,\n MaterialDefinitionInfo,\n TextureDefinitionInfo\n} from '@loaders.gl/i3s';\nimport {Matrix4, Vector3} from '@math.gl/core';\n\n/** Converted resources for specific node */\nexport type I3SConvertedResources = {\n /**\n * Node id\n */\n nodeId?: number;\n /** Non-compressed geometry buffer that have structure met\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n * (Geometry buffer)\n */\n geometry: ArrayBuffer | null;\n /**\n * Draco compressed geometry\n */\n compressedGeometry?: Promise<ArrayBuffer> | null;\n /**\n * Texture image content\n */\n texture: any | null;\n /**\n * If the resource has uvRegions geometry attribute\n */\n hasUvRegions: boolean;\n /**\n * Shared resources built from GLTF material\n */\n sharedResources: SharedResourcesArrays | null;\n /**\n * Material definition of the node\n */\n meshMaterial?: I3SMaterialDefinition | null;\n /**\n * Number of vertices in the node\n */\n vertexCount: number | null;\n /**\n * Feature attributes contents\n */\n attributes: ArrayBuffer[] | null;\n /**\n * Number of features in the node\n */\n featureCount: number | null;\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: BoundingVolumes | null;\n};\n\n/**\n * Geometry and feature attributes converted from GLTF primitives\n */\nexport type ConvertedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** Feature indices grouped by ...\n * converted from \"batch ids\" of GLTF\n */\n featureIndicesGroups?: number[][];\n /** Feature indices converted from \"batch ids\" */\n featureIndices: number[];\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: null | BoundingVolumes;\n /** merged materials data */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Postprocessed geometry and feature attributes\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\nexport type GeometryAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** faceRanges attribute value */\n faceRange: Uint32Array;\n /** feature Ids attribute value */\n featureIds: number[];\n /** number of features in the node */\n featureCount: number;\n};\n\n/** Geometry attributes specific for the particular feature */\nexport type GroupedByFeatureIdAttributes = {\n /** Feature Id */\n featureId: number;\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n};\n\n/** Shared resources made from GLTF material */\nexport type SharedResourcesArrays = {\n /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */\n materialDefinitionInfos?: MaterialDefinitionInfo[];\n /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/\n textureDefinitionInfos?: TextureDefinitionInfo[];\n /** node id to make unique SharedResource ids */\n nodePath?: string;\n};\n\n/** I3S material definition and texture content taken from GLTF material */\nexport type I3SMaterialWithTexture = {\n /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\n material: I3SMaterialDefinition;\n /** Texture content (image) */\n texture?: GLTFImagePostprocessed;\n /** Metadata of all merged materials */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Metadata of some original texture */\nexport type MergedMaterial = {\n /** Gltf material Id */\n originalMaterialId: string;\n /** Original texture size */\n textureSize?: {\n width: number;\n height: number;\n };\n /** Uint16Array of 4 elements https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md */\n uvRegion?: Uint16Array;\n};\n\nexport type TypedArrayConstructor =\n | Uint8ArrayConstructor\n | Int8ArrayConstructor\n | Uint16ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\n/**\n * glTF primitive modes (mesh topology types)\n * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode\n */\nexport enum GLTFPrimitiveModeString {\n POINTS = 'POINTS',\n LINES = 'LINES',\n LINE_LOOP = 'LINE_LOOP',\n LINE_STRIP = 'LINE_STRIP',\n TRIANGLES = 'TRIANGLES',\n TRIANGLE_STRIP = 'TRIANGLE_STRIP',\n TRIANGLE_FAN = 'TRIANGLE_FAN'\n}\n\n/** Preprocessed data gathered from child tiles binary content */\nexport type PreprocessData = {\n /** Mesh topology types used in gltf primitives of the tileset */\n meshTopologyTypes: Set<GLTFPrimitiveModeString>;\n /** Featrue metadata classes found in glTF extensions */\n metadataClasses: Set<string>;\n};\n\n/** Texture image properties required for conversion */\nexport type TextureImageProperties = {\n /** Array with image data */\n data: Uint8Array;\n /** Is the texture compressed */\n compressed?: boolean;\n /** Height of the texture's image */\n height?: number;\n /** Width of the texture's image */\n width?: number;\n /** Number of components (3 for RGB, 4 for RGBA) */\n components?: number;\n /** Mime type of the texture's image */\n mimeType?: string;\n};\n\n/** glTF attributes data, prepared for conversion */\nexport type GLTFAttributesData = {\n /** glTF PBR materials (only id is required) */\n gltfMaterials?: {id: string}[];\n /** glTF geometry nodes */\n nodes: GLTFNodePostprocessed[];\n /** glTF texture images (set to null for compressed textures) */\n images: (null | TextureImageProperties)[];\n /** Source tile origin coordinates in cartographic coordinate system */\n cartographicOrigin: Vector3;\n /** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */\n cartesianModelMatrix: Matrix4;\n};\n"],"mappings":"AA2KA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}