I am interested in generating 3D a joint `BoundaryMeshRegion`

or a `MeshRegion`

in different shapes and polygons. This works for `RandomPolygon`

:

I):

```
r1 = BoundaryDiscretizeGraphics(
Graphics(RandomPolygon(15,
DataRange -> {{0.02, 0.08}, {-0.02, 0.04}})));
r2 = BoundaryDiscretizeGraphics(
Graphics(RandomPolygon(12,
DataRange -> {{0.00, 0.03}, {-0.02, 0.03}})))
bnd1 = RegionProduct(r1, MeshRegion({{0.01}, {0.05}}, Line({1, 2})));
bnd2 = RegionProduct(r2, MeshRegion({{0}, {0.02}}, Line({1, 2})));
un1 = RegionUnion(bnd2, bnd3);
Show(un1, Boxed->True, Axes->True)
```

I also wanted to include the shape of a country and combine it with a random polygon or other form of country in a similar way, which is possible as long as they are combined in 2D state:

ii):

```
r3 = BoundaryDiscretizeGraphics(CountryData("Spain", "Shape"),
ImageSize -> Medium, Axes -> True)
r4 = BoundaryDiscretizeGraphics(
Graphics(RandomPolygon(15,
DataRange -> {{0.05, 0.3}, {-0.08, 0.08}})));
bnd3 = RegionUnion(r3, r4);
un2 = RegionProduct(bnd3, MeshRegion({{0}, {0.02}}, Line({1, 2})));
Show(un2, Boxed->True, Axes->True)
```

However, as soon as an attempt is made to combine a generated 3D form of a country with a generated 3D form of the Polygon, the following results are obtained:

iii):

```
bnd31 = RegionProduct(r3, MeshRegion({{0.0}, {0.02}}, Line({1, 2})));
r5 = BoundaryDiscretizeGraphics(
Graphics(RandomPolygon(8,
DataRange -> {{0.03, 0.12}, {-0.06, 0.06}})));
bnd32 = RegionProduct(r5, MeshRegion({{0.015}, {0.03}}, Line({1, 2})));
RegionUnion(bnd31, bnd32);
```

In some cases, Mathematica crashes.

How would you solve this problem? My goal is to combine a 3D form of a country with a 3D form of `RandomPolygon`

, so that both shapes have different heights from each other. However, the volumes must be connected to each other (similar to ii), since I would like to apply a `RegionMemberFunction`

in a later step

The code for the generation of 3D shapes was found here:

How to extrude a 3D image from a binary 2D image

I am running in Mathematica 12.

In advance, thank you very much for your help!