• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / loaders.gl / 25070233425

28 Apr 2026 06:20PM UTC coverage: 59.434% (+0.01%) from 59.423%
25070233425

push

github

web-flow
website: Add tabs for navigating between format docs (#3407)

11310 of 20887 branches covered (54.15%)

Branch coverage included in aggregate %.

89 of 136 new or added lines in 13 files covered. (65.44%)

1742 existing lines in 132 files now uncovered.

23500 of 37682 relevant lines covered (62.36%)

16296.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/modules/pcd/src/pcd-loader-with-parser.ts
1
// loaders.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
import type {Loader, LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
6
import type {MeshArrowTable} from '@loaders.gl/schema';
7
import {convertMeshToTable} from '@loaders.gl/schema-utils';
8
import type {PCDMesh} from './lib/pcd-types';
9
import {parsePCD} from './lib/parse-pcd';
10
import {PCDWorkerLoader as PCDWorkerLoaderMetadata} from './pcd-loader';
11
import {PCDLoader as PCDLoaderMetadata} from './pcd-loader';
12

13
const {preload: _PCDWorkerLoaderPreload, ...PCDWorkerLoaderMetadataWithoutPreload} =
14
  PCDWorkerLoaderMetadata;
4✔
15
const {preload: _PCDLoaderPreload, ...PCDLoaderMetadataWithoutPreload} = PCDLoaderMetadata;
4✔
16

17
export type PCDLoaderOptions = LoaderOptions & {
18
  pcd?: {
19
    /** Output shape. Defaults to a legacy PointCloud object. */
20
    shape?: 'mesh' | 'arrow-table';
21
    /** Override the URL to the worker bundle (by default loads from unpkg.com) */
22
    workerUrl?: string;
23
  };
24
};
25

26
function convertPCDMesh(mesh: PCDMesh, options?: PCDLoaderOptions): PCDMesh | MeshArrowTable {
27
  return options?.pcd?.shape === 'arrow-table' ? convertMeshToTable(mesh, 'arrow-table') : mesh;
12✔
28
}
29

30
/**
31
 * Worker loader for PCD - Point Cloud Data
32
 */
33
export const PCDWorkerLoaderWithParser = {
4✔
34
  ...PCDWorkerLoaderMetadataWithoutPreload
35
} as const satisfies Loader<PCDMesh | MeshArrowTable, never, PCDLoaderOptions>;
36

37
/**
38
 * Loader for PCD - Point Cloud Data
39
 */
40
export const PCDLoaderWithParser = {
4✔
41
  ...PCDLoaderMetadataWithoutPreload,
42
  parse: async (arrayBuffer, options) => convertPCDMesh(parsePCD(arrayBuffer), options),
12✔
NEW
43
  parseSync: (arrayBuffer, options) => convertPCDMesh(parsePCD(arrayBuffer), options)
×
44
} as const satisfies LoaderWithParser<PCDMesh | MeshArrowTable, never, PCDLoaderOptions>;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc