# Select Part of a boundary mesh

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

bm=BoundaryMesh[Cuboid[]]


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

Thanks!

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

Needs["MeshTools"]

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]]


• Thanks for this helpful tool, I'll try to select the side mesh. Oct 17 '19 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]]]


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.

• Thank you, very interesting ideas. I hoped to find a function which easily creates a submesh. Oct 17 '19 at 17:52