🐛 Fix stl relative model path

This commit is contained in:
Rune Harlyk
2025-10-20 18:27:35 +02:00
committed by Rune Harlyk
parent c449cb3390
commit 1b28b8b7fd
+2 -1
View File
@@ -6,6 +6,7 @@ import { currentVariant, jointNames, model } from '$lib/stores'
import uzip from 'uzip'
import { fileService } from '$lib/services'
import { get } from 'svelte/store'
import { resolve } from '$app/paths'
let model_xml: XMLDocument
@@ -34,7 +35,7 @@ export const cacheModelFiles = async () => {
export const loadModel = async (url: string): Promise<Result<[URDFRobot, string[]], string>> => {
const urdfLoader = new URDFLoader()
urdfLoader.workingPath = LoaderUtils.extractUrlBase(url)
urdfLoader.workingPath = resolve('/')
let xml =
url.endsWith('.xacro') ? await loadXacro(url) : await fetch(url).then(res => res.text())