Is there an easy way to extrude a planar 2D-mesh to a volume slice?

ring = RegionDifference[Disk[{0, 0}, 1], Disk[{0, 0}, 1/2]];

enter image description here

The thickness of the slice is assumed to be small and should have only some element layers.


  • $\begingroup$ does DiscretizeRegion@RegionProduct[Annulus[], Line[{{0},{1/10}}]] give what you need? $\endgroup$ – kglr Aug 23 '19 at 18:03
  • $\begingroup$ @kglr Thanks, probably yes, but %["Wireframe"] didn't show the mesh. $\endgroup$ – Ulrich Neumann Aug 23 '19 at 18:14
  • $\begingroup$ @kglr Sorry, just one remark. The planar mesh contains ~209 points, the volumemesh ~16814 . That means the mesh has changed significantly, the restriction "keep the planar meshing in some (3-4) layers" is lost. $\endgroup$ – Ulrich Neumann Aug 23 '19 at 18:25

If you want some control over the extruded mesh, under Applications in RegionProduct, there is a nice example.

ring = RegionDifference[Disk[{0, 0}, 1], Disk[{0, 0}, 1/2]];
dr = DiscretizeRegion[ring];
pointsToMesh[data_] :=
   Line@Table[{i, i + 1}, {i, Length[data] - 1}]];
data = Table[Exp[x], {x, 0., 0.5, 0.1}];
r1 = pointsToMesh[data];
rp = RegionProduct[dr, r1];
MeshRegion[rp, PlotTheme -> "Lines"]


You can use Subdivide in place of data if you just want a uniform mesh like so

rUniform = pointsToMesh[Subdivide[0, 0.1, 5]]
rpUniform = RegionProduct[dr, rUniform];
MeshRegion[rpUniform, PlotTheme -> "Lines"]
  • $\begingroup$ Thanks, yes i want some control. Why Exp[x] is needed for data? $\endgroup$ – Ulrich Neumann Aug 23 '19 at 18:33
  • $\begingroup$ It really is just an example of non-uniform grid control. For example, in a Computational Fluid Dynamics problem, you may want to have a boundary layer mesh at the wall that grows exponentially into the fluid domain. $\endgroup$ – Tim Laska Aug 23 '19 at 19:49
  • $\begingroup$ @UlrichNeumann I added a simple uniform mesh extrusion using Subdivide to the answer to complement the non-uniform mesh. $\endgroup$ – Tim Laska Aug 23 '19 at 23:08
  • $\begingroup$ That'it, thank you very much. $\endgroup$ – Ulrich Neumann Aug 24 '19 at 6:06
  • $\begingroup$ You are welcome! $\endgroup$ – Tim Laska Aug 24 '19 at 11:22

I am developing MeshTools package, which contains a convenient function ExtrudeMesh just for this purpose.

First we create a quadrilateral mesh on annulus region. It can be structured or unstructured.


mesh2D = AnnulusMesh[{0, 0}, {1/2, 1}, {64, 4}]


Then we extrude 2D mesh to 3D with ExtrudeMesh. Position and orientation of resulting mesh can be further adjusted with TransformMesh.

mesh = ExtrudeMesh[mesh2D, 1, 4]
mesh["Wireframe"["MeshElementStyle" -> FaceForm@LightBlue]]


Structured (!) hexahedral meshes can be also transformed to tetrahedral meshes with HexToTetrahedronMesh.

HexToTetrahedronMesh[mesh]["Wireframe"["MeshElementStyle" ->FaceForm@LightBlue]]


  • $\begingroup$ Thank you very much. That's what I needed to solve Poisson PDE in a predefined simple mesh. $\endgroup$ – Ulrich Neumann Aug 26 '19 at 8:12
  • $\begingroup$ ...Unfortuantely it only works in v12 (my version is 11.0.1 ) $\endgroup$ – Ulrich Neumann Aug 26 '19 at 8:56
  • $\begingroup$ Hm, I have tested it with 11.1 and it works. What does it complain about (I don't have 11.0 installed)? If you can fix this yourself I am happy to accept your pull request on GitHub. In general I think I could make the package compatible with 11.0, but I would not like to go back even further. $\endgroup$ – Pinti Aug 26 '19 at 9:11
  • 1
    $\begingroup$ Now it works! Thank you for the very useful tool! $\endgroup$ – Ulrich Neumann Sep 9 '19 at 12:54
  • 1
    $\begingroup$ Again thanks for your great tool. When I take a predefined mesh, created with MeshTools, inside NDSolve I observed, that the mesh of the solution doesn't change. Is this a property of MeshTool meshes? $\endgroup$ – Ulrich Neumann Sep 26 '19 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.