gives the difference of the regions reg1 and reg2.
Details and Options
- A point p belongs to RegionDifference[reg1,reg2] if it belongs to reg1 but not reg2.
- For BoundaryMeshRegion reg1 and reg2, RegionDifference gives the smallest BoundaryMeshRegion that contains the difference of reg1 and reg2.
- For MeshRegion reg1 and reg2, RegionDifference gives the smallest MeshRegion that contains the difference of reg1 and reg2.
- RegionDifference takes the same options as Region.
Examplesopen allclose all
Basic Examples (2)
Difference of two MeshRegion objects:
Special Regions (6)
A difference of Line regions:
A difference of Polygon regions:
A difference of two Cuboid regions:
A difference of regions with different RegionDimension:
Formula Regions (2)
Mesh Regions (2)
Properties & Relations (5)
A point p belongs to RegionDifference[reg1,reg2] if it belongs to reg1 but not reg2:
Use RegionMember to test membership:
RegionDifference is a Boolean combination ¬#2∧#1 of two regions:
The RegionDimension of a difference is at most that of the first input:
If two regions are disjoint, the RegionMeasure of their difference is that of the first input:
If they overlap, you must subtract the measure of the RegionIntersection:
Possible Issues (1)
Difference is defined only for regions with the same RegionEmbeddingDimension:
Wolfram Research (2014), RegionDifference, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionDifference.html (updated 2017).
Wolfram Language. 2014. "RegionDifference." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/RegionDifference.html.
Wolfram Language. (2014). RegionDifference. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionDifference.html