I would like to use RegionErosion
to erode a Polygon
. This example from the docs works:
With[{reg = StadiumShape[{{0, 0}, {2, 2}}, 2]},
Show@{
Region[
Style[reg, FaceForm[None], EdgeForm[Dashed]]
]
,
Region[
RegionErosion[reg, Line[{{0, 0}, {1, 1}}]]
]
}
]
However, changing the region from a "stadium shape" to a Polygon fails:
With[{reg = Polygon[{{0, 0}, {0, 2}, {2, 0}}]},
Show@{
Region[
Style[reg, FaceForm[None], EdgeForm[Dashed]]
]
,
Region[
RegionErosion[reg, Line[{{0, 0}, {1, 1}}]]
]
}
]
Both shapes are Regions:
And wrapping the Polygon
in Region
produces the same error.
I'm sure I'm missing something obvious. Thoughts?
RegionErosion[reg, Line[{{0, 0}, {0, 1}, {1, 0}}]]
. $\endgroup$EmptyRegion[1]
, the empty subset of R^1. This is surprising because our shapes are 2-dimensional, not 1, so I'd expectEmptyRegion[2]
here. I see thatRegionEmbeddingDimension
returns 2 for the Polygon and the Line you suggested. $\endgroup$