This also works:
pts = {{1, 1}, {-1, 1}, {-1, 0}, {-1/2, 0},
{0, -1/2}, {0, -1}, {1, -1}};
RegionDifference[Rectangle[{-2, -2}, {2, 2}], Polygon[pts]]
How about this?:
pts = {{1, 1}, {-1, 1}, {-1, 0}, {-1/2,
0}, {0, -1/2}, {0, -1}, {1, -1}};
exterior = RegionDifference[FullRegion[2], Polygon[pts]]
That also works. Thanks
Thanks for the different approaches ā this clarifies the distinction between bounding with a finite rectangle and using FullRegion.
I have a related question: if the goal is to work symbolically with the true exterior region (unbounded) ā for example to integrate over it or apply further region operations ā is RegionDifference[FullRegion[2], [\[Polygon\]][1] ][pts]] always the preferred formulation?
In particular:
- Does using
FullRegion[2]have any performance or simplification implications compared to a large bounding rectangle? - Are there cases where
Reduce[!Element[{x,y}, poly], ā¦]would produce a more suitable representation for downstream symbolic manipulation?
Iām trying to understand which representation is more robust when the exterior region is used in subsequent analytic computations rather than just plotting.
Appreciate any insight.
Playing around with FullRegion[2] I discovered, to my surprise, that we can DiscretizeRegion the whole plane, without any warning, resulting in a square with finite measure:
DiscretizeRegion[FullRegion[2]]
RegionMeasure[%]
or even this:
BoundaryDiscretizeRegion[FullRegion[2]]
RegionMeasure[%]
