I would like to pick a part of a boundary mesh, for example


Is it possible to select the part(side) x==1 of the cuboid and define a new 2D-mesh of this side?



2 Answers 2


MeshTools package can help you with SelectElements function and some manual postprocessing.


bm = ToBoundaryMesh[Cuboid[]]

side = SelectElements[bm, #1 == 1 &]

This "projects" 3D mesh with "BoundaryElements" to 2D mesh with "MeshElements". Reverse on element incidents is necessary to avoid warning messages about bad their quality (inverted elements).

mesh2D = ToElementMesh[
  "Coordinates" -> side["Coordinates"][[All, {2, 3}]],
  "MeshElements" -> MapAt[Reverse, side["BoundaryElements"], {All, 1, All}]

mesh2D["Wireframe"["MeshElementStyle" -> FaceForm@LightBlue]]


  • $\begingroup$ Thanks for this helpful tool, I'll try to select the side mesh. $\endgroup$ Oct 17, 2019 at 19:27

You can extract information about meshes using functions like MeshCells and MeshCoordinates.

bm = BoundaryMesh[Cuboid[]]
sel = Select[MeshCoordinates[bm], #[[1]] == 1&]
hull = ConvexHullMesh[sel[[All, 2;;3]]]

Output of convex hull.

You might also be able to get away with using Polygon instead of ConvexHullMesh if your 2D mesh isn't always convex, but you'd have to be able to order the points of sel first.

  • $\begingroup$ Thank you, very interesting ideas. I hoped to find a function which easily creates a submesh. $\endgroup$ Oct 17, 2019 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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