Skip to content

Conversation

Jacky56
Copy link

@Jacky56 Jacky56 commented Apr 26, 2025

Currently, if you provide a URL with a extra parameters, sceneFormatFromPath would fail to gather what extension it could be.

for example, you could have a signed url such as:

https://storage.googleapis.com/a_bucket/blob.splat?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Signature=1ba94...d14221

and the method sceneFormatFromPath would produce null as a result, because the path was not curated correctly for URLs, collecting the pathname from the url would have a better chance of gathering the possible extension type.

truncate options/params from url if its a url to determine filename based on url
@VladimirKobranov
Copy link

workaround:

this.finalUrl = this.splatUrl + `&f=.${this.type}`; 

But, actually file loader must be some of these:

const filename = "example_model.ksplat";

// --- Method 1: Using .includes() ---
const isIncludesMatch =
  filename.includes(".splat") ||
  filename.includes(".ply") ||
  filename.includes(".ksplat");

console.log("Includes Match:", isIncludesMatch); // true or false

// --- Method 2: Using RegExp with .test() ---
const extensionRegex = /\.(splat|ply|ksplat)$/;
const isRegexMatch = extensionRegex.test(filename);

console.log("Regex Match:", isRegexMatch); // true or false

// --- Optional: Case-insensitive version ---
const caseInsensitiveRegex = /\.(splat|ply|ksplat)$/i;
const isCaseInsensitiveMatch = caseInsensitiveRegex.test(filename);

console.log("Case-insensitive Regex Match:", isCaseInsensitiveMatch); // true or false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants