- This topic has 6 replies, 3 voices, and was last updated 7 years, 9 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Meshing a Sphere
Tagged: 64_bits, Linux_ubuntu, SOFA_1608
Hi,
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,
Erik
Hi 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 ?
I 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.
Hi,
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
Do 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.
I 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
To 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
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.