How to mesh this component with hexahedrons?


I’d like to mesh a component using hexahedral elements. It consists of two parts - pin and spring. It’s shown in the attached picture:

I used Explode → Solid to get separate components. Then I defined two groups - with one edge of the pin and with one edge of the spring (to control the number of elements). I’d like to obtain extruded hex mesh with 1 element in the thickness direction. However, I don’t know exactly how to do it in Salome. I defined two meshes (for each part) with the following settings:

  • 3D: Extrusion 3D
  • 1D: Wire discretisation:
    Number of segments: 15
    Quadratic Mesh

and two submeshes (for each edge):

  • 1D: Wire discretisation:
    Number of segments: 1
    Quadratic Mesh

Unfortunately, I can’t generate correct meshes this way. Maybe I should define the starting face and extrusion direction somehow? Or use a different algorithm?

I attached the .hdf and .step files below:

Meshing.hdf (1004,6 KB)
Leaf spring v3 with pin - no separate leaves_eye_gap.step (64,0 KB)

you can not mesh automatically with hexahedrons execpt if you use body fitting algorithm. have a look at this tutorial on how to cut your geometry in blocks.

best regards,

Thank you for the reply. So there’s no algorithm that could extrude unstructured quad mesh in one direction to form hex elements and it’s always necessary to cut the geometry into blocks?

I need something like this:

But not necessarily so structured for the spring part. Most importantly, it needs to have just 1 element in the thickness direction.

you have gmsh quasi structured quad but it is still a little bit buggy. have a look at my post about this subject. outside of quasi structured gmsh algo, you can also use 2d netgen and generate quad dominant mesh (it will have triangles) but last time i check that the quality of the mesh was awfull.
ps. the image you post it it is actually an structured mesh.