- This topic has 4 replies, 3 voices, and was last updated 3 years, 7 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Building SOFA › [SOLVED] Easiest way from STL to VTK
Tagged: SOFA_2006, VS2019, Windows_10
I don’t know how to create objects with VTK so I decided to try converting STL to VTK. I managed to do it with a python module called ‘meshio’ but then it complained that the topology is not tetrahedral. I have downloaded ParaView hoping that I can tetrahedrise my STL into a mesh but didn’t manage to figure this out. What’s a good way to do it?
I have tried other options of using custom STL files in SOFA but didn’t succeed yet. I have tried building SOFA with CGAL to use the commands available but had a lot of issues in CMake with file dirs, and now when I try to build my solution in VS it gives 300+ errors and fails.
Would be really happy to be done with this issue 😀
Hi @essembly,
like you say, there’s many ways to try to do this. The one I can suggest if you don’t have any type of parametric source for your STL is the following:
1) Using FreeCAD, import the STL file.
* Switch to the “Part” Workbench and go to the “Part” menu in the top.
* Select “Create shape from mesh”
* Select the newly created shape and in the same “Part” menu select “Convert to solid”
* Select this newest object in the tree and export it to a .step file.
2) Using Gmsh, import the .step-file
* In Gmsh, navigate to the Mesh menu on the left. Select 3D. It should produce a volumetric mesh. This result you can now export as a VTK
3) You might need to reduce the mesh size in step 1) if it is too complex. In 2) you might need to tinker with the meshing parameters e.g. Tools->Options->Mesh->General->Element Size Factor to arrive at the correct results.
Good luck!
Stefan
Hi @sescaida,
Omg, it actually worked! Thank you sooo much! I hope you are having a great day cause you just saved my thesis 😀
Cheers!
Great 🙂
Can you mark this topic as closed?
Cheers!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.