@ptloader/pcd
Advanced tools
Comparing version 3.3.18 to 3.3.22
@@ -16,3 +16,69 @@ (() => { | ||
// ../schema/src/category/mesh/mesh-utils.ts | ||
// ../../node_modules/@babel/runtime/helpers/esm/typeof.js | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { | ||
return typeof obj2; | ||
} : function(obj2) { | ||
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; | ||
}, _typeof(obj); | ||
} | ||
var init_typeof = __esm({ | ||
"../../node_modules/@babel/runtime/helpers/esm/typeof.js"() { | ||
} | ||
}); | ||
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) | ||
return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== void 0) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") | ||
return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
var init_toPrimitive = __esm({ | ||
"../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"() { | ||
init_typeof(); | ||
} | ||
}); | ||
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
var init_toPropertyKey = __esm({ | ||
"../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"() { | ||
init_typeof(); | ||
init_toPrimitive(); | ||
} | ||
}); | ||
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var init_defineProperty = __esm({ | ||
"../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"() { | ||
init_toPropertyKey(); | ||
} | ||
}); | ||
// ../schema/dist/esm/category/mesh/mesh-utils.js | ||
function getMeshBoundingBox(attributes) { | ||
@@ -38,13 +104,10 @@ let minX = Infinity; | ||
} | ||
return [ | ||
[minX, minY, minZ], | ||
[maxX, maxY, maxZ] | ||
]; | ||
return [[minX, minY, minZ], [maxX, maxY, maxZ]]; | ||
} | ||
var init_mesh_utils = __esm({ | ||
"../schema/src/category/mesh/mesh-utils.ts"() { | ||
"../schema/dist/esm/category/mesh/mesh-utils.js"() { | ||
} | ||
}); | ||
// ../schema/src/lib/utils/assert.ts | ||
// ../schema/dist/esm/lib/utils/assert.js | ||
function assert(condition, message) { | ||
@@ -56,7 +119,7 @@ if (!condition) { | ||
var init_assert = __esm({ | ||
"../schema/src/lib/utils/assert.ts"() { | ||
"../schema/dist/esm/lib/utils/assert.js"() { | ||
} | ||
}); | ||
// ../schema/src/lib/schema/impl/schema.ts | ||
// ../schema/dist/esm/lib/schema/impl/schema.js | ||
function checkNames(fields) { | ||
@@ -76,6 +139,9 @@ const usedNames = {}; | ||
var init_schema = __esm({ | ||
"../schema/src/lib/schema/impl/schema.ts"() { | ||
"../schema/dist/esm/lib/schema/impl/schema.js"() { | ||
init_defineProperty(); | ||
init_assert(); | ||
Schema = class { | ||
constructor(fields, metadata) { | ||
_defineProperty(this, "fields", void 0); | ||
_defineProperty(this, "metadata", void 0); | ||
assert(Array.isArray(fields)); | ||
@@ -100,4 +166,7 @@ checkNames(fields); | ||
} | ||
select(...columnNames) { | ||
select() { | ||
const nameMap = Object.create(null); | ||
for (var _len = arguments.length, columnNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
columnNames[_key] = arguments[_key]; | ||
} | ||
for (const name of columnNames) { | ||
@@ -109,3 +178,6 @@ nameMap[name] = true; | ||
} | ||
selectAt(...columnIndices) { | ||
selectAt() { | ||
for (var _len2 = arguments.length, columnIndices = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
columnIndices[_key2] = arguments[_key2]; | ||
} | ||
const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean); | ||
@@ -138,8 +210,15 @@ return new Schema(selectedFields, this.metadata); | ||
// ../schema/src/lib/schema/impl/field.ts | ||
// ../schema/dist/esm/lib/schema/impl/field.js | ||
var Field; | ||
var init_field = __esm({ | ||
"../schema/src/lib/schema/impl/field.ts"() { | ||
"../schema/dist/esm/lib/schema/impl/field.js"() { | ||
init_defineProperty(); | ||
Field = class { | ||
constructor(name, type, nullable = false, metadata = new Map()) { | ||
constructor(name, type) { | ||
let nullable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; | ||
let metadata = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : new Map(); | ||
_defineProperty(this, "name", void 0); | ||
_defineProperty(this, "type", void 0); | ||
_defineProperty(this, "nullable", void 0); | ||
_defineProperty(this, "metadata", void 0); | ||
this.name = name; | ||
@@ -160,3 +239,3 @@ this.type = type; | ||
toString() { | ||
return `${this.type}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${this.metadata}` : ""}`; | ||
return "".concat(this.type).concat(this.nullable ? ", nullable" : "").concat(this.metadata ? ", metadata: ".concat(this.metadata) : ""); | ||
} | ||
@@ -167,6 +246,6 @@ }; | ||
// ../schema/src/lib/schema/impl/enum.ts | ||
// ../schema/dist/esm/lib/schema/impl/enum.js | ||
var Type; | ||
var init_enum = __esm({ | ||
"../schema/src/lib/schema/impl/enum.ts"() { | ||
"../schema/dist/esm/lib/schema/impl/enum.js"() { | ||
(function(Type2) { | ||
@@ -221,6 +300,7 @@ Type2[Type2["NONE"] = 0] = "NONE"; | ||
// ../schema/src/lib/schema/impl/type.ts | ||
var DataType, Null, Bool, Int, Uint8, Precision, Float, Float32, Binary, Utf8, DateUnit, Date, TimeUnit, Time, Timestamp, IntervalUnit, Interval, FixedSizeList, Struct; | ||
// ../schema/dist/esm/lib/schema/impl/type.js | ||
var _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8, DataType, Null, Bool, Int, Uint8, Precision, Float, Float32, Binary, Utf8, FixedSizeList; | ||
var init_type = __esm({ | ||
"../schema/src/lib/schema/impl/type.ts"() { | ||
"../schema/dist/esm/lib/schema/impl/type.js"() { | ||
init_defineProperty(); | ||
init_enum(); | ||
@@ -311,5 +391,8 @@ DataType = class { | ||
}; | ||
_Symbol$toStringTag = Symbol.toStringTag; | ||
Int = class extends DataType { | ||
constructor(isSigned, bitWidth) { | ||
super(); | ||
_defineProperty(this, "isSigned", void 0); | ||
_defineProperty(this, "bitWidth", void 0); | ||
this.isSigned = isSigned; | ||
@@ -321,7 +404,7 @@ this.bitWidth = bitWidth; | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag]() { | ||
return "Int"; | ||
} | ||
toString() { | ||
return `${this.isSigned ? "I" : "Ui"}nt${this.bitWidth}`; | ||
return "".concat(this.isSigned ? "I" : "Ui", "nt").concat(this.bitWidth); | ||
} | ||
@@ -339,5 +422,7 @@ }; | ||
}; | ||
_Symbol$toStringTag2 = Symbol.toStringTag; | ||
Float = class extends DataType { | ||
constructor(precision) { | ||
super(); | ||
_defineProperty(this, "precision", void 0); | ||
this.precision = precision; | ||
@@ -348,7 +433,7 @@ } | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag2]() { | ||
return "Float"; | ||
} | ||
toString() { | ||
return `Float${this.precision}`; | ||
return "Float".concat(this.precision); | ||
} | ||
@@ -386,81 +471,12 @@ }; | ||
}; | ||
DateUnit = { | ||
DAY: 0, | ||
MILLISECOND: 1 | ||
}; | ||
Date = class extends DataType { | ||
constructor(unit) { | ||
super(); | ||
this.unit = unit; | ||
} | ||
get typeId() { | ||
return Type.Date; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Date"; | ||
} | ||
toString() { | ||
return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`; | ||
} | ||
}; | ||
TimeUnit = { | ||
SECOND: 1, | ||
MILLISECOND: 1e3, | ||
MICROSECOND: 1e6, | ||
NANOSECOND: 1e9 | ||
}; | ||
Time = class extends DataType { | ||
constructor(unit, bitWidth) { | ||
super(); | ||
this.unit = unit; | ||
this.bitWidth = bitWidth; | ||
} | ||
get typeId() { | ||
return Type.Time; | ||
} | ||
toString() { | ||
return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Time"; | ||
} | ||
}; | ||
Timestamp = class extends DataType { | ||
constructor(unit, timezone = null) { | ||
super(); | ||
this.unit = unit; | ||
this.timezone = timezone; | ||
} | ||
get typeId() { | ||
return Type.Timestamp; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Timestamp"; | ||
} | ||
toString() { | ||
return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ""}>`; | ||
} | ||
}; | ||
IntervalUnit = { | ||
DAY_TIME: 0, | ||
YEAR_MONTH: 1 | ||
}; | ||
Interval = class extends DataType { | ||
constructor(unit) { | ||
super(); | ||
this.unit = unit; | ||
} | ||
get typeId() { | ||
return Type.Interval; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Interval"; | ||
} | ||
toString() { | ||
return `Interval<${IntervalUnit[this.unit]}>`; | ||
} | ||
}; | ||
_Symbol$toStringTag3 = Symbol.toStringTag; | ||
_Symbol$toStringTag4 = Symbol.toStringTag; | ||
_Symbol$toStringTag5 = Symbol.toStringTag; | ||
_Symbol$toStringTag6 = Symbol.toStringTag; | ||
_Symbol$toStringTag7 = Symbol.toStringTag; | ||
FixedSizeList = class extends DataType { | ||
constructor(listSize, child) { | ||
super(); | ||
_defineProperty(this, "listSize", void 0); | ||
_defineProperty(this, "children", void 0); | ||
this.listSize = listSize; | ||
@@ -478,30 +494,16 @@ this.children = [child]; | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag7]() { | ||
return "FixedSizeList"; | ||
} | ||
toString() { | ||
return `FixedSizeList[${this.listSize}]<${this.valueType}>`; | ||
return "FixedSizeList[".concat(this.listSize, "]<").concat(this.valueType, ">"); | ||
} | ||
}; | ||
Struct = class extends DataType { | ||
constructor(children) { | ||
super(); | ||
this.children = children; | ||
} | ||
get typeId() { | ||
return Type.Struct; | ||
} | ||
toString() { | ||
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(", ")}}>`; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Struct"; | ||
} | ||
}; | ||
_Symbol$toStringTag8 = Symbol.toStringTag; | ||
} | ||
}); | ||
// ../schema/src/lib/schema/schema.ts | ||
// ../schema/dist/esm/lib/schema/schema.js | ||
var init_schema2 = __esm({ | ||
"../schema/src/lib/schema/schema.ts"() { | ||
"../schema/dist/esm/lib/schema/schema.js"() { | ||
init_schema(); | ||
@@ -513,5 +515,5 @@ init_field(); | ||
// ../schema/src/index.ts | ||
var init_src = __esm({ | ||
"../schema/src/index.ts"() { | ||
// ../schema/dist/esm/index.js | ||
var init_esm = __esm({ | ||
"../schema/dist/esm/index.js"() { | ||
init_mesh_utils(); | ||
@@ -588,3 +590,3 @@ init_schema2(); | ||
"src/lib/get-pcd-schema.ts"() { | ||
init_src(); | ||
init_esm(); | ||
} | ||
@@ -824,3 +826,3 @@ }); | ||
"src/lib/parse-pcd.ts"() { | ||
init_src(); | ||
init_esm(); | ||
init_decompress_lzf(); | ||
@@ -860,3 +862,3 @@ init_get_pcd_schema(); | ||
var PCDLoader2, _typecheckPCDLoader; | ||
var init_src2 = __esm({ | ||
var init_src = __esm({ | ||
"src/index.ts"() { | ||
@@ -877,3 +879,3 @@ init_parse_pcd(); | ||
"src/bundle.ts"(exports, module) { | ||
var moduleExports = (init_src2(), src_exports); | ||
var moduleExports = (init_src(), src_exports); | ||
globalThis.loaders = globalThis.loaders || {}; | ||
@@ -880,0 +882,0 @@ module.exports = Object.assign(globalThis.loaders, moduleExports); |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.getPCDSchema = getPCDSchema; | ||
var _schema = require("@loaders.gl/schema"); | ||
var _schema = require("@ptloader/schema"); | ||
function getPCDSchema(PCDheader, metadata) { | ||
@@ -10,0 +10,0 @@ var offset = PCDheader.offset; |
@@ -7,8 +7,6 @@ "use strict"; | ||
exports.default = parsePCD; | ||
var _schema = require("@loaders.gl/schema"); | ||
var _schema = require("@ptloader/schema"); | ||
var _decompressLzf = require("./decompress-lzf"); | ||
var _getPcdSchema = require("./get-pcd-schema"); | ||
var LITTLE_ENDIAN = true; | ||
function parsePCD(data) { | ||
@@ -18,3 +16,2 @@ var textData = new TextDecoder().decode(data); | ||
var attributes = {}; | ||
switch (pcdHeader.data) { | ||
@@ -48,3 +45,2 @@ case 'ascii': | ||
} | ||
function getMeshHeader(pcdHeader, attributes) { | ||
@@ -60,3 +56,2 @@ if (typeof pcdHeader.width === 'number' && typeof pcdHeader.height === 'number') { | ||
} | ||
function getMeshAttributes(attributes) { | ||
@@ -83,3 +78,2 @@ var normalizedAttributes = { | ||
} | ||
function parsePCDHeader(data) { | ||
@@ -94,5 +88,3 @@ var result1 = data.search(/[\r\n]DATA\s(\S*)\s/i); | ||
pcdHeader.str = data.substr(0, pcdHeader.headerLen); | ||
pcdHeader.str = pcdHeader.str.replace(/\#.*/gi, ''); | ||
pcdHeader.version = /VERSION (.*)/i.exec(pcdHeader.str); | ||
@@ -107,3 +99,2 @@ pcdHeader.fields = /FIELDS (.*)/i.exec(pcdHeader.str); | ||
pcdHeader.points = /POINTS (.*)/i.exec(pcdHeader.str); | ||
if (pcdHeader.version !== null) { | ||
@@ -162,7 +153,5 @@ pcdHeader.version = parseFloat(pcdHeader.version[1]); | ||
} | ||
pcdHeader.rowSize = sizeSum; | ||
return pcdHeader; | ||
} | ||
function parsePCDASCII(pcdHeader, textData) { | ||
@@ -191,3 +180,2 @@ var position = []; | ||
} | ||
if (offset.normal_x !== undefined) { | ||
@@ -206,3 +194,2 @@ normal.push(parseFloat(line[offset.normal_x])); | ||
} | ||
function parsePCDBinary(pcdHeader, data) { | ||
@@ -209,0 +196,0 @@ var position = []; |
@@ -7,4 +7,3 @@ "use strict"; | ||
exports._typecheckPCDLoader = exports.PCDLoader = void 0; | ||
var VERSION = typeof "3.3.18" !== 'undefined' ? "3.3.18" : 'latest'; | ||
var VERSION = typeof "3.3.22" !== 'undefined' ? "3.3.22" : 'latest'; | ||
var PCDLoader = { | ||
@@ -11,0 +10,0 @@ name: 'PCD (Point Cloud Data)', |
"use strict"; | ||
var _loaderUtils = require("@loaders.gl/loader-utils"); | ||
var _loaderUtils = require("@ptloader/loader-utils"); | ||
var _index = require("../index"); | ||
(0, _loaderUtils.createLoaderWorker)(_index.PCDLoader); | ||
//# sourceMappingURL=pcd-worker.js.map |
@@ -1,2 +0,1 @@ | ||
const moduleExports = require('./index'); | ||
@@ -3,0 +2,0 @@ globalThis.loaders = globalThis.loaders || {}; |
import parsePCDSync from './lib/parse-pcd'; | ||
import { PCDLoader as PCDWorkerLoader } from './pcd-loader'; | ||
export { PCDWorkerLoader }; | ||
export const PCDLoader = { | ||
@@ -6,0 +5,0 @@ ...PCDWorkerLoader, |
@@ -1,2 +0,1 @@ | ||
export function decompressLZF(inData, outLength) { | ||
@@ -3,0 +2,0 @@ const inLength = inData.length; |
@@ -1,2 +0,2 @@ | ||
import { Schema, Field, Float32, Uint8, FixedSizeList } from '@loaders.gl/schema'; | ||
import { Schema, Field, Float32, Uint8, FixedSizeList } from '@ptloader/schema'; | ||
export function getPCDSchema(PCDheader, metadata) { | ||
@@ -3,0 +3,0 @@ const offset = PCDheader.offset; |
@@ -1,8 +0,5 @@ | ||
import { getMeshBoundingBox } from '@loaders.gl/schema'; | ||
import { getMeshBoundingBox } from '@ptloader/schema'; | ||
import { decompressLZF } from './decompress-lzf'; | ||
import { getPCDSchema } from './get-pcd-schema'; | ||
const LITTLE_ENDIAN = true; | ||
export default function parsePCD(data) { | ||
@@ -12,3 +9,2 @@ const textData = new TextDecoder().decode(data); | ||
let attributes = {}; | ||
switch (pcdHeader.data) { | ||
@@ -42,3 +38,2 @@ case 'ascii': | ||
} | ||
function getMeshHeader(pcdHeader, attributes) { | ||
@@ -54,3 +49,2 @@ if (typeof pcdHeader.width === 'number' && typeof pcdHeader.height === 'number') { | ||
} | ||
function getMeshAttributes(attributes) { | ||
@@ -77,3 +71,2 @@ const normalizedAttributes = { | ||
} | ||
function parsePCDHeader(data) { | ||
@@ -88,5 +81,3 @@ const result1 = data.search(/[\r\n]DATA\s(\S*)\s/i); | ||
pcdHeader.str = data.substr(0, pcdHeader.headerLen); | ||
pcdHeader.str = pcdHeader.str.replace(/\#.*/gi, ''); | ||
pcdHeader.version = /VERSION (.*)/i.exec(pcdHeader.str); | ||
@@ -101,3 +92,2 @@ pcdHeader.fields = /FIELDS (.*)/i.exec(pcdHeader.str); | ||
pcdHeader.points = /POINTS (.*)/i.exec(pcdHeader.str); | ||
if (pcdHeader.version !== null) { | ||
@@ -152,7 +142,5 @@ pcdHeader.version = parseFloat(pcdHeader.version[1]); | ||
} | ||
pcdHeader.rowSize = sizeSum; | ||
return pcdHeader; | ||
} | ||
function parsePCDASCII(pcdHeader, textData) { | ||
@@ -181,3 +169,2 @@ const position = []; | ||
} | ||
if (offset.normal_x !== undefined) { | ||
@@ -196,3 +183,2 @@ normal.push(parseFloat(line[offset.normal_x])); | ||
} | ||
function parsePCDBinary(pcdHeader, data) { | ||
@@ -199,0 +185,0 @@ const position = []; |
@@ -1,4 +0,2 @@ | ||
const VERSION = typeof "3.3.18" !== 'undefined' ? "3.3.18" : 'latest'; | ||
const VERSION = typeof "3.3.22" !== 'undefined' ? "3.3.22" : 'latest'; | ||
export const PCDLoader = { | ||
@@ -5,0 +3,0 @@ name: 'PCD (Point Cloud Data)', |
@@ -1,4 +0,4 @@ | ||
import { createLoaderWorker } from '@loaders.gl/loader-utils'; | ||
import { createLoaderWorker } from '@ptloader/loader-utils'; | ||
import { PCDLoader } from '../index'; | ||
createLoaderWorker(PCDLoader); | ||
//# sourceMappingURL=pcd-worker.js.map |
@@ -1,2 +0,2 @@ | ||
import type { LoaderWithParser } from '@loaders.gl/loader-utils'; | ||
import type { LoaderWithParser } from '@ptloader/loader-utils'; | ||
import parsePCDSync from './lib/parse-pcd'; | ||
@@ -14,3 +14,3 @@ import { PCDLoader as PCDWorkerLoader } from './pcd-loader'; | ||
header: Partial<import("./lib/pcd-types").PCDHeader>; | ||
schema: import("@loaders.gl/schema").Schema; | ||
schema: import("modules/schema/dist").Schema; | ||
mode: number; | ||
@@ -17,0 +17,0 @@ indices: null; |
@@ -1,2 +0,2 @@ | ||
import { Schema } from '@loaders.gl/schema'; | ||
import { Schema } from '@ptloader/schema'; | ||
import type { PCDHeader } from './pcd-types'; | ||
@@ -3,0 +3,0 @@ type SchemaMetadata = Map<string, any>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPCDSchema = void 0; | ||
const schema_1 = require("@loaders.gl/schema"); | ||
const schema_1 = require("@ptloader/schema"); | ||
/** | ||
@@ -6,0 +6,0 @@ * Gets schema from PCD header |
@@ -12,3 +12,3 @@ import type { PCDHeader } from './pcd-types'; | ||
header: Partial<PCDHeader>; | ||
schema: import("@loaders.gl/schema").Schema; | ||
schema: import("@ptloader/schema").Schema; | ||
mode: number; | ||
@@ -15,0 +15,0 @@ indices: null; |
@@ -10,3 +10,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const schema_1 = require("@loaders.gl/schema"); | ||
const schema_1 = require("@ptloader/schema"); | ||
const decompress_lzf_1 = require("./decompress-lzf"); | ||
@@ -13,0 +13,0 @@ const get_pcd_schema_1 = require("./get-pcd-schema"); |
@@ -1,2 +0,2 @@ | ||
import type { Mesh } from '@loaders.gl/schema'; | ||
import type { Mesh } from '@ptloader/schema'; | ||
type BoundingBox = [[number, number, number], [number, number, number]]; | ||
@@ -3,0 +3,0 @@ export type PCDHeader = { |
@@ -1,2 +0,2 @@ | ||
import type { Loader } from '@loaders.gl/loader-utils'; | ||
import type { Loader } from '@ptloader/loader-utils'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Worker loader for PCD - Point Cloud Data |
(() => { | ||
// ../worker-utils/src/lib/worker-utils/get-transfer-list.ts | ||
function getTransferList(object, recursive = true, transfers) { | ||
// ../../node_modules/@babel/runtime/helpers/esm/typeof.js | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { | ||
return typeof obj2; | ||
} : function(obj2) { | ||
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; | ||
}, _typeof(obj); | ||
} | ||
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js | ||
function _toPrimitive(input, hint) { | ||
if (_typeof(input) !== "object" || input === null) | ||
return input; | ||
var prim = input[Symbol.toPrimitive]; | ||
if (prim !== void 0) { | ||
var res = prim.call(input, hint || "default"); | ||
if (_typeof(res) !== "object") | ||
return res; | ||
throw new TypeError("@@toPrimitive must return a primitive value."); | ||
} | ||
return (hint === "string" ? String : Number)(input); | ||
} | ||
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | ||
function _toPropertyKey(arg) { | ||
var key = _toPrimitive(arg, "string"); | ||
return _typeof(key) === "symbol" ? key : String(key); | ||
} | ||
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js | ||
function _defineProperty(obj, key, value) { | ||
key = _toPropertyKey(key); | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
// ../worker-utils/dist/esm/lib/worker-utils/get-transfer-list.js | ||
function getTransferList(object) { | ||
let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; | ||
let transfers = arguments.length > 2 ? arguments[2] : void 0; | ||
const transfersSet = transfers || new Set(); | ||
@@ -37,3 +85,3 @@ if (!object) { | ||
// ../worker-utils/src/lib/worker-farm/worker-body.ts | ||
// ../worker-utils/dist/esm/lib/worker-farm/worker-body.js | ||
function getParentPort() { | ||
@@ -56,3 +104,6 @@ let parentPort; | ||
const parentPort3 = getParentPort(); | ||
const { type, payload } = parentPort3 ? message : message.data; | ||
const { | ||
type, | ||
payload | ||
} = parentPort3 ? message : message.data; | ||
onMessage(type, payload); | ||
@@ -76,3 +127,6 @@ } | ||
const parentPort3 = getParentPort(); | ||
const { type, payload } = parentPort3 ? message : message.data; | ||
const { | ||
type, | ||
payload | ||
} = parentPort3 ? message : message.data; | ||
onMessage(type, payload); | ||
@@ -99,3 +153,7 @@ }; | ||
static postMessage(type, payload) { | ||
const data = { source: "loaders.gl", type, payload }; | ||
const data = { | ||
source: "loaders.gl", | ||
type, | ||
payload | ||
}; | ||
const transferList = getTransferList(payload); | ||
@@ -111,7 +169,10 @@ const parentPort2 = getParentPort(); | ||
function isKnownMessage(message) { | ||
const { type, data } = message; | ||
const { | ||
type, | ||
data | ||
} = message; | ||
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl"); | ||
} | ||
// ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts | ||
// ../loader-utils/dist/esm/lib/worker-loader-utils/create-loader-worker.js | ||
var requestId = 0; | ||
@@ -126,3 +187,7 @@ function createLoaderWorker(loader) { | ||
try { | ||
const { input, options = {}, context = {} } = payload; | ||
const { | ||
input, | ||
options = {}, | ||
context = {} | ||
} = payload; | ||
const result = await parseData({ | ||
@@ -137,6 +202,10 @@ loader, | ||
}); | ||
WorkerBody.postMessage("done", { result }); | ||
WorkerBody.postMessage("done", { | ||
result | ||
}); | ||
} catch (error) { | ||
const message = error instanceof Error ? error.message : ""; | ||
WorkerBody.postMessage("error", { error: message }); | ||
WorkerBody.postMessage("error", { | ||
error: message | ||
}); | ||
} | ||
@@ -168,7 +237,17 @@ break; | ||
WorkerBody.addEventListener(onMessage); | ||
const payload = { id, input: arrayBuffer, options }; | ||
const payload = { | ||
id, | ||
input: arrayBuffer, | ||
options | ||
}; | ||
WorkerBody.postMessage("process", payload); | ||
}); | ||
} | ||
async function parseData({ loader, arrayBuffer, options, context }) { | ||
async function parseData(_ref) { | ||
let { | ||
loader, | ||
arrayBuffer, | ||
options, | ||
context | ||
} = _ref; | ||
let data; | ||
@@ -184,3 +263,3 @@ let parser; | ||
} else { | ||
throw new Error(`Could not load data with ${loader.name} loader`); | ||
throw new Error("Could not load data with ".concat(loader.name, " loader")); | ||
} | ||
@@ -192,6 +271,8 @@ options = { | ||
}; | ||
return await parser(data, { ...options }, context, loader); | ||
return await parser(data, { | ||
...options | ||
}, context, loader); | ||
} | ||
// ../schema/src/category/mesh/mesh-utils.ts | ||
// ../schema/dist/esm/category/mesh/mesh-utils.js | ||
function getMeshBoundingBox(attributes) { | ||
@@ -217,9 +298,6 @@ let minX = Infinity; | ||
} | ||
return [ | ||
[minX, minY, minZ], | ||
[maxX, maxY, maxZ] | ||
]; | ||
return [[minX, minY, minZ], [maxX, maxY, maxZ]]; | ||
} | ||
// ../schema/src/lib/utils/assert.ts | ||
// ../schema/dist/esm/lib/utils/assert.js | ||
function assert(condition, message) { | ||
@@ -231,5 +309,7 @@ if (!condition) { | ||
// ../schema/src/lib/schema/impl/schema.ts | ||
// ../schema/dist/esm/lib/schema/impl/schema.js | ||
var Schema = class { | ||
constructor(fields, metadata) { | ||
_defineProperty(this, "fields", void 0); | ||
_defineProperty(this, "metadata", void 0); | ||
assert(Array.isArray(fields)); | ||
@@ -254,4 +334,7 @@ checkNames(fields); | ||
} | ||
select(...columnNames) { | ||
select() { | ||
const nameMap = Object.create(null); | ||
for (var _len = arguments.length, columnNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
columnNames[_key] = arguments[_key]; | ||
} | ||
for (const name of columnNames) { | ||
@@ -263,3 +346,6 @@ nameMap[name] = true; | ||
} | ||
selectAt(...columnIndices) { | ||
selectAt() { | ||
for (var _len2 = arguments.length, columnIndices = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
columnIndices[_key2] = arguments[_key2]; | ||
} | ||
const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean); | ||
@@ -302,5 +388,11 @@ return new Schema(selectedFields, this.metadata); | ||
// ../schema/src/lib/schema/impl/field.ts | ||
// ../schema/dist/esm/lib/schema/impl/field.js | ||
var Field = class { | ||
constructor(name, type, nullable = false, metadata = new Map()) { | ||
constructor(name, type) { | ||
let nullable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; | ||
let metadata = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : new Map(); | ||
_defineProperty(this, "name", void 0); | ||
_defineProperty(this, "type", void 0); | ||
_defineProperty(this, "nullable", void 0); | ||
_defineProperty(this, "metadata", void 0); | ||
this.name = name; | ||
@@ -321,7 +413,7 @@ this.type = type; | ||
toString() { | ||
return `${this.type}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${this.metadata}` : ""}`; | ||
return "".concat(this.type).concat(this.nullable ? ", nullable" : "").concat(this.metadata ? ", metadata: ".concat(this.metadata) : ""); | ||
} | ||
}; | ||
// ../schema/src/lib/schema/impl/enum.ts | ||
// ../schema/dist/esm/lib/schema/impl/enum.js | ||
var Type; | ||
@@ -375,3 +467,11 @@ (function(Type2) { | ||
// ../schema/src/lib/schema/impl/type.ts | ||
// ../schema/dist/esm/lib/schema/impl/type.js | ||
var _Symbol$toStringTag; | ||
var _Symbol$toStringTag2; | ||
var _Symbol$toStringTag3; | ||
var _Symbol$toStringTag4; | ||
var _Symbol$toStringTag5; | ||
var _Symbol$toStringTag6; | ||
var _Symbol$toStringTag7; | ||
var _Symbol$toStringTag8; | ||
var DataType = class { | ||
@@ -461,5 +561,8 @@ static isNull(x) { | ||
}; | ||
_Symbol$toStringTag = Symbol.toStringTag; | ||
var Int = class extends DataType { | ||
constructor(isSigned, bitWidth) { | ||
super(); | ||
_defineProperty(this, "isSigned", void 0); | ||
_defineProperty(this, "bitWidth", void 0); | ||
this.isSigned = isSigned; | ||
@@ -471,7 +574,7 @@ this.bitWidth = bitWidth; | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag]() { | ||
return "Int"; | ||
} | ||
toString() { | ||
return `${this.isSigned ? "I" : "Ui"}nt${this.bitWidth}`; | ||
return "".concat(this.isSigned ? "I" : "Ui", "nt").concat(this.bitWidth); | ||
} | ||
@@ -489,5 +592,7 @@ }; | ||
}; | ||
_Symbol$toStringTag2 = Symbol.toStringTag; | ||
var Float = class extends DataType { | ||
constructor(precision) { | ||
super(); | ||
_defineProperty(this, "precision", void 0); | ||
this.precision = precision; | ||
@@ -498,7 +603,7 @@ } | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag2]() { | ||
return "Float"; | ||
} | ||
toString() { | ||
return `Float${this.precision}`; | ||
return "Float".concat(this.precision); | ||
} | ||
@@ -536,81 +641,12 @@ }; | ||
}; | ||
var DateUnit = { | ||
DAY: 0, | ||
MILLISECOND: 1 | ||
}; | ||
var Date = class extends DataType { | ||
constructor(unit) { | ||
super(); | ||
this.unit = unit; | ||
} | ||
get typeId() { | ||
return Type.Date; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Date"; | ||
} | ||
toString() { | ||
return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`; | ||
} | ||
}; | ||
var TimeUnit = { | ||
SECOND: 1, | ||
MILLISECOND: 1e3, | ||
MICROSECOND: 1e6, | ||
NANOSECOND: 1e9 | ||
}; | ||
var Time = class extends DataType { | ||
constructor(unit, bitWidth) { | ||
super(); | ||
this.unit = unit; | ||
this.bitWidth = bitWidth; | ||
} | ||
get typeId() { | ||
return Type.Time; | ||
} | ||
toString() { | ||
return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Time"; | ||
} | ||
}; | ||
var Timestamp = class extends DataType { | ||
constructor(unit, timezone = null) { | ||
super(); | ||
this.unit = unit; | ||
this.timezone = timezone; | ||
} | ||
get typeId() { | ||
return Type.Timestamp; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Timestamp"; | ||
} | ||
toString() { | ||
return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ""}>`; | ||
} | ||
}; | ||
var IntervalUnit = { | ||
DAY_TIME: 0, | ||
YEAR_MONTH: 1 | ||
}; | ||
var Interval = class extends DataType { | ||
constructor(unit) { | ||
super(); | ||
this.unit = unit; | ||
} | ||
get typeId() { | ||
return Type.Interval; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Interval"; | ||
} | ||
toString() { | ||
return `Interval<${IntervalUnit[this.unit]}>`; | ||
} | ||
}; | ||
_Symbol$toStringTag3 = Symbol.toStringTag; | ||
_Symbol$toStringTag4 = Symbol.toStringTag; | ||
_Symbol$toStringTag5 = Symbol.toStringTag; | ||
_Symbol$toStringTag6 = Symbol.toStringTag; | ||
_Symbol$toStringTag7 = Symbol.toStringTag; | ||
var FixedSizeList = class extends DataType { | ||
constructor(listSize, child) { | ||
super(); | ||
_defineProperty(this, "listSize", void 0); | ||
_defineProperty(this, "children", void 0); | ||
this.listSize = listSize; | ||
@@ -628,24 +664,10 @@ this.children = [child]; | ||
} | ||
get [Symbol.toStringTag]() { | ||
get [_Symbol$toStringTag7]() { | ||
return "FixedSizeList"; | ||
} | ||
toString() { | ||
return `FixedSizeList[${this.listSize}]<${this.valueType}>`; | ||
return "FixedSizeList[".concat(this.listSize, "]<").concat(this.valueType, ">"); | ||
} | ||
}; | ||
var Struct = class extends DataType { | ||
constructor(children) { | ||
super(); | ||
this.children = children; | ||
} | ||
get typeId() { | ||
return Type.Struct; | ||
} | ||
toString() { | ||
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(", ")}}>`; | ||
} | ||
get [Symbol.toStringTag]() { | ||
return "Struct"; | ||
} | ||
}; | ||
_Symbol$toStringTag8 = Symbol.toStringTag; | ||
@@ -944,3 +966,3 @@ // src/lib/decompress-lzf.ts | ||
// src/pcd-loader.ts | ||
var VERSION = true ? "3.3.18" : "latest"; | ||
var VERSION = true ? "3.3.22" : "latest"; | ||
var PCDLoader = { | ||
@@ -947,0 +969,0 @@ name: "PCD (Point Cloud Data)", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const loader_utils_1 = require("@loaders.gl/loader-utils"); | ||
const loader_utils_1 = require("@ptloader/loader-utils"); | ||
const index_1 = require("../index"); | ||
(0, loader_utils_1.createLoaderWorker)(index_1.PCDLoader); |
{ | ||
"name": "@ptloader/pcd", | ||
"version": "3.3.18", | ||
"version": "3.3.22", | ||
"description": "Framework-independent loader for the PCD format", | ||
@@ -36,6 +36,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/loader-utils": "3.3.16", | ||
"@loaders.gl/schema": "3.3.16" | ||
"@ptloader/loader-utils": "3.3.22", | ||
"@ptloader/schema": "3.3.22" | ||
}, | ||
"gitHead": "a3f8abb7dba616960ddb11bfd7ef6cb977ba0510" | ||
"gitHead": "b73df0fb8c33d309d6a73df92a7ef60d12305d51" | ||
} |
@@ -1,2 +0,2 @@ | ||
# @loaders.gl/pcd | ||
# ptloader/pcd | ||
@@ -3,0 +3,0 @@ [loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders. |
@@ -1,2 +0,2 @@ | ||
import type {LoaderWithParser} from '@loaders.gl/loader-utils'; | ||
import type {LoaderWithParser} from '@ptloader/loader-utils'; | ||
import parsePCDSync from './lib/parse-pcd'; | ||
@@ -3,0 +3,0 @@ import {PCDLoader as PCDWorkerLoader} from './pcd-loader'; |
@@ -1,2 +0,2 @@ | ||
import {Schema, Field, Float32, Uint8, FixedSizeList} from '@loaders.gl/schema'; | ||
import {Schema, Field, Float32, Uint8, FixedSizeList} from '@ptloader/schema'; | ||
import type {PCDHeader} from './pcd-types'; | ||
@@ -3,0 +3,0 @@ |
@@ -9,4 +9,4 @@ // PCD Loader, adapted from THREE.js (MIT license) | ||
import type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema'; | ||
import {getMeshBoundingBox} from '@loaders.gl/schema'; | ||
import type {MeshAttribute, MeshAttributes} from '@ptloader/schema'; | ||
import {getMeshBoundingBox} from '@ptloader/schema'; | ||
import {decompressLZF} from './decompress-lzf'; | ||
@@ -13,0 +13,0 @@ import {getPCDSchema} from './get-pcd-schema'; |
@@ -1,2 +0,2 @@ | ||
import type {Mesh} from '@loaders.gl/schema'; | ||
import type {Mesh} from '@ptloader/schema'; | ||
@@ -3,0 +3,0 @@ type BoundingBox = [[number, number, number], [number, number, number]]; |
@@ -1,2 +0,2 @@ | ||
import type {Loader} from '@loaders.gl/loader-utils'; | ||
import type {Loader} from '@ptloader/loader-utils'; | ||
@@ -3,0 +3,0 @@ // __VERSION__ is injected by babel-plugin-version-inline |
@@ -1,4 +0,4 @@ | ||
import {createLoaderWorker} from '@loaders.gl/loader-utils'; | ||
import {createLoaderWorker} from '@ptloader/loader-utils'; | ||
import {PCDLoader} from '../index'; | ||
createLoaderWorker(PCDLoader); |
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
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
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
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
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
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
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
195642
3541
+ Added@ptloader/schema@3.3.22
+ Added@babel/runtime@7.26.0(transitive)
+ Added@probe.gl/stats@3.6.0(transitive)
+ Added@ptloader/loader-utils@3.3.22(transitive)
+ Added@ptloader/schema@3.3.22(transitive)
+ Added@ptloader/worker-utils@3.3.22(transitive)
+ Added@types/geojson@7946.0.15(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
- Removed@loaders.gl/loader-utils@3.3.16
- Removed@loaders.gl/schema@3.3.16