MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / loadSplatUrlSource

Function loadSplatUrlSource

src/hooks/urlLoaderSplatSource.ts:70–99  ·  view source on GitHub ↗
(
  url: string,
  deps: LoadSplatUrlSourceDeps
)

Source from the content-addressed store, hash-verified

68}
69
70export async function loadSplatUrlSource(
71 url: string,
72 deps: LoadSplatUrlSourceDeps
73): Promise<boolean> {
74 const log = deps.log ?? appLogger.info;
75 const fetchSplatFile = deps.fetchSplatFile ?? fetchSplatUrlFile;
76
77 log(`[URL Loader] Loading splat or point cloud from URL: ${url}`);
78 deps.setUrlProgress({ percent: 5, message: 'Downloading 3D file...' });
79
80 const splatFile = await fetchSplatFile(url);
81 deps.onSplatFileFetched?.(splatFile);
82 const files = new Map([[splatFile.name, splatFile]]);
83
84 deps.setUrlProgress({
85 percent: 80,
86 message: 'Parsing 3D scene...',
87 currentFile: splatFile.name,
88 });
89 deps.setSourceInfo('url', url, null, null);
90
91 await deps.processFiles(files, { start: 80, end: 100 }, {
92 replaceSplatScene: true,
93 throwOnError: true,
94 });
95
96 log(`[URL Loader] Successfully loaded 3D file from URL: ${splatFile.name}`);
97
98 return true;
99}

Callers 2

useUrlLoaderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected