---
title: "RegionUnion"
language: "en"
type: "Symbol"
summary: "RegionUnion[reg1, reg2, ...] gives the union of the regions reg1, reg2, ...."
keywords: 
- union of regions
- meet of regions
canonical_url: "https://reference.wolfram.com/language/ref/RegionUnion.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Derived Geometric Regions"
    link: "https://reference.wolfram.com/language/guide/DerivedRegions.en.md"
  - 
    title: "Geometric Computation"
    link: "https://reference.wolfram.com/language/guide/GeometricComputation.en.md"
  - 
    title: "Polygons"
    link: "https://reference.wolfram.com/language/guide/Polygons.en.md"
  - 
    title: "Polyhedra"
    link: "https://reference.wolfram.com/language/guide/Polyhedra.en.md"
  - 
    title: "Plane Geometry"
    link: "https://reference.wolfram.com/language/guide/PlaneGeometry.en.md"
  - 
    title: "Solid Geometry"
    link: "https://reference.wolfram.com/language/guide/SolidGeometry.en.md"
related_functions: 
  - 
    title: "RegionIntersection"
    link: "https://reference.wolfram.com/language/ref/RegionIntersection.en.md"
  - 
    title: "RegionDifference"
    link: "https://reference.wolfram.com/language/ref/RegionDifference.en.md"
  - 
    title: "RegionSymmetricDifference"
    link: "https://reference.wolfram.com/language/ref/RegionSymmetricDifference.en.md"
  - 
    title: "BooleanRegion"
    link: "https://reference.wolfram.com/language/ref/BooleanRegion.en.md"
---
# RegionUnion

RegionUnion[reg1, reg2, …] gives the union of the regions reg1, reg2, ….

## Details and Options

* A point ``p`` belongs to ``RegionUnion[reg1, reg2, …]`` if it belongs to some ``regi``.

[image]

* ``RegionUnion`` takes the same options as ``Region``.

## Examples (28)

### Basic Examples (2)

Union of two disks:

```wl
In[1]:= RegionUnion[Disk[{0, 0}, 2], Disk[{3, 0}, 2]];
```

Visualize it:

```wl
In[2]:= Region[%]

Out[2]= [image]
```

---

Union of two ``MeshRegion`` objects:

```wl
In[1]:= RegionUnion[[image], [image]]

Out[1]= [image]
```

### Scope (12)

#### Special Regions (6)

For some regions, the union is computed explicitly:

```wl
In[1]:=
Subscript[ℛ, 1] = Triangle[{{0, 0}, {0, 1}, {1, 0}}];
Subscript[ℛ, 2] = Disk[];

In[2]:= Subscript[ℛ, 3] = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]

Out[2]= Disk[{0, 0}]
```

Visualize the union:

```wl
In[3]:= Graphics[{Opacity[0.3], {Blue, Subscript[ℛ, 1]}, {Yellow, Subscript[ℛ, 2]}, {Red, Subscript[ℛ, 3]}}]

Out[3]= [image]
```

---

A union of ``Line`` regions:

```wl
In[1]:= Subscript[ℛ, 1] = RegionUnion[Line[{{1}, {2}}], Line[{{3}, {4}}]];
```

Visualize it:

```wl
In[2]:= Region[Subscript[ℛ, 1]]

Out[2]= [image]
```

With overlap:

```wl
In[3]:= Subscript[ℛ, 2] = RegionUnion[Line[{{1}, {3}}], Line[{{2}, {4}}]];
```

Visualize it:

```wl
In[4]:= Region[Subscript[ℛ, 2]]

Out[4]= [image]
```

---

A union of ``Polygon`` regions:

```wl
In[1]:=
Subscript[ℛ, 1] = Polygon[{{0, 0}, {3, -1}, {2, 0}, {3, 1}}];
Subscript[ℛ, 2] = Polygon[{{5, 0}, {2, 1}, {3, 0}, {2, -1}}];

In[2]:= ℛ = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];
```

Visualize it:

```wl
In[3]:= Region[ℛ]

Out[3]= [image]
```

---

A union of two ``Disk`` regions:

```wl
In[1]:= ℛ = RegionUnion[Disk[{0, 0}, 1], Disk[{1, 0}, 1]];
```

Visualize it:

```wl
In[2]:= Region[ℛ]

Out[2]= [image]
```

---

A union of two ``Cuboid`` regions:

```wl
In[1]:= ℛ = RegionUnion[Cuboid[], Cuboid[{0.5, 0.5, 0.5}]];
```

Visualize it:

```wl
In[2]:= Region[ℛ]

Out[2]= [image]
```

---

A union of regions with different ``RegionDimension`` :

```wl
In[1]:= ℛ = RegionUnion[Disk[{0, 0}, 1], Circle[{1, 0}, 1]];
```

Visualize it:

```wl
In[2]:= Region[ℛ]

Out[2]= [image]
```

#### Formula Regions (2)

A union of ``ImplicitRegion`` objects is an ``ImplicitRegion`` :

```wl
In[1]:=
Subscript[ℛ, 1] = ImplicitRegion[x ≤ -1, {x}];
Subscript[ℛ, 2] = ImplicitRegion[x ≥ 1, {x}];

In[2]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]

Out[2]= ImplicitRegion[x ≤ -1 || x ≥ 1, {x}]
```

2D:

```wl
In[3]:=
Subscript[ℛ, 1] = ImplicitRegion[x^2 + y^2 ≤ 1, {x, y}];
Subscript[ℛ, 2] = ImplicitRegion[x^2 + (y - 1)^2 ≤ 1, {x, y}];

In[4]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]

Out[4]= ImplicitRegion[x^2 + y^2 ≤ 1 || x^2 + y^2 ≤ 2 y, {x, y}]
```

3D:

```wl
In[5]:=
Subscript[ℛ, 1] = ImplicitRegion[x^2 + y^2 + z^2 ≤ 1, {x, y, z}];
Subscript[ℛ, 2] = ImplicitRegion[(x - 1)^2 + y^2 + z^2 ≤ 1, {x, y, z}];

In[6]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]

Out[6]= ImplicitRegion[x^2 + y^2 + z^2 ≤ 1 || x^2 + y^2 + z^2 ≤ 2 x, {x, y, z}]
```

nD:

```wl
In[7]:=
Subscript[ℛ, 1] = ImplicitRegion[x^2 + y^2 + z^2 + u^2 + v^2 ≤ 1, {x, y, z, u, v}];
Subscript[ℛ, 2] = ImplicitRegion[(x - 1)^2 + y^2 + z^2 + u^2 + v^2 ≤ 1, {x, y, z, u, v}];

In[8]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]

Out[8]= ImplicitRegion[x^2 + y^2 + z^2 + u^2 + v^2 ≤ 1 || x^2 + y^2 + z^2 + u^2 + v^2 ≤ 2 x, {x, y, z, u, v}]
```

---

A union of ``ParametricRegion`` objects:

```wl
In[1]:=
Subscript[ℛ, 1] = ParametricRegion[{u, v}, {{u, 0, 2}, {v, 0, 2}}];
Subscript[ℛ, 2] = ParametricRegion[{u + 1, v + 1}, {{u, 0, 2}, {v, 0, 2}}];

In[2]:= ℛ = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];
```

Visualize it:

```wl
In[3]:= Region[ℛ]

Out[3]= [image]
```

#### Mesh Regions (2)

A union of ``BoundaryMeshRegion`` objects is a ``BoundaryMeshRegion`` :

```wl
In[1]:= RegionUnion[[image], [image]]

Out[1]= [image]

In[2]:= BoundedRegionQ[%]

Out[2]= True
```

2D:

```wl
In[3]:= RegionUnion[[image], [image]]

Out[3]= [image]

In[4]:= BoundedRegionQ[%]

Out[4]= True
```

3D:

```wl
In[5]:= RegionUnion[[image], [image]]

Out[5]= [image]

In[6]:= BoundedRegionQ[%]

Out[6]= True
```

---

A union of full-dimensional ``MeshRegion`` objects is a ``MeshRegion`` :

```wl
In[1]:= RegionUnion[[image], [image]]

Out[1]= [image]

In[2]:= MeshRegionQ[%]

Out[2]= True
```

2D:

```wl
In[3]:= RegionUnion[[image], [image]]

Out[3]= [image]

In[4]:= MeshRegionQ[%]

Out[4]= True
```

3D:

```wl
In[5]:= RegionUnion[[image], [image]]

Out[5]= [image]

In[6]:= MeshRegionQ[%]

Out[6]= True
```

#### Derived Regions (2)

A union of ``BooleanRegion`` objects:

```wl
In[1]:=
Subscript[ℛ, 1] = BooleanRegion[Or, {Triangle[{{0, 0}, {2, 3}, {-2, 3}}], Triangle[{{0, 2}, {2, -1}, {-2, -1}}]}];
Subscript[ℛ, 2] = BooleanRegion[And, {Triangle[{{0, 0}, {2, 3}, {-2, 3}}], Triangle[{{0, 2}, {2, -1}, {-2, 2}}]}];

In[2]:= ℛ = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];
```

Visualize it:

```wl
In[3]:= Region[ℛ]

Out[3]= [image]
```

---

A union of ``TransformedRegion`` objects:

```wl
In[1]:=
Subscript[ℛ, 1] = TransformedRegion[Cuboid[], RotationTransform[Pi / 8, {1, 0, 0}]];
Subscript[ℛ, 2] = TransformedRegion[Cuboid[], RotationTransform[Pi / 8, {0, 1, 0}]];

In[2]:= ℛ = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];
```

Visualize it:

```wl
In[3]:= Region[ℛ]

Out[3]= [image]
```

### Applications (6)

Union of regions:

```wl
In[1]:= {Subscript[ℛ, 1], Subscript[ℛ, 2]} = {[image], [image]};

In[2]:= Multicolumn[Table[RegionUnion[Subscript[ℛ, 1], TransformedRegion[Subscript[ℛ, 2], TranslationTransform[{0, 0, t}]]], {t, 0, 2.5, 0.5}], 3, Appearance -> "Horizontal" ]

Out[2]=
|         |         |         |
| :------ | :------ | :------ |
| [image] | [image] | [image] |
| [image] | [image] | [image] |
```

---

Union of all South America countries to get the map:

```wl
In[1]:= countries = CountryData["SouthAmerica"]

Out[1]= {Entity["Country", "Argentina"], Entity["Country", "Bolivia"], Entity["Country", "Brazil"], Entity["Country", "Chile"], Entity["Country", "Colombia"], Entity["Country", "Ecuador"], Entity["Country", "FalklandIslands"], Entity["Country", "FrenchGuiana"], Entity["Country", "Guyana"], Entity["Country", "Paraguay"], Entity["Country", "Peru"], Entity["Country", "Suriname"], Entity["Country", "Uruguay"], Entity["Country", "Venezuela"]}
```

Country regions:

```wl
In[2]:= regs = Table[BoundaryDiscretizeGraphics[Polygon[First[c["Polygon"]][[1, 1]]]], {c, countries}]

Out[2]= [image]
```

South America map:

```wl
In[3]:= RegionUnion@@regs

Out[3]= [image]
```

---

Define a stadium as the union of disks and a rectangle:

```wl
In[1]:= stadium = RegionUnion[Disk[{0, 0}, 1], Rectangle[{0, -1}, {2, 1}], Disk[{2, 0}, 1]];

In[2]:= Region[stadium]

Out[2]= [image]
```

The area is the sum of disk and quadrilateral areas:

```wl
In[3]:= Area[stadium]

Out[3]= 4 + π

In[4]:= Area[Disk[{0, 0}, 1]] + Area[Rectangle[{0, -1}, {2, 1}]]

Out[4]= 4 + π
```

---

Define a capsule as the union of balls and a cylinder:

```wl
In[1]:= capsule = RegionUnion[Ball[{0, 0, 0}, 1], Cylinder[{{0, 0, 0}, {2, 0, 0}}, 1], Ball[{2, 0, 0}, 1]];

In[2]:= Region[capsule]

Out[2]= [image]
```

The volume is the sum of the ball and cylinder volumes:

```wl
In[3]:= Volume[capsule]

Out[3]= (10 π/3)

In[4]:= Volume[Ball[{0, 0, 0}, 1]] + Volume[Cylinder[{{0, 0, 0}, {2, 0, 0}}, 1]]

Out[4]= (10 π/3)
```

---

By taking a ``RegionUnion`` of many disks, dilation of a mesh can be approximated:

```wl
In[1]:= mr = BoundaryDiscretizeGraphics[Graphics[Text["\[Wolf]"]], _Text]

Out[1]= [image]
```

Create disks of the dilation radius around the mesh boundary:

```wl
In[2]:=
rad = 0.25;
pts = MeshCoordinates[mr];
disks = BoundaryDiscretizeRegion[Disk[#, rad]]& /@ pts;
```

Then simply take the union of all disks plus the original mesh:

```wl
In[3]:= RegionUnion[RegionUnion@@disks, mr]

Out[3]= [image]
```

---

By removing a ``RegionUnion`` of many disks, erosion of a mesh can be approximated:

```wl
In[1]:= mr = BoundaryDiscretizeGraphics[Graphics[Text["\[Wolf]"]], _Text]

Out[1]= [image]
```

Create disks of the erosion radius around the mesh boundary:

```wl
In[2]:=
rad = 0.1;
pts = MeshCoordinates[mr];
disks = BoundaryDiscretizeRegion[Disk[#, rad]]& /@ pts;
```

Then subtract the union of the disks from the original mesh:

```wl
In[3]:= RegionDifference[mr, RegionUnion@@disks]

Out[3]= [image]
```

### Properties & Relations (5)

A point ``p`` belongs to ``RegionUnion[reg1, reg2, …]`` if it belongs to some ``regi`` :

```wl
In[1]:=
Subscript[ℛ, 1] = Disk[{0, 0}, 2];
Subscript[ℛ, 2] = Disk[{0, 3}, 2];
Subscript[ℛ, 3] = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];
```

Use ``RegionMember`` to test membership:

```wl
In[2]:= p = {0, 1};

In[3]:= RegionMember[Subscript[ℛ, 3], p] == RegionMember[Subscript[ℛ, 1], p]∨ RegionMember[Subscript[ℛ, 2], p]

Out[3]= True
```

---

``RegionUnion`` is a Boolean combination ``Or`` of regions:

```wl
In[1]:= {Subscript[ℛ, 1], Subscript[ℛ, 2]} = {[image], [image]};

In[2]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]] == BooleanRegion[Or, {Subscript[ℛ, 1], Subscript[ℛ, 2]}]

Out[2]= True
```

---

``RegionSymmetricDifference`` can be found using ``RegionUnion`` and ``RegionDifference`` :

```wl
In[1]:= {Subscript[ℛ, 1], Subscript[ℛ, 2]} = {[image], [image]};

In[2]:= RegionSymmetricDifference[Subscript[ℛ, 1], Subscript[ℛ, 2]] == RegionUnion[RegionDifference[Subscript[ℛ, 1], Subscript[ℛ, 2]], RegionDifference[Subscript[ℛ, 2], Subscript[ℛ, 1]]]

Out[2]= True
```

---

The ``RegionDimension`` of a union is the max of all input dimensions:

```wl
In[1]:=
Subscript[ℛ, 1] = Point[{0, 0}];
Subscript[ℛ, 2] = Line[{{1, 0}, {1, 1}}];
Subscript[ℛ, 3] = Disk[{2, 0}, 1];

In[2]:= RegionDimension[RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2], Subscript[ℛ, 3]]] == Max[RegionDimension /@ {Subscript[ℛ, 1], Subscript[ℛ, 2], Subscript[ℛ, 3]}]

Out[2]= True
```

