({{, (RefLink[BooleanRegion, paclet:ref/BooleanRegion])[bfunc,{(Subscript[reg, 1]),(Subscript[reg, 2]),…}] 
represents the Boolean combination bfunc of regions (Subscript[reg, 1]), (Subscript[reg, 2]), ….}})

OpenersNotesSection(Spacer1)Details and Options

A point p belongs to (RefLink[BooleanRegion, paclet:ref/BooleanRegion])[bfunc,{(Subscript[reg, 1]),(Subscript[reg, 2]),…}] if bfunc[p∈(Subscript[reg, 1]),p∈(Subscript[reg, 2]),…] is (RefLink[True, paclet:ref/True]).

For (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]) (Subscript[reg, i]), (RefLink[BooleanRegion, paclet:ref/BooleanRegion]) represents the smallest (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]) that contains the Boolean combination of regions (Subscript[reg, i]).

For (RefLink[MeshRegion, paclet:ref/MeshRegion]) (Subscript[reg, i]), (RefLink[BooleanRegion, paclet:ref/BooleanRegion]) gives the smallest (RefLink[MeshRegion, paclet:ref/MeshRegion]) that contains the Boolean combination of regions (Subscript[reg, i]).

The following functions are equivalent:

(RefLink[BooleanRegion, paclet:ref/BooleanRegion]) takes the same options as (RefLink[Region, paclet:ref/Region]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (20)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

The Boolean (RefLink[Xor, paclet:ref/Xor]) of two disks:

BooleanRegion[Xor,{Disk[{-1/3,0},1],Disk[{1/3,0},1]}];

Visualize it:

Region[%]

A Boolean function applied to (RefLink[MeshRegion, paclet:ref/MeshRegion]) objects:

BooleanRegion[¬#2∧#1&,{,}]

OpenersExampleSection1(Spacer1)Scope  (11)

OpenersExampleSubsection0(Spacer1)Special Regions  (5)

A Boolean (RefLink[Or, paclet:ref/Or]) of (RefLink[Line, paclet:ref/Line]) regions:

ℛ=BooleanRegion[Or,{Line[{{1},{2}}],Line[{{3},{4}}],Line[{{5},{6}}]}];

Visualize it:

Region[ℛ]

A (RefLink[BooleanCountingFunction, paclet:ref/BooleanCountingFunction]) applied to (RefLink[Polygon, paclet:ref/Polygon]) regions:

pts={{-5,0},{1,-2},{-1,0},{1,2}};
{p1,p2,p3,p4}=Polygon/@{pts,-pts,Reverse/@pts,-Reverse/@pts};

ℛ=BooleanRegion[BooleanCountingFunction[{1,2},4],{p1,p2,p3,p4}];

Compute its (RefLink[Area, paclet:ref/Area]):

Area[ℛ]

A Boolean (RefLink[Xor, paclet:ref/Xor]) of two (RefLink[Disk, paclet:ref/Disk]) regions:

ℛ=BooleanRegion[Xor,{Disk[{0,0},1],Disk[{1,0},1]}];

Visualize it:

Region[ℛ]

A Boolean (RefLink[Or, paclet:ref/Or]) of two (RefLink[Cuboid, paclet:ref/Cuboid]) regions:

ℛ=BooleanRegion[Or,{Cuboid[],Cuboid[{0.5,0.5,0.5}]}];

Visualize it:

Region[ℛ]

A Boolean (RefLink[And, paclet:ref/And]) of regions with different (RefLink[RegionDimension, paclet:ref/RegionDimension]):

ℛ=BooleanRegion[And,{Disk[{0,0},1],Circle[{0,1},1]}];

Visualize it:

Region[ℛ]

OpenersExampleSubsection1(Spacer1)Formula Regions  (2)

A Boolean (RefLink[Xor, paclet:ref/Xor]) of (RefLink[ImplicitRegion, paclet:ref/ImplicitRegion]) objects is an (RefLink[ImplicitRegion, paclet:ref/ImplicitRegion]):

(Subscript[ℛ, 1])=ImplicitRegion[x≤1,{x}];
(Subscript[ℛ, 2])=ImplicitRegion[x≥-1,{x}];

BooleanRegion[Xor,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

2D:

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

BooleanRegion[Xor,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

3D:

(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}];

BooleanRegion[Xor,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

nD:

(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}];

BooleanRegion[Xor,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

A Boolean function applied to (RefLink[ParametricRegion, paclet:ref/ParametricRegion]) objects:

(Subscript[ℛ, 1])=ParametricRegion[{u,v,w},{{u,0,2},{v,0,2},{w,0,2}}];
(Subscript[ℛ, 2])=ParametricRegion[{u-1,v+1,w-1},{{u,0,2},{v,0,2},{w,0,2}}];

ℛ=BooleanRegion[¬#1∧#2&,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}];

Visualize it:

Region[ℛ]

OpenersExampleSubsection2(Spacer1)Mesh Regions  (2)

A Boolean function of (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]) objects is a (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]):

BooleanRegion[¬#2∧#1&,{,}]

BoundedRegionQ[%]

2D:

BooleanRegion[¬#2∧#1&,{,}]

BoundedRegionQ[%]

3D:

BooleanRegion[¬#2∧#1&,{,}]

BoundedRegionQ[%]

A Boolean function of full dimensional (RefLink[MeshRegion, paclet:ref/MeshRegion]) objects is a (RefLink[MeshRegion, paclet:ref/MeshRegion]):

BooleanRegion[¬#2∧#1&,{,}]

MeshRegionQ[%]

2D:

BooleanRegion[¬#2∧#1&,{,}]

MeshRegionQ[%]

3D:

BooleanRegion[¬#2∧#1&,{,}]

MeshRegionQ[%]

OpenersExampleSubsection3(Spacer1)Derived Regions  (2)

A Boolean function of (RefLink[BooleanRegion, paclet:ref/BooleanRegion]) objects:

(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}}]}];

ℛ=BooleanRegion[¬#2∧#1&,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}];

Visualize it:

Region[ℛ]

A Boolean (RefLink[Or, paclet:ref/Or]) of (RefLink[TransformedRegion, paclet:ref/TransformedRegion]) objects:

(Subscript[ℛ, 1])=TransformedRegion[Cuboid[],RotationTransform[Pi/8,{1,0,0}]];
(Subscript[ℛ, 2])=TransformedRegion[Cuboid[],RotationTransform[Pi/8,{0,1,0}]];

ℛ=BooleanRegion[Or,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}];

Visualize it:

Region[ℛ]

OpenersExampleSection3(Spacer1)Applications  (1)

Boolean operations over regions:

{a,b}={,};

Multicolumn[Table[BooleanRegion[op,{a,b},PlotLabel-> op,BaseStyle->Opacity[0.7]],{op, {Or, And,¬#2∧#1&,#1⊻#2&}}],2]

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

(RefLink[RegionUnion, paclet:ref/RegionUnion]) is a Boolean combination (RefLink[Or, paclet:ref/Or]) of regions:

{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])} = {,};

RegionUnion[(Subscript[ℛ, 1]),(Subscript[ℛ, 2])]==BooleanRegion[Or,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

(RefLink[RegionIntersection, paclet:ref/RegionIntersection]):

RegionIntersection[(Subscript[ℛ, 1]),(Subscript[ℛ, 2])]==BooleanRegion[And,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

(RefLink[RegionDifference, paclet:ref/RegionDifference]):

RegionDifference[(Subscript[ℛ, 1]),(Subscript[ℛ, 2])]==BooleanRegion[¬#2∧#1&,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

(RefLink[RegionSymmetricDifference, paclet:ref/RegionSymmetricDifference]):

RegionSymmetricDifference[(Subscript[ℛ, 1]),(Subscript[ℛ, 2])]==BooleanRegion[Xor,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

The (RefLink[RegionMeasure, paclet:ref/RegionMeasure]) of a Boolean (RefLink[And, paclet:ref/And]) obeys a simple formula:

(Subscript[ℛ, 1])=Disk[{0,0},1];
(Subscript[ℛ, 2])=Disk[{1,0},1];
(Subscript[ℛ, 3])=BooleanRegion[And,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}];

Subtract the measure of the (RefLink[RegionUnion, paclet:ref/RegionUnion]) from the sum of the measures:

RegionMeasure[(Subscript[ℛ, 3])]==RegionMeasure[(Subscript[ℛ, 1])]+RegionMeasure[(Subscript[ℛ, 2])]-RegionMeasure[RegionUnion[(Subscript[ℛ, 1]),(Subscript[ℛ, 2])]]

OpenersExampleSection5(Spacer1)Possible Issues  (3)

(RefLink[BooleanRegion, paclet:ref/BooleanRegion]) is defined only for regions with the same (RefLink[RegionEmbeddingDimension, paclet:ref/RegionEmbeddingDimension]):

(Subscript[ℛ, 1])=Disk[];
(Subscript[ℛ, 2])=Ball[{0,0,1},1];

BooleanRegion[Or,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

Components of dimension less than the embedding dimension may be omitted:

(Subscript[ℛ, 1])=MeshRegion[{{0,0,0},{2,0,0},{2,2,0},{1,1,2}},Tetrahedron[{1,2,3,4}]];
(Subscript[ℛ, 2])=MeshRegion[{{0,0,0},{2,2,0},{0,2,0},{1,1,2}},Tetrahedron[{1,2,3,4}],PlotTheme->"Web"];

Show[{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

BooleanRegion[And,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

Turn on a message:

On[BooleanRegion::drc]

BooleanRegion[And,{(Subscript[ℛ, 1]),(Subscript[ℛ, 2])}]

(RefLink[BooleanRegion, paclet:ref/BooleanRegion]) may include overlapping lower-dimensional components:

(Subscript[ℛ, 1])=Sphere[];
(Subscript[ℛ, 2])=Ball[{1/2,0,0}];

Graphics3D[{Yellow,(Subscript[ℛ, 1]),Green,Opacity@.5,(Subscript[ℛ, 2])}]

(Subscript[ℛ, 3])=BooleanRegion[Or,{DiscretizeGraphics[(Subscript[ℛ, 1])],BoundaryDiscretizeGraphics[(Subscript[ℛ, 2])]}]

The connected mesh components:

ConnectedMeshComponents[(Subscript[ℛ, 3])]

OpenersExampleSection6(Spacer1)Neat Examples  (1)

The Boolean (RefLink[Xor, paclet:ref/Xor]) of two spiral polygons:

BooleanRegion[Xor,{,}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[RegionUnion, paclet:ref/RegionUnion])  ▪  (RefLink[RegionIntersection, paclet:ref/RegionIntersection])  ▪  (RefLink[RegionDifference, paclet:ref/RegionDifference])  ▪  (RefLink[RegionSymmetricDifference, paclet:ref/RegionSymmetricDifference])  ▪  (RefLink[And, paclet:ref/And])  ▪  (RefLink[Or, paclet:ref/Or])  ▪  (RefLink[BooleanFunction, paclet:ref/BooleanFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Derived Geometric Regions, paclet:guide/DerivedRegions])}, {▪(RefLinkPlain[Geometric Computation, paclet:guide/GeometricComputation])}, {▪(RefLinkPlain[Polygons, paclet:guide/Polygons])}, {▪(RefLinkPlain[Polyhedra, paclet:guide/Polyhedra])}})}})