Home › Forum › SOFA › Using SOFA › [SOLVED] Meshing a Sphere
Tagged: 64_bits, Linux_ubuntu, SOFA_1608
- This topic has 6 replies, 3 voices, and was last updated 8 years, 9 months ago by
epernod.
-
AuthorPosts
-
2 February 2017 at 12:13 #8493
epernod
BlockedHi,
I would like to be able to create a sphere and add a volumetric topology inside it in order to add FEM etc…
I have in mind something similar to what already exist for cube or cylinder, using GridTopology.
Does anyone already did something similar? Or maybe there is an easier approach for spheres.
Thanks,
Erik2 February 2017 at 12:21 #8494lionel
BlockedHi Erik,
What do you mean by “add a volumetric topology inside” ?
Would you like to mesh you sphere with tetrahedra / hexahedra ?
I feel that you want hexadral elements.
How should these elements be ?
– inside the sphere ?
– encompassing the sphere ?
– compatible with the boundary of your sphere ?2 February 2017 at 12:36 #8495jjcasmar
BlockedI would use the CGAL plugin which has two nice components to compute a tetrahedron mesh from a surface mesh or from an image. I have been using this approach to generate tetrahedron meshes of random meshes and it works pretty well.
3 February 2017 at 09:56 #8504epernod
BlockedHi,
Thanks for your quick answers. I have thought about cgal but I would like something easier/lighter.
The idea would be to say: I would like a sphere of radius R with L slice horizontal and l slice vertical and this would create a sphere grid.
So yes meshed with hexa inside only for example.Erik
3 February 2017 at 10:08 #8505lionel
BlockedDo you have a surface mesh of your sphere ?
Have you tried to use the SparseGrid to fill this surface mesh ?<MeshVTKLoader filename="your_surface.vtk" name="loader"/> <SparseGrid fillWeighted="0" plotNormals="0" name="sparseGrid" vertices="@loader.position" n="5 5 100" triangles="@loader.triangles"/>To my knowledge, I do not believe that there is a component that can construct a grid using only radius and nb slices information.
But it is not difficult to hack the SparseGrid component in this way.3 February 2017 at 12:03 #8507epernod
BlockedI saw there is a sphereQuadTopology but couldn’t find an example.
I will see if it can do the job for the surface then I will see how the sparceGrid fill the mesh.Thanks
13 February 2017 at 10:57 #8567epernod
BlockedTo close this topic. I have tested with a sparse grid it works fine for simulating FEM. But for a simplier/complete approach to have a sphere object, I have added a new grid component, similar to the cylinderGridTopology.
PR here: https://github.com/sofa-framework/sofa/pull/164
thanks you both for your clues.
Erik
-
AuthorPosts
- You must be logged in to reply to this topic.
