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

Function getColmapDirectoryScore

src/utils/colmapPathResolver.ts:80–91  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

78 * and falls back to a depth/length heuristic for anything else.
79 */
80export function getColmapDirectoryScore(dir: string): number {
81 const lower = dir.toLowerCase();
82
83 if (/(^|\/)sparse\/\d+$/.test(lower)) return 0; // sparse/0, sparse/1, a/b/sparse/0
84 if (/(^|\/)sparse$/.test(lower)) return 1;
85 if (/(^|\/)colmap\/\d+$/.test(lower)) return 1; // colmap/0
86 if (/(^|\/)colmap$/.test(lower)) return 2;
87 if (lower.includes('/sparse/') || lower.startsWith('sparse/')) return 3;
88 if (lower.includes('/colmap/') || lower.startsWith('colmap/')) return 4;
89
90 return 5 + dir.length;
91}
92
93export interface ResolveColmapPathsOptions {
94 /** When true (default) a model must include a points3D file to be selected. */

Callers 2

resolveColmapPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected