Why does the first one return EmptyRegion[2]
while the second one works?
I expected the result is Line[{{0, 0}, {1, 1}}]
as the second one.
RegionIntersection[
Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}],
Line[{{0, 0}, {1, 1}}]]
RegionIntersection[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}],
Line[{{0, 0}, {1, 1}}]]
Aslo how does EmptyRegion is defined? I read the docs but still not quite clear. It seems like a point is not empty in R but empty in R2.
How would I define a polygon region like above but without the boundary?
V12
I got the outputLine[{{0, 0}, {1, 1}}]
from the first one; seeimage
$\endgroup$12.0.0
. Maybe others can check on other versions. If nobody checks, I will run a check on13.0.0
in the morning $\endgroup$EmptyRegion[2]
andLine[{{0, 0}, {1, 1}}]]
) on v13.0.0.0 $\endgroup$RegionEqual[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}], Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}]]
isTrue
indicate that it is a bug. $\endgroup$