Home › Forum › SOFA › Using SOFA › [SOLVED] Volumetric Mesh Generation of Woven T-yarn
Tagged: volumetric mesh
- This topic has 31 replies, 4 voices, and was last updated 5 years, 2 months ago by MA.
-
AuthorPosts
-
31 May 2019 at 18:51 #13560MABlocked
Hello,
I am trying to create a volumetric mesh for a single woven T-yarn, I am using this example https://project.inria.fr/softrobot/documentation/volumetric-mesh-generation-using-cgal-plugin/
The link of Woven T-yarn is available here: https://drive.google.com/open?id=1QtvQ46axkVYtxHKpWnZPfaPTyIhAP7NT
I am trying to tune the following parameters:
facetSize, facetApproximation, cellRatio, cellSize
I dont know what I am missing, I used GMSH to create volume mesh and I have also check non-mainfoldness.
The result I got:
[WARNING] [MeshGenerationFromPolyhedron(gen)] 71 points are not connected to the mesh.
[INFO] [VTKExporter(VTKExporter)] VTKExporter: found topology Mesh
[INFO] [VTKExporter(VTKExporter)] ### VTKExporter[VTKExporter] ###
Nb points: 34
Nb edges: 0
Nb triangles: 0
Nb quads: 0
Nb tetras: 30
Nb hexas: 0
### ###
Total nb cells: 30Thanks,
7 June 2019 at 13:53 #13593HugoKeymasterHi @ma1991
At my best knowledge, some parameters (facetSize and cellSize) depend on the dimension. They therefore need to be set accordingly.
If you do not succeed, you can share your mesh so that we can assist you.
Hugo
8 June 2019 at 19:44 #13610MABlockedThanks Hugo, exactly, I have to tune some parameters likely the facetSize, however, the scene is crashing and I got this error:
The error: CGAL::Polyhedron_incremental_builder_3:: lookup_halfedge(): input error: facet 10500 shares a halfedge from vertex 255 to vertex 256 with facet 324.
I am doing that as you can see in the screenshot: there is no volumetric mesh created while I am tuning parameters before scene is giving error:http://www.filedropper.com/scene
The STL file is here:http://www.filedropper.com/1tyarn_1
Thanks,
9 June 2019 at 23:02 #13615MABlockedI have a mesh in STL format and I am using GMSH for adding physical volume and creating 3D mesh, however, in SOFA while trying to tune the parameters, it fails to create a volumetric mesh.
9 June 2019 at 23:49 #13616MABlockedHere is another example of knitted single S yarn ( fabric), I got the following error in
SOFACGAL::Polyhedron_incremental_builder_3<HDS>::
lookup_halfedge(): input error: facet 200 shares a halfedge from vertex 54 to vertex 126 with facet 199.11 June 2019 at 19:00 #13627HugoKeymasterIs your problem the same than the issue reported in the other topic: Volumetric Mesh Generation Error ?
Is it related to the SoftRobot plugin? or the CGAL one ?
Best
Hugo
11 June 2019 at 22:10 #13633Damien MarchalBlockedHi MA,
About mesh generation, CGAL is rather hard to use.
If you prefer it is possible to rely on GMESH for meshing.
Stefan Escaida and I made helping function for that STLIB/SoftRobots plugins.It is undocumented feature in:
https://github.com/SofaDefrost/STLIB/tree/master/python/splib/geometricBut there is “createScene” function that will behave as an example if the .py files are loaded in Sofa.
If you need more help please tell.
12 June 2019 at 15:31 #13638MABlocked@Hugo, it is indeed related to this issue, I can close the other question. This is an issue is related to CGAL and SoftRobots as well since the example is created for obtaining the volumetric mesh of soft pneumatic gripper as illustrated in this example:
@Damien, Thanks so much for your help, the current plugin is CGAL that I am using in sofa, actually, I am following this example, https://project.inria.fr/softrobot/documentation/volumetric-mesh-generation-using-cgal-plugin/
The idea is I have used GMSH earlier to have a volume mesh and later importing it in sofa example, I have this following for instance:
CGAL::Polyhedron_incremental_builder_3<HDS>::
lookup_halfedge(): input error: facet 264 shares a halfedge from vertex 0 to vertex 1 with facet 0.I don’t know whether this error implies an error at the mesh itself, anyway, I am sharing the steps I did before using SOFA volumetric mesh generation example:
1- I have an STL model on single woven T-yarn (Fabric), the file is attached: https://gofile.io/?c=KKaqnp
2- I used GMSH for adding a physical volume and created a 3d mesh, afterward, I refined the mesh by splitting, the mesh is attached: https://gofile.io/?c=OU59Nj
@Damien is STLIB an external plugin or a plugin in sofa/src/applications/plugins, I would be grateful for hints on how I can install STILB. At the moment, I add an entry in cmkae-gui for STLIB in src/applications/plugins, however, it seems not to be read while configuration.
Thanks for the help!
19 June 2019 at 18:18 #13784HugoKeymasterHi @ma1991,
I poke again @damien-marchaluniv-lille1-fr since I am not sure he saw your reply on STLIB and SoftRobot.
Best,
Hugo
19 June 2019 at 19:01 #13788sescaidaBlockedHello everyone,
as Damien mentioned, we are working on a functionality to simplify the meshing procedure by scripting Gmsh with python from within Sofa (STLIB). In a few days we will have something (updated) available to the public.
I saw the geometries for the T-Yarn and I’m not sure it will be possible to mesh it. If I understand correctly you have two flat stripes overlapping, forming a T-shape. However, your surface mesh has no volume. Hence, it is impossible to generate a volumetric mesh with CGAL or Gmsh. Can you correct this? Your S-Yarn on the other hand looks like it would work. Can you upload the STL somewhere and I will make a test.
Best
Stefan
20 June 2019 at 09:45 #13794Damien MarchalBlockedHi all,
I tend to be rather busy so forgot to reply immediately so thank for the poke,
About STLIB, Thank for the poke, STLIB is an external plugin available at
https://github.com/SofaDefrost/STLIBIt should be installed in the same way as you did for SoftRobots.
To ease installation of plugins with dependencies recommand the use of sofa-spm which will track the dependencies for you.
Documentation is here:
https://github.com/SofaDefrost/SPM20 June 2019 at 14:43 #13832MABlockedHi Stefan,
Thanks so much for your help! I do agree that the T-yarn surface mesh doesn’t has a volume, however, while using the knitted S-yarn, the same problem appears.
I am forwarding the STL files, I would be grateful for a solution as I am using gmsh for adding a physical volume, but still, I cannot add to the Tyarn
T-yarn STL file: https://gofile.io/?c=VwVFG8
The knitted S yarn: https://gofile.io/?c=eWnAaO20 June 2019 at 14:53 #13833MABlockedHi Damien,
Thanks so much! I think I am missing how to create the CmakeLists.txt in the plugin folder, could you please inform me the how to write the exact file, as I want to add the plugin folder not only STLIB folder.
I should write Cmakelists.txt that add plugins, but I don’t know how to write those line exactly.
sofa_add_plugins
21 June 2019 at 10:13 #13838Damien MarchalBlockedHi,
If you use sofa-spm it will generate the CMakeLists.txt for you š
Here is a cut & past from one of my CMakeLists.txt:
sofa_add_plugin(SofaPython3 SofaPython3) sofa_add_plugin(STLIB STLIB) sofa_add_plugin(SoftRobots SoftRobots) sofa_add_plugin(SoftRobots.Inverse SoftRobots.Inverse) sofa_add_plugin(SofaQtQuick SofaQtQuick)
Then I add the directory that contains this CMakeLists.txt in the EXTERNAL_DIRECTORIES at the configuration to compile Sofa.
24 June 2019 at 17:16 #13851sescaidaBlockedHi,
so, last week I had a look at the issue. I was able to mesh the S-yarn with CGAL, i.e. with the VolumetricMeshGeneration example:
However, I had to follow two steps:
1) Repair the original file, because the mesh had holes in it. Here is the repaired version:
https://www.dropbox.com/s/g8ocpvx21qot1ib/single_S_yarn3.stl?dl=0 (stl)
https://www.dropbox.com/s/g9n7350ogbl8fb9/S-yarn-volumetric.vtu?dl=0 (vtk)
2) Change the parameters, because the units of the file seem to be in cm:
cellSize="0.1", facetSize="0.1",
I also tried to mesh it with Gmsh and had moderate success. It didn’t work by loading the (repaired) stl-file into Gmsh. Therefore, the binding we made in Sofa does not work either. Apparently it is not straightforward to mesh stl files with Gmsh. I had to follow the tutorial/example number 13 on their website:
http://gmsh.info/doc/texinfo/gmsh.html
To achieve good results with Gmsh you will need to look into some parameters, I think.
I know all this is fiddly, but it also was hard to pinpoint the problem, because the original geometries were partially broken (no volume or holes). To be sure the problem is not on the geometry itself, I recommend trying the meshers with geometry that is known to work. If it doesn’t work on your files, it is possible that the geometry you are trying to mesh is actually broken.
Best
Stefan
3 July 2019 at 13:44 #13897MABlocked@Stefan, thanks so much indeed your help! You are right, I think there is a problem in the mesh, however, I would like to know how you repaired as I have to do that for the woven T-yarn, I am lacking skills in meshing, so any hints would be appreciated.
I am still much afraid as after asking we figured that SOFA is not dedicated to fabric simulation especially when it comes to knitted or woven yarn, maybe I am mistaken, but so far the only example is the piece of fabric, but still not the yarn level simulation and later on we also have to map smart material.
Thanks for your help!
3 July 2019 at 13:59 #13898Damien MarchalBlockedHi MA,
Clearly SOFA is not dedicated to fabric simulation, it is a general purpose modeling and simulation framework for deformable object.
The problem with modelling is that you need to know what is the dynamic behavior you want to simulate to select the most appropriate mechanial model. If the dynamic behavior can be approximated well enough with kind of 2D mass-spring system or 2D shell assemblies you have existing components for that. If you need something else you may need to implement it. A lot of people are doing that but sadely they don’t put the results in open-source…so to bad for us. Now, as long as you have the equations there is no problem in implementing a specific fabric/yarn oriented model in SOFA allowing it to interact with the other simulated object. If you need help on that I think there is some people that can guide you.
Regards,
4 July 2019 at 11:07 #13903sescaidaBlocked@MA, you’re welcome! Although, I admit, it was a little bit of annoying work ^^
For repairing the mesh of the S-Yarn I used Blender. I could clearly see that there was a hole on one of the ends. I selected the corresponding vertices and created new faces. I think Meshlab is also quite powerful with automated functionality to improve mesh quality, etc. Just search online for something like “repair mesh with Blender/Meshlab” and you will have a few cues.
Looking at the fact that your meshes are quite simple, it occurred to me that it might be a good idea to just create them yourself, for instance using Blender or FreeCAD. My workflow would be to create a very basic geometry, like a cube, export it and then create a volumetric mesh. You will see if it works for this basic example. (In fact, to debug your problem with the volumetric meshing I created a simple cube in Blender, for which it worked.) Then, you take it from there to the more advanced shape. If you put some time into it, it should not be a problem for you to create the S-Yarn or the Woven Yarn yourself.
Just as a tip: if you create the mesh in FreeCAD and export it to brep-format, which is a parametric format, you will be able to mesh it perfectly with Gmsh. If you export it to a stl-file it will be easier to use the VolumetricMeshGeneration example.
Best
Stefan
8 July 2019 at 17:08 #13918MABlockedThanks so much, Stefan, Indeed it was helpful and thank you once again for your help indeed appreciated! I am trying to do as you advised, I will share updates.
Thanks,
8 July 2019 at 19:44 #13919MABlockedHi Stefan, I tried using meshlab and it is indeed powerful, however, there is an error in the mesh I cannot solve:
CGAL::Polyhedron_incremental_builder_3<HDS>::
add_vertex_to_facet(): input error: disconnected facet complexes at vertex 4:
involved facets are: 360 359 358 2 3 4 (closed cycle) and.I am trying to figure out how to merge facet, I will try.
The file: https://gofile.io/?c=EC1ZXt
11 July 2019 at 21:08 #13933HugoKeymasterHi @ma1991
I come back to your issue.
Apparently you want to mesh this yarn surface (stl) mesh, right ?
Since it is very thin, all meshers will struggle in the meshing process.What do you want exactly to model from this mesh again ?
Where do you want to be accurate in simulation ?Hugo
13 July 2019 at 00:10 #13946MABlockedHi @ Hugo
Thanks so much for your reply! I have to disclaimer that I am not expert at meshing, however, I am struggling in figuring out how to solve the error as @stefan highlighted I used meshlab and it is quite helpful, however, I still getting an error.
What do you want exactly to model from this mesh again?
I am expecting to add forces to the yarn and see how it deform for different material properties, later I can design different knitted or woven yarn and test them mechanically through simulation.
Where do you want to be accurate in a simulation?
This is a good question and I am afraid I don’t have an exact answer since the fabric is viscoelastic material and highly nonlinear, I found other researchers simulate textile using material point method, however, I am interested to do through SOFA.
Thanks,
29 July 2019 at 15:31 #14021MABlockedHi Hugo,
Are there updates concerning the mesh, I still cannot solve the error?
Best,
29 July 2019 at 16:22 #14028HugoKeymasterHi @ma1991
It seems many questions are still open. You should maybe work on this first, before going into the simulation.
It is difficult to model cloth from the yarn scale. Both on the meshing and simulation standpoint.
What is your final objective in term of modeling?Note that pseudo of Stefan is @sescaida
BestHugo
29 July 2019 at 16:44 #14030MABlockedHi @Hugo,
The ultimate goal in modeling is generating internal forces that can actuate the yarn, firstly, I am expecting to import this mesh in SOFA and apply external forces to measure the strain, stress, friction among stitches and sliding as well.
This would help me in testing different geometrical shapes for making sure that there is force cancellation among stitches that could help in actuating the yarn by using pneumatic actuators.
The bottom line is: testing the mechanical properties of different geometrical shapes woven/knitted yarns that could be best to be actuated and also be used for the haptic interface.
Best,
-
AuthorPosts
- You must be logged in to reply to this topic.