Support passing local files to scene.stl()
, scene.gltf()
and scene.texture()
#3693
Replies: 2 comments
-
We can convert this discussion into a feature request to automatically serve STL files as well. Alternatively you can let the |
Beta Was this translation helpful? Give feedback.
-
Thank you! I missed the difference between the URL and the filepath requirements , I do not yet understand how app.add_static_files works and why that path counts as an URL. I managed to do it by copying the file into the shared folder, so I don't need anything else, but if you want to turn this into a discussion go ahead. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Description
Description:
I've encountered an issue where loading an STL file works as expected when using
app.add_static_files
, but fails when trying to load the file after selecting it with the local file picker from the nicegui example. I need to be able to load the STL file dynamically after the user selects it (because I don't necessarily know its location), but the second approach does not work.Code Examples:
app.add_static_files
to include the folder into the app, and the STL file is loaded into the scene without issues.scene.stl(local_path)
.The key difference between the two examples is how the file path is handled. In the first case, I'm using
app.add_static_files
, but in the second case, I rely on the user's selection and dynamically provide the path toscene.stl()
. I need a solution that allows for dynamic loading of the STL file after user selection. Any guidance or workaround would be appreciated.Environment:
Beta Was this translation helpful? Give feedback.
All reactions