Hi,
is it possible to create a region from a CAD file?
The "region" command has "mesh/tet" style, this one would be very useful if I could generate a ASCII VTK file as the manual says, but I really don't know how to do it from a CAD or stl file. Does anybody know how to do it?
Regards!
cstoltz | Wed, 04/17/2013 - 12:53
See separate note for a
See separate note for a little stl-to-vtk conversion tool. From the command line, it is just './convert file.stl', where 'file.stl' can be whatever you want. It should produce a vtk file called 'file.vtk'. Limit of 1e6 facets/vertices in the STL file.
Best regards,
Chris
DanielDroop | Wed, 04/17/2013 - 15:45
I use gmsh for that.
Hi g.garate,
my workflow is to export the geometry in a step-file from my CAD system and import it in gmsh (see http://geuz.org/gmsh/). There you can create a volume based on the surface from the step-file, have the 1D than 2D than 3D mesh done and export the result in a vtk file.
Best Regards,
Daniel
g.garate | Wed, 04/17/2013 - 23:19
Thank Daniel and Chris for
Thank Daniel and Chris for your answer, but I still have some questions:
- Chris:
Where can I find the separate note for a stl-to-vtk conversion tool that you mentioned?
- Daniel:
I downloaded gmsh. I used it to open a igs file, then I selected mesh, 1D, 2D, 3D and finally: file-save as-filename.vtk
The problem is when liggghts runs a error message appears:
Note: Skipping empty line in VTK mesh file
Note: Skipping empty line in VTK mesh file
Note: Skipping empty line in VTK mesh file
ERROR: VTK mesh file is incompatible with simulation box: One or more vertices outside simulation box (input_mesh_tet.cpp:258)
do you know what it is wrong?
Thanks in advance.
DanielDroop | Thu, 04/18/2013 - 11:55
ERROR: One or more vertices outside simulation box
Hi g.garate
check your scale factor. The error sounds like the unit of the igs-file is mm and liggghts is working in m?
Good luck,
Daniel
cstoltz | Thu, 04/18/2013 - 03:49
To find the separate note,
To find the separate note, look in the user forum for a post titled Region using CAD file - solution.
From the error you describe, your piece of geometry is too large to fit inside the simulation box. LIGGGHTS requires all geometry to fit inside the simulation box during the course of the simulation.
Regards,
Chris
tdl | Thu, 04/18/2013 - 14:55
Dear Chris,
Dear Chris,
thank you for your file.
I have downloaded it and tried to use your executable on
my stl file (node/1606)
to get a vtk file.
It works well (I can see the mesh in paraview).
However Liggghts refuses to load it as a mesh, with the error:
ERROR: Expecting ASCII VTK mesh file, cannot continue (input_mesh_tri.cpp:171)
Any thoughts?
Thanks,
Alessandro
g.garate | Thu, 04/18/2013 - 15:42
Thanks Chris, I've used your
Thanks Chris, I've used your stl-to-vtk conversion tool but I have the same ERROR that Alessandro.
cstoltz | Thu, 04/18/2013 - 21:28
The error above is a result
The error above is a result of a difference in formatting between the VTK files generated from the stl-to-vtk tool and what LIGGGHTS is expecting, which can be fixed.
However, on looking at this a little further, I don't think that the stl-to-vtk tool isn't going to work for this situation. The mesh/tet region command requires tetrahedra mesh in the vtk file. Since an STL image is only a surface mesh, the resulting VTK from this conversion will also be triangles only and won't load properly.
Sorry - I had only used the stl-to-vtk tool as part of some other tools I wrote for visualization and had never looked into whether the VTK's it generated could be imported for a region.
Regards,
Chris
tdl | Fri, 04/19/2013 - 15:00
Dear Chris,
Dear Chris,
thanks for your effort nonetheless.
The first problem is the fact that LIGGGHTS only reads "LEGACY VTK UNSTRUCTURED GRID" files and not
"POLYDATA" (which is the standard vtk output e.g. from lpp/pizza).
The second problem is that there is no simple tool to convert from one another.
Thank you,
Alessandro