Solved Loading STL files
-
Hi,
I am new to Qt. I need to load my IoT product STL file into Qt. Before loading my own STL file, I wanted to check the flow by picking up STL files that are part of Qt source tree: (./qt3d/tests/auto/render/geometryloaders/cube.stl and ./qtquick3d/src/3rdparty/assimp/src/test/models/STL/sphereWithHole.stl). To load these, I picked up view3d example and replaced teapot.mesh with cube.stl (Updated qml.qrc accordingly). I am getting error: "QSSG.warning: Failed to load mesh: :/cube.stl".Then I tried with some of the mesh files that are part of Qt source tree (./Src/qtquick3d/tests/auto/quick3d_lancelot/data/lighting/models/testCube/meshes/Cube.mesh and ./Src/qtquick3d/src/3rdparty/assimp/src/test/models-nonbsd/Ogre/OgreSDK/fish.mesh). With Cube.mesh, it worked file but it gave error for fish.mesh.
QSSG.warning: Failed to load mesh: :/fish.meshPlease help me if I have to run specific conversions on these files (STL, fish.mesh) to get loaded by QtQuick3D.
Thanks,
Venkat. -
In order to use STL files they have to be converted using the balsam tool included in Qt Quick 3D. They might have to be converted to a supported file format in something like Blender for them to work in balsam.
https://doc.qt.io/qt-5/qtquick3d-tool-balsam.html
Oh and I think fish.mesh breaking is a glitch, I can't see any good reason for that to fail...
-
Hi,
Thanks for the response. I thought we could load STL files directly. Also, as per balsam documentation, it doesn't support STL. So I used assimp for converting from STL to OBJ and then used balsam to convert to mesh. Now I could load the resulting mesh file.Rgds,
Venkat.