---

If two regions are disjoint, the ``RegionMeasure`` of their union is a sum:

```wl
In[1]:=
Subscript[ℛ, 1] = Disk[{0, 0}, 1];
Subscript[ℛ, 2] = Disk[{3, 0}, 1];
Subscript[ℛ, 3] = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];

In[2]:= RegionMeasure[Subscript[ℛ, 3]] == RegionMeasure[Subscript[ℛ, 1]] + RegionMeasure[Subscript[ℛ, 2]]

Out[2]= True
```

If they overlap, you must subtract the measure of the ``RegionIntersection`` :

```wl
In[3]:=
Subscript[ℛ, 1] = Disk[{0, 0}, 1];
Subscript[ℛ, 2] = Disk[{1, 0}, 1];
Subscript[ℛ, 3] = RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]];

In[4]:= RegionMeasure[Subscript[ℛ, 3]] == RegionMeasure[Subscript[ℛ, 1]] + RegionMeasure[Subscript[ℛ, 2]] - RegionMeasure[RegionIntersection[Subscript[ℛ, 1], Subscript[ℛ, 2]]]

Out[4]= True
```

### Possible Issues (2)

``RegionUnion`` is defined only for regions with the same ``RegionEmbeddingDimension`` :

```wl
In[1]:=
Subscript[ℛ, 1] = Disk[];
Subscript[ℛ, 2] = Ball[{0, 0, 1}, 1];

In[2]:= RegionUnion[Subscript[ℛ, 1], Subscript[ℛ, 2]]
```

BooleanRegion::dims: Boolean operations involving regions Disk[{0,0}] and Ball[{0,0,1},1] with different embedding dimensions are not well-defined.

```wl
Out[2]= RegionUnion[Disk[{0, 0}], Ball[{0, 0, 1}, 1]]
```

---

``RegionUnion`` may include overlapping lower-dimensional components:

```wl
In[1]:=
Subscript[ℛ, 1] = Sphere[];
Subscript[ℛ, 2] = Ball[{1 / 2, 0, 0}];

In[2]:= Graphics3D[{Yellow, Subscript[ℛ, 1], Green, Opacity@.5, Subscript[ℛ, 2]}]

Out[2]= [image]

In[3]:= Subscript[ℛ, 3] = RegionUnion[DiscretizeGraphics[Subscript[ℛ, 1]], BoundaryDiscretizeGraphics[Subscript[ℛ, 2]]]

Out[3]= [image]
```

The connected mesh components:

```wl
In[4]:= ConnectedMeshComponents[Subscript[ℛ, 3]]

Out[4]= {[image], [image]}
```

### Neat Examples (1)

The union of two spiral polygons:

```wl
In[1]:= RegionUnion[[image], [image]]

Out[1]= [image]
```

## See Also

* [`RegionIntersection`](https://reference.wolfram.com/language/ref/RegionIntersection.en.md)
* [`RegionDifference`](https://reference.wolfram.com/language/ref/RegionDifference.en.md)
* [`RegionSymmetricDifference`](https://reference.wolfram.com/language/ref/RegionSymmetricDifference.en.md)
* [`BooleanRegion`](https://reference.wolfram.com/language/ref/BooleanRegion.en.md)

## Related Guides

* [Derived Geometric Regions](https://reference.wolfram.com/language/guide/DerivedRegions.en.md)
* [Geometric Computation](https://reference.wolfram.com/language/guide/GeometricComputation.en.md)
* [`Polygons`](https://reference.wolfram.com/language/guide/Polygons.en.md)
* [`Polyhedra`](https://reference.wolfram.com/language/guide/Polyhedra.en.md)
* [Plane Geometry](https://reference.wolfram.com/language/guide/PlaneGeometry.en.md)
* [Solid Geometry](https://reference.wolfram.com/language/guide/SolidGeometry.en.md)

## History

* [Introduced in 2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) \| [Updated in 2017 (11.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.en.md)