Need Help Creating an Elastic Stomach Model using BREP File and Gmsh in generating 3D mesh #4241
-
I am attempting to create an elastic stomach model for simulation using the SOFA framework. I have obtained an obj. file of the stomach, which I have successfully imported into SOFA to create a rigid stomach. However, my goal is to make the stomach model elastic. To achieve this, I have been using FreeCAD to transform the obj. file into a BREP (Boundary Representation) file. My next step is to generate a 3D mesh using Gmsh from this BREP file, but I have encountered difficulties. When I attempt to use Gmsh, I can only generate a triangular mesh for the 2D surface, rather than a volume mesh. Interestingly, when I create a simple cube in FreeCAD and export it as a BREP file, Gmsh is able to detect the volume and generate a tetrahedron mesh for the cube. However, this does not seem to work with the BREP file from the stomach model. Is there a specific reason why Gmsh is unable to detect the volume for the BREP file from the stomach model? And how can I successfully generate an elastic tissue representation for the stomach model using the BREP file and Gmsh? Any insights, suggestions, or alternative approaches would be greatly appreciated. Thank you in advance for your help! Attached a BREP file, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi ! I am sorry but we cannot offer you support on Gmsh, this may get more response on their forum. <Node name="RegularGrid">
<SparseGrid name="HexaTop" cellWidth="20.0" fileTopology="yourSurfaceMesh.obj" />
<TetrahedronSetTopologyContainer name="TetraContainer" />
<TetrahedronSetTopologyModifier name="Modifier7" />
<Hexa2TetraTopologicalMapping input="@HexaTop" output="@TetraContainer" swapping="false" />
</Node> And also, you can use the CGal plugin available in Sofa to mesh your volume into tetrahedra. Again, here is a little example of this : <Node name="root" dt="0.025" gravity="0 0 0" >
<RequiredPlugin pluginName="CGALPlugin"/>
<MeshObjLoader name="hull" filename="yourSurfaceMesh.obj" />
<MeshTopology src="@hull"/>
<MeshGenerationFromPolyhedron name="generator"
inputPoints="@hull.position" inputTriangles="@hull.triangles" inputQuads="@hull.quads"
cellSize="0.65" facetAngle="10"
facetSize="0.3" cellRatio="2"
facetApproximation="1" ordering="1"
perturb="false" odt="false" lloyd="true" lloyd_max_it="5"/>
<Node name="Generated" >
<TetrahedronSetTopologyContainer name="Container" points="@../generator.outputPoints" tetras="@../generator.outputTetras"/>
<MechanicalObject name="mstate" />
<MeshExporter name='exporterA' format='vtk' printLog='true' filename='yourVolumicMesh' exportAtEnd='true' />
</Node>
</Node> |
Beta Was this translation helpful? Give feedback.
Hi !
I am sorry but we cannot offer you support on Gmsh, this may get more response on their forum.
But for you to know, you could already use your surface mesh in sofa. Using
SparseGrid
object, you can mesh automatically the volume represented by your obj into hexahedron. You could then transform it to tetrahedrons by using aHexa2TetraTopologicalMapping
. Here is a small example doing so. But at the end you'll have a plain organ, non hollow.